Convert-IBM390
view release on metacpan or search on metacpan
asc2eb(instring_sv)
SV * instring_sv
PROTOTYPE: $
PREINIT:
STRLEN ilength;
char * instring;
char * outstring_wk;
/* To avoid allocating small amounts of storage: */
char shorty[SHORTY_SIZE];
PPCODE:
instring = SvPV(instring_sv, ilength);
#ifdef DEBUG390
fprintf(stderr, "*D* asc2eb: beginning; length %d\n", ilength);
#endif
if (ilength <= SHORTY_SIZE) {
CF_fcs_xlate(shorty, instring, ilength, a2e_table);
PUSHs(sv_2mortal(newSVpvn(shorty, ilength)));
} else {
New(0, outstring_wk, ilength, char);
CF_fcs_xlate(outstring_wk, instring, ilength, a2e_table);
eb2asc(instring_sv)
SV * instring_sv
PROTOTYPE: $
PREINIT:
STRLEN ilength;
char * instring;
char * outstring_wk;
/* To avoid allocating small amounts of storage: */
char shorty[SHORTY_SIZE];
PPCODE:
instring = SvPV(instring_sv, ilength);
#ifdef DEBUG390
fprintf(stderr, "*D* eb2asc: beginning; length %d\n", ilength);
#endif
if (ilength <= SHORTY_SIZE) {
CF_fcs_xlate(shorty, instring, ilength, e2a_table);
PUSHs(sv_2mortal(newSVpvn(shorty, ilength)));
} else {
New(0, outstring_wk, ilength, char);
CF_fcs_xlate(outstring_wk, instring, ilength, e2a_table);
eb2ascp(instring_sv)
SV * instring_sv
PROTOTYPE: $
PREINIT:
STRLEN ilength;
char * instring;
char * outstring_wk;
/* To avoid allocating small amounts of storage: */
char shorty[SHORTY_SIZE];
PPCODE:
instring = SvPV(instring_sv, ilength);
#ifdef DEBUG390
fprintf(stderr, "*D* eb2ascp: beginning; length %d\n", ilength);
#endif
if (ilength <= SHORTY_SIZE) {
CF_fcs_xlate(shorty, instring, ilength, e2ap_table);
PUSHs(sv_2mortal(newSVpvn(shorty, ilength)));
} else {
New(0, outstring_wk, ilength, char);
CF_fcs_xlate(outstring_wk, instring, ilength, e2ap_table);
static char space10[] = " ";
static char espace10[] =
{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 };
I32 along;
char *aptr;
double adouble;
/* The eb_work area is long, but what the heck? Memory is cheap. */
char eb_work[32800];
PPCODE:
#ifdef DEBUG390
fprintf(stderr, "*D* packeb: beginning\n");
#endif
ii = 1;
oi = 0;
patend = pat + strlen(pat);
while (pat < patend) {
/* Have we gone past the end of the list of values? If so, stop. */
if (ii >= items)
/* Work fields */
I32 along;
unsigned long aulong;
/* Some day we may want to support S/390 floats.... */
/*float afloat;*/
double adouble;
/* The eb_work area is long, but what the heck? Memory is cheap. */
char eb_work[32800];
PPCODE:
#ifdef DEBUG390
fprintf(stderr, "*D* unpackeb: beginning\n");
#endif
s = sbegin = SvPV(ebrecord, rlen);
strend = s + rlen;
patend = pat + strlen(pat);
while (pat < patend) {
datumtype = *pat++;
if (isSPACE(datumtype))
( run in 2.062 seconds using v1.01-cache-2.11-cpan-71847e10f99 )