1 |
root |
1.1 |
#include "EXTERN.h" |
2 |
|
|
#include "perl.h" |
3 |
|
|
#include "XSUB.h" |
4 |
|
|
|
5 |
root |
1.17 |
#include "perlmulticore.h" |
6 |
|
|
|
7 |
root |
1.1 |
#include "uulib/fptools.h" |
8 |
root |
1.2 |
#include "uulib/uudeview.h" |
9 |
root |
1.1 |
#include "uulib/uuint.h" |
10 |
|
|
|
11 |
root |
1.17 |
static int released; |
12 |
|
|
|
13 |
|
|
#define RELEASE do { released = 1; perlinterp_release (); } while (0) |
14 |
|
|
#define ACQUIRE do { perlinterp_acquire (); released = 0; } while (0) |
15 |
|
|
|
16 |
|
|
#define TEMP_ACQUIRE if (released) perlinterp_acquire (); |
17 |
|
|
#define TEMP_RELEASE if (released) perlinterp_release (); |
18 |
|
|
|
19 |
root |
1.1 |
static int |
20 |
root |
1.8 |
not_here (char *s) |
21 |
root |
1.1 |
{ |
22 |
root |
1.13 |
croak("%s not implemented", s); |
23 |
|
|
return -1; |
24 |
root |
1.1 |
} |
25 |
|
|
|
26 |
|
|
static int |
27 |
root |
1.8 |
constant (char *name) |
28 |
root |
1.1 |
{ |
29 |
root |
1.13 |
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 |
root |
1.14 |
if (strEQ(name, "OPT_AUTOCHECK")) return UUOPT_AUTOCHECK; |
80 |
root |
1.13 |
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 |
root |
1.1 |
} |
105 |
root |
1.13 |
|
106 |
|
|
errno = EINVAL; |
107 |
|
|
return 0; |
108 |
root |
1.1 |
} |
109 |
|
|
|
110 |
root |
1.8 |
static void |
111 |
|
|
uu_msg_callback (void *cb, char *msg, int level) |
112 |
root |
1.1 |
{ |
113 |
root |
1.17 |
TEMP_ACQUIRE { |
114 |
|
|
|
115 |
root |
1.1 |
dSP; |
116 |
root |
1.16 |
|
117 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
118 |
root |
1.1 |
|
119 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (msg, 0))); |
120 |
|
|
PUSHs (sv_2mortal (newSViv (level))); |
121 |
root |
1.1 |
|
122 |
|
|
PUTBACK; (void) perl_call_sv ((SV *)cb, G_VOID|G_DISCARD); SPAGAIN; |
123 |
|
|
PUTBACK; FREETMPS; LEAVE; |
124 |
root |
1.17 |
|
125 |
|
|
} TEMP_RELEASE; |
126 |
root |
1.1 |
} |
127 |
|
|
|
128 |
root |
1.8 |
static int |
129 |
|
|
uu_busy_callback (void *cb, uuprogress *uup) |
130 |
root |
1.1 |
{ |
131 |
root |
1.17 |
int retval; |
132 |
|
|
|
133 |
|
|
TEMP_ACQUIRE { |
134 |
|
|
|
135 |
root |
1.1 |
dSP; |
136 |
|
|
int count; |
137 |
root |
1.16 |
|
138 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 6); |
139 |
root |
1.1 |
|
140 |
root |
1.10 |
PUSHs (sv_2mortal (newSViv (uup->action))); |
141 |
|
|
PUSHs (sv_2mortal (newSVpv (uup->curfile, 0))); |
142 |
|
|
PUSHs (sv_2mortal (newSViv (uup->partno))); |
143 |
|
|
PUSHs (sv_2mortal (newSViv (uup->numparts))); |
144 |
|
|
PUSHs (sv_2mortal (newSViv (uup->fsize))); |
145 |
|
|
PUSHs (sv_2mortal (newSViv (uup->percent))); |
146 |
root |
1.1 |
|
147 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
148 |
|
|
|
149 |
|
|
if (count != 1) |
150 |
|
|
croak ("busycallback perl callback returned more than one argument"); |
151 |
|
|
|
152 |
|
|
retval = POPi; |
153 |
|
|
|
154 |
|
|
PUTBACK; FREETMPS; LEAVE; |
155 |
|
|
|
156 |
root |
1.17 |
} TEMP_RELEASE; |
157 |
|
|
|
158 |
root |
1.1 |
return retval; |
159 |
|
|
} |
160 |
|
|
|
161 |
root |
1.8 |
static char * |
162 |
|
|
uu_fnamefilter_callback (void *cb, char *fname) |
163 |
root |
1.1 |
{ |
164 |
root |
1.17 |
static char *str; |
165 |
|
|
|
166 |
|
|
TEMP_ACQUIRE { |
167 |
|
|
|
168 |
root |
1.1 |
dSP; |
169 |
|
|
int count; |
170 |
root |
1.16 |
|
171 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 1); |
172 |
root |
1.1 |
|
173 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (fname, 0))); |
174 |
root |
1.1 |
|
175 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
176 |
|
|
|
177 |
|
|
if (count != 1) |
178 |
root |
1.13 |
croak ("fnamefilter perl callback MUST return a single filename exactly"); |
179 |
root |
1.1 |
|
180 |
root |
1.13 |
_FP_free (str); str = _FP_strdup (SvPV_nolen (TOPs)); |
181 |
root |
1.1 |
|
182 |
|
|
PUTBACK; FREETMPS; LEAVE; |
183 |
|
|
|
184 |
root |
1.17 |
} TEMP_RELEASE; |
185 |
|
|
|
186 |
root |
1.1 |
return str; |
187 |
|
|
} |
188 |
|
|
|
189 |
root |
1.8 |
static int |
190 |
|
|
uu_file_callback (void *cb, char *id, char *fname, int retrieve) |
191 |
root |
1.1 |
{ |
192 |
root |
1.17 |
int retval; |
193 |
|
|
|
194 |
|
|
TEMP_ACQUIRE { |
195 |
|
|
|
196 |
root |
1.1 |
dSP; |
197 |
|
|
int count; |
198 |
|
|
SV *xfname = newSVpv ("", 0); |
199 |
root |
1.16 |
|
200 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); |
201 |
root |
1.1 |
|
202 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (id, 0))); |
203 |
|
|
PUSHs (sv_2mortal (xfname)); |
204 |
|
|
PUSHs (sv_2mortal (newSViv (retrieve))); |
205 |
root |
1.1 |
|
206 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
207 |
|
|
|
208 |
|
|
if (count != 1) |
209 |
root |
1.13 |
croak ("filecallback perl callback must return a single return status"); |
210 |
root |
1.1 |
|
211 |
root |
1.13 |
strcpy (fname, SvPV_nolen (xfname)); |
212 |
root |
1.1 |
retval = POPi; |
213 |
|
|
|
214 |
|
|
PUTBACK; FREETMPS; LEAVE; |
215 |
|
|
|
216 |
root |
1.17 |
} TEMP_RELEASE; |
217 |
|
|
|
218 |
root |
1.1 |
return retval; |
219 |
|
|
} |
220 |
|
|
|
221 |
root |
1.8 |
static char * |
222 |
|
|
uu_filename_callback (void *cb, char *subject, char *filename) |
223 |
root |
1.5 |
{ |
224 |
root |
1.17 |
TEMP_ACQUIRE { |
225 |
|
|
|
226 |
root |
1.5 |
dSP; |
227 |
|
|
int count; |
228 |
root |
1.16 |
|
229 |
root |
1.13 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
230 |
root |
1.5 |
|
231 |
root |
1.13 |
PUSHs (sv_2mortal(newSVpv(subject, 0))); |
232 |
|
|
PUSHs (filename ? sv_2mortal(newSVpv(filename, 0)) : &PL_sv_undef); |
233 |
root |
1.5 |
|
234 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
235 |
|
|
|
236 |
|
|
if (count > 1) |
237 |
root |
1.13 |
croak ("filenamecallback perl callback must return nothing or a single filename"); |
238 |
root |
1.5 |
|
239 |
|
|
if (count) |
240 |
|
|
{ |
241 |
|
|
_FP_free (filename); |
242 |
|
|
|
243 |
root |
1.13 |
filename = SvOK (TOPs) |
244 |
|
|
? _FP_strdup (SvPV_nolen (TOPs)) |
245 |
|
|
: 0; |
246 |
root |
1.5 |
} |
247 |
|
|
|
248 |
|
|
PUTBACK; FREETMPS; LEAVE; |
249 |
|
|
|
250 |
root |
1.17 |
} TEMP_RELEASE; |
251 |
|
|
|
252 |
root |
1.5 |
return filename; |
253 |
|
|
} |
254 |
|
|
|
255 |
|
|
static SV *uu_msg_sv, *uu_busy_sv, *uu_file_sv, *uu_fnamefilter_sv, *uu_filename_sv; |
256 |
root |
1.1 |
|
257 |
|
|
#define FUNC_CB(cb) (void *)(sv_setsv (cb ## _sv, func), cb ## _sv), func ? cb ## _callback : NULL |
258 |
|
|
|
259 |
root |
1.8 |
static int |
260 |
|
|
uu_info_file (void *cb, char *info) |
261 |
root |
1.1 |
{ |
262 |
root |
1.17 |
int retval; |
263 |
|
|
|
264 |
|
|
TEMP_ACQUIRE { |
265 |
|
|
|
266 |
root |
1.1 |
dSP; |
267 |
|
|
int count; |
268 |
root |
1.16 |
|
269 |
root |
1.1 |
ENTER; SAVETMPS; PUSHMARK(SP); EXTEND(SP,1); |
270 |
|
|
|
271 |
|
|
PUSHs(sv_2mortal(newSVpv(info,0))); |
272 |
|
|
|
273 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
274 |
|
|
|
275 |
|
|
if (count != 1) |
276 |
|
|
croak ("info_file perl callback returned more than one argument"); |
277 |
|
|
|
278 |
|
|
retval = POPi; |
279 |
|
|
|
280 |
|
|
PUTBACK; FREETMPS; LEAVE; |
281 |
|
|
|
282 |
root |
1.17 |
} TEMP_RELEASE; |
283 |
|
|
|
284 |
root |
1.1 |
return retval; |
285 |
|
|
} |
286 |
|
|
|
287 |
|
|
static int |
288 |
|
|
uu_opt_isstring (int opt) |
289 |
|
|
{ |
290 |
|
|
switch (opt) |
291 |
|
|
{ |
292 |
|
|
case UUOPT_VERSION: |
293 |
|
|
case UUOPT_SAVEPATH: |
294 |
|
|
case UUOPT_ENCEXT: |
295 |
|
|
return 1; |
296 |
|
|
default: |
297 |
|
|
return 0; |
298 |
|
|
} |
299 |
|
|
} |
300 |
|
|
|
301 |
|
|
static int uu_initialized; |
302 |
|
|
|
303 |
|
|
MODULE = Convert::UUlib PACKAGE = Convert::UUlib PREFIX = UU |
304 |
|
|
|
305 |
|
|
PROTOTYPES: ENABLE |
306 |
|
|
|
307 |
|
|
int |
308 |
root |
1.8 |
constant (name) |
309 |
root |
1.1 |
char * name |
310 |
|
|
|
311 |
|
|
|
312 |
|
|
void |
313 |
root |
1.8 |
UUInitialize () |
314 |
root |
1.1 |
CODE: |
315 |
|
|
if (!uu_initialized) |
316 |
|
|
{ |
317 |
|
|
int retval; |
318 |
root |
1.16 |
|
319 |
root |
1.1 |
if ((retval = UUInitialize ()) != UURET_OK) |
320 |
|
|
croak ("unable to initialize uudeview library (%s)", UUstrerror (retval)); |
321 |
|
|
|
322 |
|
|
uu_initialized = 1; |
323 |
|
|
} |
324 |
|
|
|
325 |
|
|
void |
326 |
root |
1.8 |
UUCleanUp () |
327 |
root |
1.1 |
CODE: |
328 |
root |
1.16 |
if (uu_initialized) |
329 |
root |
1.1 |
UUCleanUp (); |
330 |
|
|
|
331 |
root |
1.16 |
uu_initialized = 0; |
332 |
root |
1.1 |
|
333 |
|
|
SV * |
334 |
root |
1.8 |
UUGetOption (opt) |
335 |
root |
1.1 |
int opt |
336 |
|
|
CODE: |
337 |
root |
1.16 |
{ |
338 |
|
|
if (opt == UUOPT_PROGRESS) |
339 |
|
|
croak ("GetOption(UUOPT_PROGRESS) is not yet implemented"); |
340 |
|
|
else if (uu_opt_isstring (opt)) |
341 |
|
|
{ |
342 |
|
|
char cval[8192]; |
343 |
|
|
|
344 |
|
|
UUGetOption (opt, 0, cval, sizeof cval); |
345 |
|
|
RETVAL = newSVpv (cval, 0); |
346 |
|
|
} |
347 |
|
|
else |
348 |
|
|
{ |
349 |
|
|
RETVAL = newSViv (UUGetOption (opt, 0, 0, 0)); |
350 |
|
|
} |
351 |
|
|
} |
352 |
root |
1.1 |
OUTPUT: |
353 |
|
|
RETVAL |
354 |
|
|
|
355 |
|
|
int |
356 |
root |
1.8 |
UUSetOption (opt, val) |
357 |
root |
1.1 |
int opt |
358 |
|
|
SV * val |
359 |
|
|
CODE: |
360 |
root |
1.16 |
{ |
361 |
|
|
STRLEN dc; |
362 |
root |
1.1 |
|
363 |
root |
1.16 |
if (uu_opt_isstring (opt)) |
364 |
|
|
RETVAL = UUSetOption (opt, 0, SvPV (val, dc)); |
365 |
|
|
else |
366 |
|
|
RETVAL = UUSetOption (opt, SvIV (val), (void *)0); |
367 |
|
|
} |
368 |
root |
1.1 |
OUTPUT: |
369 |
|
|
RETVAL |
370 |
|
|
|
371 |
|
|
char * |
372 |
root |
1.8 |
UUstrerror (errcode) |
373 |
root |
1.1 |
int errcode |
374 |
|
|
|
375 |
|
|
void |
376 |
root |
1.8 |
UUSetMsgCallback (func = 0) |
377 |
root |
1.1 |
SV * func |
378 |
|
|
CODE: |
379 |
root |
1.13 |
UUSetMsgCallback (FUNC_CB (uu_msg)); |
380 |
root |
1.1 |
|
381 |
|
|
void |
382 |
root |
1.8 |
UUSetBusyCallback (func = 0,msecs = 1000) |
383 |
root |
1.1 |
SV * func |
384 |
|
|
long msecs |
385 |
|
|
CODE: |
386 |
root |
1.13 |
UUSetBusyCallback (FUNC_CB (uu_busy), msecs); |
387 |
root |
1.1 |
|
388 |
|
|
void |
389 |
root |
1.8 |
UUSetFileCallback (func = 0) |
390 |
root |
1.1 |
SV * func |
391 |
|
|
CODE: |
392 |
root |
1.13 |
UUSetFileCallback (FUNC_CB (uu_file)); |
393 |
root |
1.1 |
|
394 |
|
|
void |
395 |
root |
1.8 |
UUSetFNameFilter (func = 0) |
396 |
root |
1.1 |
SV * func |
397 |
|
|
CODE: |
398 |
root |
1.13 |
UUSetFNameFilter (FUNC_CB (uu_fnamefilter)); |
399 |
root |
1.1 |
|
400 |
root |
1.5 |
void |
401 |
root |
1.8 |
UUSetFileNameCallback (func = 0) |
402 |
root |
1.5 |
SV * func |
403 |
|
|
CODE: |
404 |
root |
1.13 |
UUSetFileNameCallback (FUNC_CB (uu_filename)); |
405 |
root |
1.5 |
|
406 |
root |
1.1 |
char * |
407 |
root |
1.8 |
UUFNameFilter (fname) |
408 |
root |
1.1 |
char * fname |
409 |
|
|
|
410 |
|
|
void |
411 |
root |
1.11 |
UULoadFile (fname, id = 0, delflag = 0, partno = -1) |
412 |
root |
1.1 |
char * fname |
413 |
|
|
char * id |
414 |
|
|
int delflag |
415 |
root |
1.11 |
int partno |
416 |
root |
1.1 |
PPCODE: |
417 |
root |
1.16 |
{ |
418 |
|
|
int count; |
419 |
root |
1.17 |
IV ret; |
420 |
|
|
|
421 |
|
|
RELEASE; |
422 |
|
|
ret = UULoadFileWithPartNo (fname, id, delflag, partno, &count); |
423 |
|
|
ACQUIRE; |
424 |
root |
1.16 |
|
425 |
root |
1.17 |
XPUSHs (sv_2mortal (newSViv (ret))); |
426 |
root |
1.16 |
if (GIMME_V == G_ARRAY) |
427 |
|
|
XPUSHs (sv_2mortal (newSViv (count))); |
428 |
|
|
} |
429 |
root |
1.1 |
|
430 |
|
|
int |
431 |
root |
1.8 |
UUSmerge (pass) |
432 |
root |
1.1 |
int pass |
433 |
|
|
|
434 |
|
|
int |
435 |
|
|
UUQuickDecode(datain,dataout,boundary,maxpos) |
436 |
|
|
FILE * datain |
437 |
|
|
FILE * dataout |
438 |
|
|
char * boundary |
439 |
|
|
long maxpos |
440 |
|
|
|
441 |
|
|
int |
442 |
|
|
UUEncodeMulti(outfile,infile,infname,encoding,outfname,mimetype,filemode) |
443 |
|
|
FILE * outfile |
444 |
|
|
FILE * infile |
445 |
|
|
char * infname |
446 |
|
|
int encoding |
447 |
|
|
char * outfname |
448 |
|
|
char * mimetype |
449 |
|
|
int filemode |
450 |
|
|
|
451 |
|
|
int |
452 |
|
|
UUEncodePartial(outfile,infile,infname,encoding,outfname,mimetype,filemode,partno,linperfile) |
453 |
|
|
FILE * outfile |
454 |
|
|
FILE * infile |
455 |
|
|
char * infname |
456 |
|
|
int encoding |
457 |
|
|
char * outfname |
458 |
|
|
char * mimetype |
459 |
|
|
int filemode |
460 |
|
|
int partno |
461 |
|
|
long linperfile |
462 |
|
|
|
463 |
|
|
int |
464 |
|
|
UUEncodeToStream(outfile,infile,infname,encoding,outfname,filemode) |
465 |
|
|
FILE * outfile |
466 |
|
|
FILE * infile |
467 |
|
|
char * infname |
468 |
|
|
int encoding |
469 |
|
|
char * outfname |
470 |
|
|
int filemode |
471 |
|
|
|
472 |
|
|
int |
473 |
|
|
UUEncodeToFile(infile,infname,encoding,outfname,diskname,linperfile) |
474 |
|
|
FILE * infile |
475 |
|
|
char * infname |
476 |
|
|
int encoding |
477 |
|
|
char * outfname |
478 |
|
|
char * diskname |
479 |
|
|
long linperfile |
480 |
|
|
|
481 |
|
|
int |
482 |
|
|
UUE_PrepSingle(outfile,infile,infname,encoding,outfname,filemode,destination,from,subject,isemail) |
483 |
|
|
FILE * outfile |
484 |
|
|
FILE * infile |
485 |
|
|
char * infname |
486 |
|
|
int encoding |
487 |
|
|
char * outfname |
488 |
|
|
int filemode |
489 |
|
|
char * destination |
490 |
|
|
char * from |
491 |
|
|
char * subject |
492 |
|
|
int isemail |
493 |
|
|
|
494 |
|
|
int |
495 |
|
|
UUE_PrepPartial(outfile,infile,infname,encoding,outfname,filemode,partno,linperfile,filesize,destination,from,subject,isemail) |
496 |
|
|
FILE * outfile |
497 |
|
|
FILE * infile |
498 |
|
|
char * infname |
499 |
|
|
int encoding |
500 |
|
|
char * outfname |
501 |
|
|
int filemode |
502 |
|
|
int partno |
503 |
|
|
long linperfile |
504 |
|
|
long filesize |
505 |
|
|
char * destination |
506 |
|
|
char * from |
507 |
|
|
char * subject |
508 |
|
|
int isemail |
509 |
|
|
|
510 |
|
|
uulist * |
511 |
root |
1.8 |
UUGetFileListItem (num) |
512 |
root |
1.1 |
int num |
513 |
|
|
|
514 |
root |
1.18 |
void |
515 |
|
|
GetFileList () |
516 |
|
|
PPCODE: |
517 |
|
|
for (uulist *iter = UUGlobalFileList; iter; iter = iter->NEXT) |
518 |
|
|
XPUSHs (sv_setref_pv (sv_newmortal (), "Convert::UUlib::Item", iter)); |
519 |
|
|
|
520 |
root |
1.8 |
MODULE = Convert::UUlib PACKAGE = Convert::UUlib::Item |
521 |
|
|
|
522 |
root |
1.1 |
int |
523 |
root |
1.8 |
rename (item, newname) |
524 |
root |
1.1 |
uulist *item |
525 |
|
|
char * newname |
526 |
root |
1.8 |
CODE: |
527 |
|
|
RETVAL = UURenameFile (item, newname); |
528 |
|
|
OUTPUT: |
529 |
|
|
RETVAL |
530 |
root |
1.1 |
|
531 |
|
|
int |
532 |
root |
1.8 |
decode_temp (item) |
533 |
root |
1.1 |
uulist *item |
534 |
root |
1.8 |
CODE: |
535 |
root |
1.17 |
RELEASE; |
536 |
root |
1.8 |
RETVAL = UUDecodeToTemp (item); |
537 |
root |
1.17 |
ACQUIRE; |
538 |
root |
1.8 |
OUTPUT: |
539 |
|
|
RETVAL |
540 |
root |
1.1 |
|
541 |
|
|
int |
542 |
root |
1.8 |
remove_temp (item) |
543 |
root |
1.1 |
uulist *item |
544 |
root |
1.8 |
CODE: |
545 |
root |
1.17 |
RELEASE; |
546 |
root |
1.8 |
RETVAL = UURemoveTemp (item); |
547 |
root |
1.17 |
ACQUIRE; |
548 |
root |
1.8 |
OUTPUT: |
549 |
|
|
RETVAL |
550 |
root |
1.1 |
|
551 |
|
|
int |
552 |
root |
1.8 |
decode (item, target = 0) |
553 |
root |
1.1 |
uulist *item |
554 |
|
|
char * target |
555 |
root |
1.8 |
CODE: |
556 |
root |
1.17 |
RELEASE; |
557 |
root |
1.8 |
RETVAL = UUDecodeFile (item, target); |
558 |
root |
1.17 |
ACQUIRE; |
559 |
root |
1.8 |
OUTPUT: |
560 |
|
|
RETVAL |
561 |
root |
1.1 |
|
562 |
|
|
void |
563 |
root |
1.8 |
info (item, func) |
564 |
root |
1.1 |
uulist *item |
565 |
|
|
SV * func |
566 |
|
|
CODE: |
567 |
root |
1.17 |
RELEASE; |
568 |
|
|
UUInfoFile (item, (void *)func, uu_info_file); |
569 |
|
|
ACQUIRE; |
570 |
root |
1.1 |
|
571 |
|
|
short |
572 |
|
|
state(li) |
573 |
|
|
uulist *li |
574 |
|
|
CODE: |
575 |
|
|
RETVAL = li->state; |
576 |
|
|
OUTPUT: |
577 |
|
|
RETVAL |
578 |
|
|
|
579 |
|
|
short |
580 |
|
|
mode(li,newmode=0) |
581 |
|
|
uulist *li |
582 |
|
|
short newmode |
583 |
|
|
CODE: |
584 |
|
|
if (newmode) |
585 |
|
|
li->mode = newmode; |
586 |
|
|
RETVAL = li->mode; |
587 |
|
|
OUTPUT: |
588 |
|
|
RETVAL |
589 |
|
|
|
590 |
|
|
short |
591 |
|
|
uudet(li) |
592 |
|
|
uulist *li |
593 |
|
|
CODE: |
594 |
|
|
RETVAL = li->uudet; |
595 |
|
|
OUTPUT: |
596 |
|
|
RETVAL |
597 |
|
|
|
598 |
|
|
long |
599 |
|
|
size(li) |
600 |
|
|
uulist *li |
601 |
|
|
CODE: |
602 |
|
|
RETVAL = li->size; |
603 |
|
|
OUTPUT: |
604 |
|
|
RETVAL |
605 |
|
|
|
606 |
|
|
char * |
607 |
root |
1.8 |
filename (li, newfilename = 0) |
608 |
root |
1.1 |
uulist *li |
609 |
|
|
char * newfilename |
610 |
|
|
CODE: |
611 |
|
|
if (newfilename) |
612 |
|
|
{ |
613 |
root |
1.4 |
_FP_free (li->filename); |
614 |
|
|
li->filename = _FP_strdup (newfilename); |
615 |
root |
1.1 |
} |
616 |
|
|
RETVAL = li->filename; |
617 |
|
|
OUTPUT: |
618 |
|
|
RETVAL |
619 |
|
|
|
620 |
|
|
char * |
621 |
root |
1.8 |
subfname (li) |
622 |
root |
1.1 |
uulist *li |
623 |
|
|
CODE: |
624 |
|
|
RETVAL = li->subfname; |
625 |
|
|
OUTPUT: |
626 |
|
|
RETVAL |
627 |
|
|
|
628 |
|
|
char * |
629 |
root |
1.8 |
mimeid (li) |
630 |
root |
1.1 |
uulist *li |
631 |
|
|
CODE: |
632 |
|
|
RETVAL = li->mimeid; |
633 |
|
|
OUTPUT: |
634 |
|
|
RETVAL |
635 |
|
|
|
636 |
|
|
char * |
637 |
root |
1.8 |
mimetype (li) |
638 |
root |
1.1 |
uulist *li |
639 |
|
|
CODE: |
640 |
|
|
RETVAL = li->mimetype; |
641 |
|
|
OUTPUT: |
642 |
|
|
RETVAL |
643 |
|
|
|
644 |
|
|
char * |
645 |
root |
1.8 |
binfile (li) |
646 |
root |
1.1 |
uulist *li |
647 |
|
|
CODE: |
648 |
|
|
RETVAL = li->binfile; |
649 |
|
|
OUTPUT: |
650 |
|
|
RETVAL |
651 |
|
|
|
652 |
root |
1.8 |
# methods accessing internal data(!) |
653 |
root |
1.1 |
|
654 |
|
|
void |
655 |
root |
1.8 |
parts (li) |
656 |
root |
1.1 |
uulist *li |
657 |
|
|
PPCODE: |
658 |
root |
1.16 |
{ |
659 |
|
|
struct _uufile *p = li->thisfile; |
660 |
root |
1.1 |
|
661 |
root |
1.16 |
while (p) |
662 |
|
|
{ |
663 |
|
|
HV *pi = newHV (); |
664 |
|
|
|
665 |
|
|
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); |
669 |
|
|
if(p->subfname) |
670 |
|
|
hv_store (pi, "subfname", 8, newSVpv (p->subfname, 0) , 0); |
671 |
|
|
if(p->mimeid) |
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); |
675 |
|
|
if (p->data->subject) |
676 |
|
|
hv_store (pi, "subject" , 7, newSVpv (p->data->subject,0), 0); |
677 |
|
|
if (p->data->origin) |
678 |
|
|
hv_store (pi, "origin" , 6, newSVpv (p->data->origin ,0), 0); |
679 |
|
|
if (p->data->sfname) |
680 |
|
|
hv_store (pi, "sfname" , 6, newSVpv (p->data->sfname ,0), 0); |
681 |
|
|
|
682 |
|
|
XPUSHs (sv_2mortal (newRV_noinc ((SV *)pi))); |
683 |
|
|
|
684 |
|
|
p = p->NEXT; |
685 |
|
|
} |
686 |
|
|
} |
687 |
root |
1.1 |
|
688 |
|
|
BOOT: |
689 |
root |
1.13 |
uu_msg_sv = newSVsv (&PL_sv_undef); |
690 |
|
|
uu_busy_sv = newSVsv (&PL_sv_undef); |
691 |
|
|
uu_file_sv = newSVsv (&PL_sv_undef); |
692 |
|
|
uu_fnamefilter_sv = newSVsv (&PL_sv_undef); |
693 |
|
|
uu_filename_sv = newSVsv (&PL_sv_undef); |
694 |
root |
1.1 |
|