… | |
… | |
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 | |
… | |
… | |
508 | uulist *li |
507 | uulist *li |
509 | char * newfilename |
508 | char * newfilename |
510 | CODE: |
509 | CODE: |
511 | if (newfilename) |
510 | if (newfilename) |
512 | { |
511 | { |
513 | _FP_free (li->filename); |
512 | FP_free (li->filename); |
514 | li->filename = _FP_strdup (newfilename); |
513 | li->filename = FP_strdup (newfilename); |
515 | } |
514 | } |
516 | RETVAL = li->filename; |
515 | RETVAL = li->filename; |
517 | OUTPUT: |
516 | OUTPUT: |
518 | RETVAL |
517 | RETVAL |
519 | |
518 | |