… | |
… | |
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 released; |
10 | static int perlinterp_released; |
12 | |
11 | |
13 | #define RELEASE do { released = 1; perlinterp_release (); } while (0) |
12 | #define RELEASE do { perlinterp_released = 1; perlinterp_release (); } while (0) |
14 | #define ACQUIRE do { perlinterp_acquire (); released = 0; } while (0) |
13 | #define ACQUIRE do { perlinterp_acquire (); perlinterp_released = 0; } while (0) |
15 | |
14 | |
16 | #define TEMP_ACQUIRE if (released) perlinterp_acquire (); |
15 | #define TEMP_ACQUIRE if (perlinterp_released) perlinterp_acquire (); |
17 | #define TEMP_RELEASE if (released) perlinterp_release (); |
16 | #define TEMP_RELEASE if (perlinterp_released) perlinterp_release (); |
18 | |
|
|
19 | static int |
|
|
20 | not_here (char *s) |
|
|
21 | { |
|
|
22 | croak("%s not implemented", s); |
|
|
23 | return -1; |
|
|
24 | } |
|
|
25 | |
|
|
26 | static int |
|
|
27 | constant (char *name) |
|
|
28 | { |
|
|
29 | errno = 0; |
|
|
30 | switch (*name) |
|
|
31 | { |
|
|
32 | case 'A': |
|
|
33 | if (strEQ(name, "ACT_COPYING")) return UUACT_COPYING; |
|
|
34 | if (strEQ(name, "ACT_DECODING")) return UUACT_DECODING; |
|
|
35 | if (strEQ(name, "ACT_ENCODING")) return UUACT_ENCODING; |
|
|
36 | if (strEQ(name, "ACT_IDLE")) return UUACT_IDLE; |
|
|
37 | if (strEQ(name, "ACT_SCANNING")) return UUACT_SCANNING; |
|
|
38 | case 'F': |
|
|
39 | if (strEQ(name, "FILE_DECODED")) return UUFILE_DECODED; |
|
|
40 | if (strEQ(name, "FILE_ERROR")) return UUFILE_ERROR; |
|
|
41 | if (strEQ(name, "FILE_MISPART")) return UUFILE_MISPART; |
|
|
42 | if (strEQ(name, "FILE_NOBEGIN")) return UUFILE_NOBEGIN; |
|
|
43 | if (strEQ(name, "FILE_NODATA")) return UUFILE_NODATA; |
|
|
44 | if (strEQ(name, "FILE_NOEND")) return UUFILE_NOEND; |
|
|
45 | if (strEQ(name, "FILE_OK")) return UUFILE_OK; |
|
|
46 | if (strEQ(name, "FILE_READ")) return UUFILE_READ; |
|
|
47 | if (strEQ(name, "FILE_TMPFILE")) return UUFILE_TMPFILE; |
|
|
48 | break; |
|
|
49 | case 'M': |
|
|
50 | if (strEQ(name, "MSG_ERROR")) return UUMSG_ERROR; |
|
|
51 | if (strEQ(name, "MSG_FATAL")) return UUMSG_FATAL; |
|
|
52 | if (strEQ(name, "MSG_MESSAGE")) return UUMSG_MESSAGE; |
|
|
53 | if (strEQ(name, "MSG_NOTE")) return UUMSG_NOTE; |
|
|
54 | if (strEQ(name, "MSG_PANIC")) return UUMSG_PANIC; |
|
|
55 | if (strEQ(name, "MSG_WARNING")) return UUMSG_WARNING; |
|
|
56 | case 'O': |
|
|
57 | if (strEQ(name, "OPT_VERSION")) return UUOPT_VERSION; |
|
|
58 | if (strEQ(name, "OPT_FAST")) return UUOPT_FAST; |
|
|
59 | if (strEQ(name, "OPT_DUMBNESS")) return UUOPT_DUMBNESS; |
|
|
60 | if (strEQ(name, "OPT_BRACKPOL")) return UUOPT_BRACKPOL; |
|
|
61 | if (strEQ(name, "OPT_VERBOSE")) return UUOPT_VERBOSE; |
|
|
62 | if (strEQ(name, "OPT_DESPERATE")) return UUOPT_DESPERATE; |
|
|
63 | if (strEQ(name, "OPT_IGNREPLY")) return UUOPT_IGNREPLY; |
|
|
64 | if (strEQ(name, "OPT_OVERWRITE")) return UUOPT_OVERWRITE; |
|
|
65 | if (strEQ(name, "OPT_SAVEPATH")) return UUOPT_SAVEPATH; |
|
|
66 | if (strEQ(name, "OPT_IGNMODE")) return UUOPT_IGNMODE; |
|
|
67 | if (strEQ(name, "OPT_DEBUG")) return UUOPT_DEBUG; |
|
|
68 | if (strEQ(name, "OPT_ERRNO")) return UUOPT_ERRNO; |
|
|
69 | if (strEQ(name, "OPT_PROGRESS")) return UUOPT_PROGRESS; |
|
|
70 | if (strEQ(name, "OPT_USETEXT")) return UUOPT_USETEXT; |
|
|
71 | if (strEQ(name, "OPT_PREAMB")) return UUOPT_PREAMB; |
|
|
72 | if (strEQ(name, "OPT_TINYB64")) return UUOPT_TINYB64; |
|
|
73 | if (strEQ(name, "OPT_ENCEXT")) return UUOPT_ENCEXT; |
|
|
74 | if (strEQ(name, "OPT_REMOVE")) return UUOPT_REMOVE; |
|
|
75 | if (strEQ(name, "OPT_MOREMIME")) return UUOPT_MOREMIME; |
|
|
76 | if (strEQ(name, "OPT_DOTDOT")) return UUOPT_DOTDOT; |
|
|
77 | if (strEQ(name, "OPT_RBUF")) return UUOPT_RBUF; |
|
|
78 | if (strEQ(name, "OPT_WBUF")) return UUOPT_WBUF; |
|
|
79 | if (strEQ(name, "OPT_AUTOCHECK")) return UUOPT_AUTOCHECK; |
|
|
80 | case 'R': |
|
|
81 | if (strEQ(name, "RET_CANCEL")) return UURET_CANCEL; |
|
|
82 | if (strEQ(name, "RET_CONT")) return UURET_CONT; |
|
|
83 | if (strEQ(name, "RET_EXISTS")) return UURET_EXISTS; |
|
|
84 | if (strEQ(name, "RET_ILLVAL")) return UURET_ILLVAL; |
|
|
85 | if (strEQ(name, "RET_IOERR")) return UURET_IOERR; |
|
|
86 | if (strEQ(name, "RET_NODATA")) return UURET_NODATA; |
|
|
87 | if (strEQ(name, "RET_NOEND")) return UURET_NOEND; |
|
|
88 | if (strEQ(name, "RET_NOMEM")) return UURET_NOMEM; |
|
|
89 | if (strEQ(name, "RET_OK")) return UURET_OK; |
|
|
90 | if (strEQ(name, "RET_UNSUP")) return UURET_UNSUP; |
|
|
91 | case 'B': |
|
|
92 | if (strEQ(name, "B64_ENCODED")) return B64ENCODED; |
|
|
93 | if (strEQ(name, "BH_ENCODED")) return BH_ENCODED; |
|
|
94 | case 'P': |
|
|
95 | if (strEQ(name, "PT_ENCODED")) return PT_ENCODED; |
|
|
96 | case 'Q': |
|
|
97 | if (strEQ(name, "QP_ENCODED")) return QP_ENCODED; |
|
|
98 | case 'U': |
|
|
99 | if (strEQ(name, "UU_ENCODED")) return UU_ENCODED; |
|
|
100 | case 'X': |
|
|
101 | if (strEQ(name, "XX_ENCODED")) return XX_ENCODED; |
|
|
102 | case 'Y': |
|
|
103 | if (strEQ(name, "YENC_ENCODED")) return YENC_ENCODED; |
|
|
104 | } |
|
|
105 | |
|
|
106 | errno = EINVAL; |
|
|
107 | return 0; |
|
|
108 | } |
|
|
109 | |
17 | |
110 | static void |
18 | static void |
111 | uu_msg_callback (void *cb, char *msg, int level) |
19 | uu_msg_callback (void *cb, char *msg, int level) |
112 | { |
20 | { |
113 | TEMP_ACQUIRE { |
21 | TEMP_ACQUIRE { |
114 | |
22 | |
115 | dSP; |
23 | dSP; |
116 | |
24 | |
117 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
25 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
118 | |
26 | |
119 | PUSHs (sv_2mortal (newSVpv (msg, 0))); |
27 | PUSHs (sv_2mortal (newSVpv (msg, 0))); |
120 | PUSHs (sv_2mortal (newSViv (level))); |
28 | PUSHs (sv_2mortal (newSViv (level))); |
121 | |
29 | |
122 | PUTBACK; (void) perl_call_sv ((SV *)cb, G_VOID|G_DISCARD); SPAGAIN; |
30 | PUTBACK; (void) perl_call_sv ((SV *)cb, G_VOID|G_DISCARD); SPAGAIN; |
123 | PUTBACK; FREETMPS; LEAVE; |
31 | PUTBACK; FREETMPS; LEAVE; |
124 | |
32 | |
125 | } TEMP_RELEASE; |
33 | } TEMP_RELEASE; |
126 | } |
34 | } |
127 | |
35 | |
128 | static int |
36 | static int |
… | |
… | |
130 | { |
38 | { |
131 | int retval; |
39 | int retval; |
132 | |
40 | |
133 | TEMP_ACQUIRE { |
41 | TEMP_ACQUIRE { |
134 | |
42 | |
135 | dSP; |
43 | dSP; |
136 | int count; |
44 | int count; |
137 | |
45 | |
138 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 6); |
46 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 6); |
139 | |
47 | |
140 | PUSHs (sv_2mortal (newSViv (uup->action))); |
48 | PUSHs (sv_2mortal (newSViv (uup->action))); |
141 | PUSHs (sv_2mortal (newSVpv (uup->curfile, 0))); |
49 | PUSHs (sv_2mortal (newSVpv (uup->curfile, 0))); |
142 | PUSHs (sv_2mortal (newSViv (uup->partno))); |
50 | PUSHs (sv_2mortal (newSViv (uup->partno))); |
143 | PUSHs (sv_2mortal (newSViv (uup->numparts))); |
51 | PUSHs (sv_2mortal (newSViv (uup->numparts))); |
144 | PUSHs (sv_2mortal (newSViv (uup->fsize))); |
52 | PUSHs (sv_2mortal (newSViv (uup->fsize))); |
145 | PUSHs (sv_2mortal (newSViv (uup->percent))); |
53 | PUSHs (sv_2mortal (newSViv (uup->percent))); |
146 | |
54 | |
147 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
55 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
148 | |
56 | |
149 | if (count != 1) |
57 | if (count != 1) |
150 | croak ("busycallback perl callback returned more than one argument"); |
58 | croak ("busycallback perl callback returned more than one argument"); |
151 | |
59 | |
152 | retval = POPi; |
60 | retval = POPi; |
153 | |
61 | |
154 | PUTBACK; FREETMPS; LEAVE; |
62 | PUTBACK; FREETMPS; LEAVE; |
155 | |
63 | |
156 | } TEMP_RELEASE; |
64 | } TEMP_RELEASE; |
157 | |
65 | |
158 | return retval; |
66 | return retval; |
159 | } |
67 | } |
… | |
… | |
163 | { |
71 | { |
164 | static char *str; |
72 | static char *str; |
165 | |
73 | |
166 | TEMP_ACQUIRE { |
74 | TEMP_ACQUIRE { |
167 | |
75 | |
168 | dSP; |
76 | dSP; |
169 | int count; |
77 | int count; |
170 | |
78 | |
171 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 1); |
79 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 1); |
172 | |
80 | |
173 | PUSHs (sv_2mortal (newSVpv (fname, 0))); |
81 | PUSHs (sv_2mortal (newSVpv (fname, 0))); |
174 | |
82 | |
175 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
83 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
176 | |
84 | |
177 | if (count != 1) |
85 | if (count != 1) |
178 | croak ("fnamefilter perl callback MUST return a single filename exactly"); |
86 | croak ("fnamefilter perl callback MUST return a single filename exactly"); |
179 | |
87 | |
180 | _FP_free (str); str = _FP_strdup (SvPV_nolen (TOPs)); |
88 | FP_free (str); str = FP_strdup (SvPV_nolen (TOPs)); |
181 | |
89 | |
182 | PUTBACK; FREETMPS; LEAVE; |
90 | PUTBACK; FREETMPS; LEAVE; |
183 | |
91 | |
184 | } TEMP_RELEASE; |
92 | } TEMP_RELEASE; |
185 | |
93 | |
186 | return str; |
94 | return str; |
187 | } |
95 | } |
… | |
… | |
191 | { |
99 | { |
192 | int retval; |
100 | int retval; |
193 | |
101 | |
194 | TEMP_ACQUIRE { |
102 | TEMP_ACQUIRE { |
195 | |
103 | |
196 | dSP; |
104 | dSP; |
197 | int count; |
105 | int count; |
198 | SV *xfname = newSVpv ("", 0); |
106 | SV *xfname = newSVpv ("", 0); |
199 | |
107 | |
200 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); |
108 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); |
201 | |
109 | |
202 | PUSHs (sv_2mortal (newSVpv (id, 0))); |
110 | PUSHs (sv_2mortal (newSVpv (id, 0))); |
203 | PUSHs (sv_2mortal (xfname)); |
111 | PUSHs (sv_2mortal (xfname)); |
204 | PUSHs (sv_2mortal (newSViv (retrieve))); |
112 | PUSHs (sv_2mortal (newSViv (retrieve))); |
205 | |
113 | |
206 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
114 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
207 | |
115 | |
208 | if (count != 1) |
116 | if (count != 1) |
209 | croak ("filecallback perl callback must return a single return status"); |
117 | croak ("filecallback perl callback must return a single return status"); |
210 | |
118 | |
211 | strcpy (fname, SvPV_nolen (xfname)); |
119 | strcpy (fname, SvPV_nolen (xfname)); |
212 | retval = POPi; |
120 | retval = POPi; |
213 | |
121 | |
214 | PUTBACK; FREETMPS; LEAVE; |
122 | PUTBACK; FREETMPS; LEAVE; |
215 | |
123 | |
216 | } TEMP_RELEASE; |
124 | } TEMP_RELEASE; |
217 | |
125 | |
218 | return retval; |
126 | return retval; |
219 | } |
127 | } |
… | |
… | |
221 | static char * |
129 | static char * |
222 | uu_filename_callback (void *cb, char *subject, char *filename) |
130 | uu_filename_callback (void *cb, char *subject, char *filename) |
223 | { |
131 | { |
224 | TEMP_ACQUIRE { |
132 | TEMP_ACQUIRE { |
225 | |
133 | |
226 | dSP; |
134 | dSP; |
227 | int count; |
135 | int count; |
228 | |
136 | |
229 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
137 | ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
230 | |
138 | |
231 | PUSHs (sv_2mortal(newSVpv(subject, 0))); |
139 | PUSHs (sv_2mortal (newSVpv (subject, 0))); |
232 | PUSHs (filename ? sv_2mortal(newSVpv(filename, 0)) : &PL_sv_undef); |
140 | PUSHs (filename ? sv_2mortal (newSVpv (filename, 0)) : &PL_sv_undef); |
233 | |
141 | |
234 | PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
142 | PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
235 | |
143 | |
236 | if (count > 1) |
144 | if (count > 1) |
237 | croak ("filenamecallback perl callback must return nothing or a single filename"); |
145 | croak ("filenamecallback perl callback must return nothing or a single filename"); |
238 | |
146 | |
239 | if (count) |
147 | if (count) |
240 | { |
148 | { |
241 | _FP_free (filename); |
149 | FP_free (filename); |
242 | |
150 | |
243 | filename = SvOK (TOPs) |
151 | filename = SvOK (TOPs) |
244 | ? _FP_strdup (SvPV_nolen (TOPs)) |
152 | ? FP_strdup (SvPV_nolen (TOPs)) |
245 | : 0; |
153 | : 0; |
246 | } |
154 | } |
247 | |
155 | |
248 | PUTBACK; FREETMPS; LEAVE; |
156 | PUTBACK; FREETMPS; LEAVE; |
249 | |
157 | |
250 | } TEMP_RELEASE; |
158 | } TEMP_RELEASE; |
251 | |
159 | |
252 | return filename; |
160 | return filename; |
253 | } |
161 | } |
… | |
… | |
261 | { |
169 | { |
262 | int retval; |
170 | int retval; |
263 | |
171 | |
264 | TEMP_ACQUIRE { |
172 | TEMP_ACQUIRE { |
265 | |
173 | |
266 | dSP; |
174 | dSP; |
267 | int count; |
175 | int count; |
268 | |
176 | |
269 | ENTER; SAVETMPS; PUSHMARK(SP); EXTEND(SP,1); |
177 | ENTER; SAVETMPS; PUSHMARK(SP); EXTEND(SP,1); |
270 | |
178 | |
271 | PUSHs(sv_2mortal(newSVpv(info,0))); |
179 | PUSHs(sv_2mortal(newSVpv(info,0))); |
272 | |
180 | |
273 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
181 | PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
274 | |
182 | |
275 | if (count != 1) |
183 | if (count != 1) |
276 | croak ("info_file perl callback returned more than one argument"); |
184 | croak ("info_file perl callback returned more than one argument"); |
277 | |
185 | |
278 | retval = POPi; |
186 | retval = POPi; |
279 | |
187 | |
280 | PUTBACK; FREETMPS; LEAVE; |
188 | PUTBACK; FREETMPS; LEAVE; |
281 | |
189 | |
282 | } TEMP_RELEASE; |
190 | } TEMP_RELEASE; |
283 | |
191 | |
284 | return retval; |
192 | return retval; |
285 | } |
193 | } |
… | |
… | |
296 | default: |
204 | default: |
297 | return 0; |
205 | return 0; |
298 | } |
206 | } |
299 | } |
207 | } |
300 | |
208 | |
301 | static int uu_initialized; |
209 | static void |
|
|
210 | initialise (void) |
|
|
211 | { |
|
|
212 | int retval = UUInitialize (); |
|
|
213 | |
|
|
214 | if (retval != UURET_OK) |
|
|
215 | croak ("unable to initialize uudeview library (%s)", UUstrerror (retval)); |
|
|
216 | } |
302 | |
217 | |
303 | MODULE = Convert::UUlib PACKAGE = Convert::UUlib PREFIX = UU |
218 | MODULE = Convert::UUlib PACKAGE = Convert::UUlib PREFIX = UU |
304 | |
219 | |
305 | PROTOTYPES: ENABLE |
220 | PROTOTYPES: ENABLE |
306 | |
|
|
307 | int |
|
|
308 | constant (name) |
|
|
309 | char * name |
|
|
310 | |
|
|
311 | |
|
|
312 | void |
|
|
313 | UUInitialize () |
|
|
314 | CODE: |
|
|
315 | if (!uu_initialized) |
|
|
316 | { |
|
|
317 | int retval; |
|
|
318 | |
|
|
319 | if ((retval = UUInitialize ()) != UURET_OK) |
|
|
320 | croak ("unable to initialize uudeview library (%s)", UUstrerror (retval)); |
|
|
321 | |
|
|
322 | uu_initialized = 1; |
|
|
323 | } |
|
|
324 | |
221 | |
325 | void |
222 | void |
326 | UUCleanUp () |
223 | UUCleanUp () |
327 | CODE: |
224 | CODE: |
328 | if (uu_initialized) |
|
|
329 | UUCleanUp (); |
225 | UUCleanUp (); |
330 | |
226 | initialise (); |
331 | uu_initialized = 0; |
|
|
332 | |
227 | |
333 | SV * |
228 | SV * |
334 | UUGetOption (opt) |
229 | UUGetOption (opt) |
335 | int opt |
230 | int opt |
336 | CODE: |
231 | CODE: |
… | |
… | |
512 | int num |
407 | int num |
513 | |
408 | |
514 | void |
409 | void |
515 | GetFileList () |
410 | GetFileList () |
516 | PPCODE: |
411 | PPCODE: |
|
|
412 | { |
|
|
413 | uulist *iter; |
|
|
414 | |
517 | for (uulist *iter = UUGlobalFileList; iter; iter = iter->NEXT) |
415 | for (iter = UUGlobalFileList; iter; iter = iter->NEXT) |
518 | XPUSHs (sv_setref_pv (sv_newmortal (), "Convert::UUlib::Item", iter)); |
416 | XPUSHs (sv_setref_pv (sv_newmortal (), "Convert::UUlib::Item", iter)); |
|
|
417 | } |
519 | |
418 | |
520 | MODULE = Convert::UUlib PACKAGE = Convert::UUlib::Item |
419 | MODULE = Convert::UUlib PACKAGE = Convert::UUlib::Item |
521 | |
420 | |
522 | int |
421 | int |
523 | rename (item, newname) |
422 | rename (item, newname) |
… | |
… | |
608 | uulist *li |
507 | uulist *li |
609 | char * newfilename |
508 | char * newfilename |
610 | CODE: |
509 | CODE: |
611 | if (newfilename) |
510 | if (newfilename) |
612 | { |
511 | { |
613 | _FP_free (li->filename); |
512 | FP_free (li->filename); |
614 | li->filename = _FP_strdup (newfilename); |
513 | li->filename = FP_strdup (newfilename); |
615 | } |
514 | } |
616 | RETVAL = li->filename; |
515 | RETVAL = li->filename; |
617 | OUTPUT: |
516 | OUTPUT: |
618 | RETVAL |
517 | RETVAL |
619 | |
518 | |
… | |
… | |
660 | |
559 | |
661 | while (p) |
560 | while (p) |
662 | { |
561 | { |
663 | HV *pi = newHV (); |
562 | HV *pi = newHV (); |
664 | |
563 | |
665 | hv_store (pi, "partno" , 6, newSViv (p->partno) , 0); |
564 | hv_store (pi, "partno" , 6, newSViv (p->partno) , 0); |
666 | |
|
|
667 | if (p->filename) |
|
|
668 | hv_store (pi, "filename", 8, newSVpv (p->filename, 0) , 0); |
565 | if (p->filename ) hv_store (pi, "filename", 8, newSVpv (p->filename, 0) , 0); |
669 | if(p->subfname) |
|
|
670 | hv_store (pi, "subfname", 8, newSVpv (p->subfname, 0) , 0); |
566 | if (p->subfname ) hv_store (pi, "subfname", 8, newSVpv (p->subfname, 0) , 0); |
671 | if(p->mimeid) |
567 | if (p->mimeid ) hv_store (pi, "mimeid" , 6, newSVpv (p->mimeid , 0) , 0); |
672 | hv_store (pi, "mimeid" , 6, newSVpv (p->mimeid , 0) , 0); |
|
|
673 | if(p->mimetype) |
|
|
674 | hv_store (pi, "mimetype", 8, newSVpv (p->mimetype, 0) , 0); |
568 | if (p->mimetype ) hv_store (pi, "mimetype", 8, newSVpv (p->mimetype, 0) , 0); |
675 | if (p->data->subject) |
|
|
676 | hv_store (pi, "subject" , 7, newSVpv (p->data->subject,0), 0); |
569 | if (p->data->subject) hv_store (pi, "subject" , 7, newSVpv (p->data->subject,0), 0); |
677 | if (p->data->origin) |
570 | if (p->data->origin ) hv_store (pi, "origin" , 6, newSVpv (p->data->origin ,0), 0); |
678 | hv_store (pi, "origin" , 6, newSVpv (p->data->origin ,0), 0); |
571 | if (p->data->sfname ) hv_store (pi, "sfname" , 6, newSVpv (p->data->sfname ,0), 0); |
679 | if (p->data->sfname) |
|
|
680 | hv_store (pi, "sfname" , 6, newSVpv (p->data->sfname ,0), 0); |
|
|
681 | |
572 | |
682 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)pi))); |
573 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)pi))); |
683 | |
574 | |
684 | p = p->NEXT; |
575 | p = p->NEXT; |
685 | } |
576 | } |
686 | } |
577 | } |
687 | |
578 | |
688 | BOOT: |
579 | BOOT: |
|
|
580 | { |
|
|
581 | HV *stash = GvSTASH (CvGV (cv)); |
|
|
582 | |
|
|
583 | static const struct { |
|
|
584 | const char *name; |
|
|
585 | IV iv; |
|
|
586 | } *civ, const_iv[] = { |
|
|
587 | # define const_iv(name, value) { # name, (IV) value }, |
|
|
588 | const_iv (ACT_COPYING , UUACT_COPYING) |
|
|
589 | const_iv (ACT_DECODING , UUACT_DECODING) |
|
|
590 | const_iv (ACT_ENCODING , UUACT_ENCODING) |
|
|
591 | const_iv (ACT_IDLE , UUACT_IDLE) |
|
|
592 | const_iv (ACT_SCANNING , UUACT_SCANNING) |
|
|
593 | const_iv (FILE_DECODED , UUFILE_DECODED) |
|
|
594 | const_iv (FILE_ERROR , UUFILE_ERROR) |
|
|
595 | const_iv (FILE_MISPART , UUFILE_MISPART) |
|
|
596 | const_iv (FILE_NOBEGIN , UUFILE_NOBEGIN) |
|
|
597 | const_iv (FILE_NODATA , UUFILE_NODATA) |
|
|
598 | const_iv (FILE_NOEND , UUFILE_NOEND) |
|
|
599 | const_iv (FILE_OK , UUFILE_OK) |
|
|
600 | const_iv (FILE_READ , UUFILE_READ) |
|
|
601 | const_iv (FILE_TMPFILE , UUFILE_TMPFILE) |
|
|
602 | const_iv (MSG_ERROR , UUMSG_ERROR) |
|
|
603 | const_iv (MSG_FATAL , UUMSG_FATAL) |
|
|
604 | const_iv (MSG_MESSAGE , UUMSG_MESSAGE) |
|
|
605 | const_iv (MSG_NOTE , UUMSG_NOTE) |
|
|
606 | const_iv (MSG_PANIC , UUMSG_PANIC) |
|
|
607 | const_iv (MSG_WARNING , UUMSG_WARNING) |
|
|
608 | const_iv (OPT_VERSION , UUOPT_VERSION) |
|
|
609 | const_iv (OPT_FAST , UUOPT_FAST) |
|
|
610 | const_iv (OPT_DUMBNESS , UUOPT_DUMBNESS) |
|
|
611 | const_iv (OPT_BRACKPOL , UUOPT_BRACKPOL) |
|
|
612 | const_iv (OPT_VERBOSE , UUOPT_VERBOSE) |
|
|
613 | const_iv (OPT_DESPERATE, UUOPT_DESPERATE) |
|
|
614 | const_iv (OPT_IGNREPLY , UUOPT_IGNREPLY) |
|
|
615 | const_iv (OPT_OVERWRITE, UUOPT_OVERWRITE) |
|
|
616 | const_iv (OPT_SAVEPATH , UUOPT_SAVEPATH) |
|
|
617 | const_iv (OPT_IGNMODE , UUOPT_IGNMODE) |
|
|
618 | const_iv (OPT_DEBUG , UUOPT_DEBUG) |
|
|
619 | const_iv (OPT_ERRNO , UUOPT_ERRNO) |
|
|
620 | const_iv (OPT_PROGRESS , UUOPT_PROGRESS) |
|
|
621 | const_iv (OPT_USETEXT , UUOPT_USETEXT) |
|
|
622 | const_iv (OPT_PREAMB , UUOPT_PREAMB) |
|
|
623 | const_iv (OPT_TINYB64 , UUOPT_TINYB64) |
|
|
624 | const_iv (OPT_ENCEXT , UUOPT_ENCEXT) |
|
|
625 | const_iv (OPT_REMOVE , UUOPT_REMOVE) |
|
|
626 | const_iv (OPT_MOREMIME , UUOPT_MOREMIME) |
|
|
627 | const_iv (OPT_DOTDOT , UUOPT_DOTDOT) |
|
|
628 | const_iv (OPT_RBUF , UUOPT_RBUF) |
|
|
629 | const_iv (OPT_WBUF , UUOPT_WBUF) |
|
|
630 | const_iv (OPT_AUTOCHECK, UUOPT_AUTOCHECK) |
|
|
631 | const_iv (RET_CANCEL , UURET_CANCEL) |
|
|
632 | const_iv (RET_CONT , UURET_CONT) |
|
|
633 | const_iv (RET_EXISTS , UURET_EXISTS) |
|
|
634 | const_iv (RET_ILLVAL , UURET_ILLVAL) |
|
|
635 | const_iv (RET_IOERR , UURET_IOERR) |
|
|
636 | const_iv (RET_NODATA , UURET_NODATA) |
|
|
637 | const_iv (RET_NOEND , UURET_NOEND) |
|
|
638 | const_iv (RET_NOMEM , UURET_NOMEM) |
|
|
639 | const_iv (RET_OK , UURET_OK) |
|
|
640 | const_iv (RET_UNSUP , UURET_UNSUP) |
|
|
641 | const_iv (B64_ENCODED , B64ENCODED) |
|
|
642 | const_iv (BH_ENCODED , BH_ENCODED) |
|
|
643 | const_iv (PT_ENCODED , PT_ENCODED) |
|
|
644 | const_iv (QP_ENCODED , QP_ENCODED) |
|
|
645 | const_iv (UU_ENCODED , UU_ENCODED) |
|
|
646 | const_iv (XX_ENCODED , XX_ENCODED) |
|
|
647 | const_iv (YENC_ENCODED , YENC_ENCODED) |
|
|
648 | }; |
|
|
649 | |
|
|
650 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
|
|
651 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
|
|
652 | |
689 | uu_msg_sv = newSVsv (&PL_sv_undef); |
653 | uu_msg_sv = newSVsv (&PL_sv_undef); |
690 | uu_busy_sv = newSVsv (&PL_sv_undef); |
654 | uu_busy_sv = newSVsv (&PL_sv_undef); |
691 | uu_file_sv = newSVsv (&PL_sv_undef); |
655 | uu_file_sv = newSVsv (&PL_sv_undef); |
692 | uu_fnamefilter_sv = newSVsv (&PL_sv_undef); |
656 | uu_fnamefilter_sv = newSVsv (&PL_sv_undef); |
693 | uu_filename_sv = newSVsv (&PL_sv_undef); |
657 | uu_filename_sv = newSVsv (&PL_sv_undef); |
694 | |
658 | |
|
|
659 | initialise (); |
|
|
660 | } |
|
|
661 | |