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