… | |
… | |
4 | |
4 | |
5 | #include "perlmulticore.h" |
5 | #include "perlmulticore.h" |
6 | |
6 | |
7 | #include "uulib/fptools.h" |
7 | #include "uulib/fptools.h" |
8 | #include "uulib/uudeview.h" |
8 | #include "uulib/uudeview.h" |
9 | #include "uulib/uuint.h" |
|
|
10 | |
9 | |
11 | static int perlinterp_released; |
10 | static int perlinterp_released; |
12 | |
11 | |
13 | #define RELEASE do { perlinterp_released = 1; perlinterp_release (); } while (0) |
12 | #define RELEASE do { perlinterp_released = 1; perlinterp_release (); } while (0) |
14 | #define ACQUIRE do { perlinterp_acquire (); perlinterp_released = 0; } while (0) |
13 | #define ACQUIRE do { perlinterp_acquire (); perlinterp_released = 0; } while (0) |
… | |
… | |
84 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
83 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
85 | |
84 | |
86 | if (count != 1) |
85 | if (count != 1) |
87 | croak ("fnamefilter perl callback MUST return a single filename exactly"); |
86 | croak ("fnamefilter perl callback MUST return a single filename exactly"); |
88 | |
87 | |
89 | _FP_free (str); str = _FP_strdup (SvPV_nolen (TOPs)); |
88 | FP_free (str); str = FP_strdup (SvPV_nolen (TOPs)); |
90 | |
89 | |
91 | PUTBACK; FREETMPS; LEAVE; |
90 | PUTBACK; FREETMPS; LEAVE; |
92 | |
91 | |
93 | } TEMP_RELEASE; |
92 | } TEMP_RELEASE; |
94 | |
93 | |
… | |
… | |
135 | dSP; |
134 | dSP; |
136 | int count; |
135 | int count; |
137 | |
136 | |
138 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
137 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
139 | |
138 | |
140 | PUSHs (sv_2mortal(newSVpv(subject, 0))); |
139 | PUSHs (sv_2mortal (newSVpv (subject, 0))); |
141 | PUSHs (filename ? sv_2mortal(newSVpv(filename, 0)) : &PL_sv_undef); |
140 | PUSHs (filename ? sv_2mortal (newSVpv (filename, 0)) : &PL_sv_undef); |
142 | |
141 | |
143 | PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
142 | PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
144 | |
143 | |
145 | if (count > 1) |
144 | if (count > 1) |
146 | croak ("filenamecallback perl callback must return nothing or a single filename"); |
145 | croak ("filenamecallback perl callback must return nothing or a single filename"); |
147 | |
146 | |
148 | if (count) |
147 | if (count) |
149 | { |
148 | { |
150 | _FP_free (filename); |
149 | FP_free (filename); |
151 | |
150 | |
152 | filename = SvOK (TOPs) |
151 | filename = SvOK (TOPs) |
153 | ? _FP_strdup (SvPV_nolen (TOPs)) |
152 | ? FP_strdup (SvPV_nolen (TOPs)) |
154 | : 0; |
153 | : 0; |
155 | } |
154 | } |
156 | |
155 | |
157 | PUTBACK; FREETMPS; LEAVE; |
156 | PUTBACK; FREETMPS; LEAVE; |
158 | |
157 | |
… | |
… | |
343 | char * outfname |
342 | char * outfname |
344 | char * mimetype |
343 | char * mimetype |
345 | int filemode |
344 | int filemode |
346 | |
345 | |
347 | int |
346 | int |
348 | UUEncodePartial(outfile,infile,infname,encoding,outfname,mimetype,filemode,partno,linperfile) |
347 | UUEncodePartial(outfile,infile,infname,encoding,outfname,mimetype,filemode,partno,linperfile,crc) |
349 | FILE * outfile |
348 | FILE * outfile |
350 | FILE * infile |
349 | FILE * infile |
351 | char * infname |
350 | char * infname |
352 | int encoding |
351 | int encoding |
353 | char * outfname |
352 | char * outfname |
354 | char * mimetype |
353 | char * mimetype |
355 | int filemode |
354 | int filemode |
356 | int partno |
355 | int partno |
357 | long linperfile |
356 | long linperfile |
|
|
357 | U32 &crc |
|
|
358 | OUTPUT: |
|
|
359 | RETVAL |
|
|
360 | crc |
358 | |
361 | |
359 | int |
362 | int |
360 | UUEncodeToStream(outfile,infile,infname,encoding,outfname,filemode) |
363 | UUEncodeToStream(outfile,infile,infname,encoding,outfname,filemode) |
361 | FILE * outfile |
364 | FILE * outfile |
362 | FILE * infile |
365 | FILE * infile |
… | |
… | |
508 | uulist *li |
511 | uulist *li |
509 | char * newfilename |
512 | char * newfilename |
510 | CODE: |
513 | CODE: |
511 | if (newfilename) |
514 | if (newfilename) |
512 | { |
515 | { |
513 | _FP_free (li->filename); |
516 | FP_free (li->filename); |
514 | li->filename = _FP_strdup (newfilename); |
517 | li->filename = FP_strdup (newfilename); |
515 | } |
518 | } |
516 | RETVAL = li->filename; |
519 | RETVAL = li->filename; |
517 | OUTPUT: |
520 | OUTPUT: |
518 | RETVAL |
521 | RETVAL |
519 | |
522 | |