1 |
root |
1.1 |
#include "EXTERN.h" |
2 |
|
|
#include "perl.h" |
3 |
|
|
#include "XSUB.h" |
4 |
|
|
|
5 |
|
|
#include "uulib/fptools.h" |
6 |
root |
1.2 |
#include "uulib/uudeview.h" |
7 |
root |
1.1 |
#include "uulib/uuint.h" |
8 |
|
|
|
9 |
|
|
static int |
10 |
root |
1.8 |
not_here (char *s) |
11 |
root |
1.1 |
{ |
12 |
root |
1.13 |
croak("%s not implemented", s); |
13 |
|
|
return -1; |
14 |
root |
1.1 |
} |
15 |
|
|
|
16 |
|
|
static int |
17 |
root |
1.8 |
constant (char *name) |
18 |
root |
1.1 |
{ |
19 |
root |
1.13 |
errno = 0; |
20 |
|
|
switch (*name) |
21 |
|
|
{ |
22 |
|
|
case 'A': |
23 |
|
|
if (strEQ(name, "ACT_COPYING")) return UUACT_COPYING; |
24 |
|
|
if (strEQ(name, "ACT_DECODING")) return UUACT_DECODING; |
25 |
|
|
if (strEQ(name, "ACT_ENCODING")) return UUACT_ENCODING; |
26 |
|
|
if (strEQ(name, "ACT_IDLE")) return UUACT_IDLE; |
27 |
|
|
if (strEQ(name, "ACT_SCANNING")) return UUACT_SCANNING; |
28 |
|
|
case 'F': |
29 |
|
|
if (strEQ(name, "FILE_DECODED")) return UUFILE_DECODED; |
30 |
|
|
if (strEQ(name, "FILE_ERROR")) return UUFILE_ERROR; |
31 |
|
|
if (strEQ(name, "FILE_MISPART")) return UUFILE_MISPART; |
32 |
|
|
if (strEQ(name, "FILE_NOBEGIN")) return UUFILE_NOBEGIN; |
33 |
|
|
if (strEQ(name, "FILE_NODATA")) return UUFILE_NODATA; |
34 |
|
|
if (strEQ(name, "FILE_NOEND")) return UUFILE_NOEND; |
35 |
|
|
if (strEQ(name, "FILE_OK")) return UUFILE_OK; |
36 |
|
|
if (strEQ(name, "FILE_READ")) return UUFILE_READ; |
37 |
|
|
if (strEQ(name, "FILE_TMPFILE")) return UUFILE_TMPFILE; |
38 |
|
|
break; |
39 |
|
|
case 'M': |
40 |
|
|
if (strEQ(name, "MSG_ERROR")) return UUMSG_ERROR; |
41 |
|
|
if (strEQ(name, "MSG_FATAL")) return UUMSG_FATAL; |
42 |
|
|
if (strEQ(name, "MSG_MESSAGE")) return UUMSG_MESSAGE; |
43 |
|
|
if (strEQ(name, "MSG_NOTE")) return UUMSG_NOTE; |
44 |
|
|
if (strEQ(name, "MSG_PANIC")) return UUMSG_PANIC; |
45 |
|
|
if (strEQ(name, "MSG_WARNING")) return UUMSG_WARNING; |
46 |
|
|
case 'O': |
47 |
|
|
if (strEQ(name, "OPT_VERSION")) return UUOPT_VERSION; |
48 |
|
|
if (strEQ(name, "OPT_FAST")) return UUOPT_FAST; |
49 |
|
|
if (strEQ(name, "OPT_DUMBNESS")) return UUOPT_DUMBNESS; |
50 |
|
|
if (strEQ(name, "OPT_BRACKPOL")) return UUOPT_BRACKPOL; |
51 |
|
|
if (strEQ(name, "OPT_VERBOSE")) return UUOPT_VERBOSE; |
52 |
|
|
if (strEQ(name, "OPT_DESPERATE")) return UUOPT_DESPERATE; |
53 |
|
|
if (strEQ(name, "OPT_IGNREPLY")) return UUOPT_IGNREPLY; |
54 |
|
|
if (strEQ(name, "OPT_OVERWRITE")) return UUOPT_OVERWRITE; |
55 |
|
|
if (strEQ(name, "OPT_SAVEPATH")) return UUOPT_SAVEPATH; |
56 |
|
|
if (strEQ(name, "OPT_IGNMODE")) return UUOPT_IGNMODE; |
57 |
|
|
if (strEQ(name, "OPT_DEBUG")) return UUOPT_DEBUG; |
58 |
|
|
if (strEQ(name, "OPT_ERRNO")) return UUOPT_ERRNO; |
59 |
|
|
if (strEQ(name, "OPT_PROGRESS")) return UUOPT_PROGRESS; |
60 |
|
|
if (strEQ(name, "OPT_USETEXT")) return UUOPT_USETEXT; |
61 |
|
|
if (strEQ(name, "OPT_PREAMB")) return UUOPT_PREAMB; |
62 |
|
|
if (strEQ(name, "OPT_TINYB64")) return UUOPT_TINYB64; |
63 |
|
|
if (strEQ(name, "OPT_ENCEXT")) return UUOPT_ENCEXT; |
64 |
|
|
if (strEQ(name, "OPT_REMOVE")) return UUOPT_REMOVE; |
65 |
|
|
if (strEQ(name, "OPT_MOREMIME")) return UUOPT_MOREMIME; |
66 |
|
|
if (strEQ(name, "OPT_DOTDOT")) return UUOPT_DOTDOT; |
67 |
|
|
if (strEQ(name, "OPT_RBUF")) return UUOPT_RBUF; |
68 |
|
|
if (strEQ(name, "OPT_WBUF")) return UUOPT_WBUF; |
69 |
root |
1.14 |
if (strEQ(name, "OPT_AUTOCHECK")) return UUOPT_AUTOCHECK; |
70 |
root |
1.13 |
case 'R': |
71 |
|
|
if (strEQ(name, "RET_CANCEL")) return UURET_CANCEL; |
72 |
|
|
if (strEQ(name, "RET_CONT")) return UURET_CONT; |
73 |
|
|
if (strEQ(name, "RET_EXISTS")) return UURET_EXISTS; |
74 |
|
|
if (strEQ(name, "RET_ILLVAL")) return UURET_ILLVAL; |
75 |
|
|
if (strEQ(name, "RET_IOERR")) return UURET_IOERR; |
76 |
|
|
if (strEQ(name, "RET_NODATA")) return UURET_NODATA; |
77 |
|
|
if (strEQ(name, "RET_NOEND")) return UURET_NOEND; |
78 |
|
|
if (strEQ(name, "RET_NOMEM")) return UURET_NOMEM; |
79 |
|
|
if (strEQ(name, "RET_OK")) return UURET_OK; |
80 |
|
|
if (strEQ(name, "RET_UNSUP")) return UURET_UNSUP; |
81 |
|
|
case 'B': |
82 |
|
|
if (strEQ(name, "B64_ENCODED")) return B64ENCODED; |
83 |
|
|
if (strEQ(name, "BH_ENCODED")) return BH_ENCODED; |
84 |
|
|
case 'P': |
85 |
|
|
if (strEQ(name, "PT_ENCODED")) return PT_ENCODED; |
86 |
|
|
case 'Q': |
87 |
|
|
if (strEQ(name, "QP_ENCODED")) return QP_ENCODED; |
88 |
|
|
case 'U': |
89 |
|
|
if (strEQ(name, "UU_ENCODED")) return UU_ENCODED; |
90 |
|
|
case 'X': |
91 |
|
|
if (strEQ(name, "XX_ENCODED")) return XX_ENCODED; |
92 |
|
|
case 'Y': |
93 |
|
|
if (strEQ(name, "YENC_ENCODED")) return YENC_ENCODED; |
94 |
root |
1.1 |
} |
95 |
root |
1.13 |
|
96 |
|
|
errno = EINVAL; |
97 |
|
|
return 0; |
98 |
root |
1.1 |
} |
99 |
|
|
|
100 |
root |
1.8 |
static void |
101 |
|
|
uu_msg_callback (void *cb, char *msg, int level) |
102 |
root |
1.1 |
{ |
103 |
|
|
dSP; |
104 |
|
|
|
105 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
106 |
root |
1.1 |
|
107 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (msg, 0))); |
108 |
|
|
PUSHs (sv_2mortal (newSViv (level))); |
109 |
root |
1.1 |
|
110 |
|
|
PUTBACK; (void) perl_call_sv ((SV *)cb, G_VOID|G_DISCARD); SPAGAIN; |
111 |
|
|
PUTBACK; FREETMPS; LEAVE; |
112 |
|
|
} |
113 |
|
|
|
114 |
root |
1.8 |
static int |
115 |
|
|
uu_busy_callback (void *cb, uuprogress *uup) |
116 |
root |
1.1 |
{ |
117 |
|
|
dSP; |
118 |
|
|
int count; |
119 |
|
|
int retval; |
120 |
|
|
|
121 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 6); |
122 |
root |
1.1 |
|
123 |
root |
1.10 |
PUSHs (sv_2mortal (newSViv (uup->action))); |
124 |
|
|
PUSHs (sv_2mortal (newSVpv (uup->curfile, 0))); |
125 |
|
|
PUSHs (sv_2mortal (newSViv (uup->partno))); |
126 |
|
|
PUSHs (sv_2mortal (newSViv (uup->numparts))); |
127 |
|
|
PUSHs (sv_2mortal (newSViv (uup->fsize))); |
128 |
|
|
PUSHs (sv_2mortal (newSViv (uup->percent))); |
129 |
root |
1.1 |
|
130 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
131 |
|
|
|
132 |
|
|
if (count != 1) |
133 |
|
|
croak ("busycallback perl callback returned more than one argument"); |
134 |
|
|
|
135 |
|
|
retval = POPi; |
136 |
|
|
|
137 |
|
|
PUTBACK; FREETMPS; LEAVE; |
138 |
|
|
|
139 |
|
|
return retval; |
140 |
|
|
} |
141 |
|
|
|
142 |
root |
1.8 |
static char * |
143 |
|
|
uu_fnamefilter_callback (void *cb, char *fname) |
144 |
root |
1.1 |
{ |
145 |
|
|
dSP; |
146 |
|
|
int count; |
147 |
|
|
static char *str; |
148 |
|
|
|
149 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 1); |
150 |
root |
1.1 |
|
151 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (fname, 0))); |
152 |
root |
1.1 |
|
153 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
154 |
|
|
|
155 |
|
|
if (count != 1) |
156 |
root |
1.13 |
croak ("fnamefilter perl callback MUST return a single filename exactly"); |
157 |
root |
1.1 |
|
158 |
root |
1.13 |
_FP_free (str); str = _FP_strdup (SvPV_nolen (TOPs)); |
159 |
root |
1.1 |
|
160 |
|
|
PUTBACK; FREETMPS; LEAVE; |
161 |
|
|
|
162 |
|
|
return str; |
163 |
|
|
} |
164 |
|
|
|
165 |
root |
1.8 |
static int |
166 |
|
|
uu_file_callback (void *cb, char *id, char *fname, int retrieve) |
167 |
root |
1.1 |
{ |
168 |
|
|
dSP; |
169 |
|
|
int count; |
170 |
|
|
int retval; |
171 |
|
|
SV *xfname = newSVpv ("", 0); |
172 |
|
|
|
173 |
root |
1.10 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); |
174 |
root |
1.1 |
|
175 |
root |
1.10 |
PUSHs (sv_2mortal (newSVpv (id, 0))); |
176 |
|
|
PUSHs (sv_2mortal (xfname)); |
177 |
|
|
PUSHs (sv_2mortal (newSViv (retrieve))); |
178 |
root |
1.1 |
|
179 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
180 |
|
|
|
181 |
|
|
if (count != 1) |
182 |
root |
1.13 |
croak ("filecallback perl callback must return a single return status"); |
183 |
root |
1.1 |
|
184 |
root |
1.13 |
strcpy (fname, SvPV_nolen (xfname)); |
185 |
root |
1.1 |
retval = POPi; |
186 |
|
|
|
187 |
|
|
PUTBACK; FREETMPS; LEAVE; |
188 |
|
|
|
189 |
|
|
return retval; |
190 |
|
|
} |
191 |
|
|
|
192 |
root |
1.8 |
static char * |
193 |
|
|
uu_filename_callback (void *cb, char *subject, char *filename) |
194 |
root |
1.5 |
{ |
195 |
|
|
dSP; |
196 |
|
|
int count; |
197 |
|
|
|
198 |
root |
1.13 |
ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); |
199 |
root |
1.5 |
|
200 |
root |
1.13 |
PUSHs (sv_2mortal(newSVpv(subject, 0))); |
201 |
|
|
PUSHs (filename ? sv_2mortal(newSVpv(filename, 0)) : &PL_sv_undef); |
202 |
root |
1.5 |
|
203 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_ARRAY); SPAGAIN; |
204 |
|
|
|
205 |
|
|
if (count > 1) |
206 |
root |
1.13 |
croak ("filenamecallback perl callback must return nothing or a single filename"); |
207 |
root |
1.5 |
|
208 |
|
|
if (count) |
209 |
|
|
{ |
210 |
|
|
_FP_free (filename); |
211 |
|
|
|
212 |
root |
1.13 |
filename = SvOK (TOPs) |
213 |
|
|
? _FP_strdup (SvPV_nolen (TOPs)) |
214 |
|
|
: 0; |
215 |
root |
1.5 |
} |
216 |
|
|
|
217 |
|
|
PUTBACK; FREETMPS; LEAVE; |
218 |
|
|
|
219 |
|
|
return filename; |
220 |
|
|
} |
221 |
|
|
|
222 |
|
|
static SV *uu_msg_sv, *uu_busy_sv, *uu_file_sv, *uu_fnamefilter_sv, *uu_filename_sv; |
223 |
root |
1.1 |
|
224 |
|
|
#define FUNC_CB(cb) (void *)(sv_setsv (cb ## _sv, func), cb ## _sv), func ? cb ## _callback : NULL |
225 |
|
|
|
226 |
root |
1.8 |
static int |
227 |
|
|
uu_info_file (void *cb, char *info) |
228 |
root |
1.1 |
{ |
229 |
|
|
dSP; |
230 |
|
|
int count; |
231 |
|
|
int retval; |
232 |
|
|
|
233 |
|
|
ENTER; SAVETMPS; PUSHMARK(SP); EXTEND(SP,1); |
234 |
|
|
|
235 |
|
|
PUSHs(sv_2mortal(newSVpv(info,0))); |
236 |
|
|
|
237 |
|
|
PUTBACK; count = perl_call_sv ((SV *)cb, G_SCALAR); SPAGAIN; |
238 |
|
|
|
239 |
|
|
if (count != 1) |
240 |
|
|
croak ("info_file perl callback returned more than one argument"); |
241 |
|
|
|
242 |
|
|
retval = POPi; |
243 |
|
|
|
244 |
|
|
PUTBACK; FREETMPS; LEAVE; |
245 |
|
|
|
246 |
|
|
return retval; |
247 |
|
|
} |
248 |
|
|
|
249 |
|
|
static int |
250 |
|
|
uu_opt_isstring (int opt) |
251 |
|
|
{ |
252 |
|
|
switch (opt) |
253 |
|
|
{ |
254 |
|
|
case UUOPT_VERSION: |
255 |
|
|
case UUOPT_SAVEPATH: |
256 |
|
|
case UUOPT_ENCEXT: |
257 |
|
|
return 1; |
258 |
|
|
default: |
259 |
|
|
return 0; |
260 |
|
|
} |
261 |
|
|
} |
262 |
|
|
|
263 |
|
|
static int uu_initialized; |
264 |
|
|
|
265 |
|
|
MODULE = Convert::UUlib PACKAGE = Convert::UUlib PREFIX = UU |
266 |
|
|
|
267 |
|
|
PROTOTYPES: ENABLE |
268 |
|
|
|
269 |
|
|
int |
270 |
root |
1.8 |
constant (name) |
271 |
root |
1.1 |
char * name |
272 |
|
|
|
273 |
|
|
|
274 |
|
|
void |
275 |
root |
1.8 |
UUInitialize () |
276 |
root |
1.1 |
CODE: |
277 |
|
|
if (!uu_initialized) |
278 |
|
|
{ |
279 |
|
|
int retval; |
280 |
|
|
|
281 |
|
|
if ((retval = UUInitialize ()) != UURET_OK) |
282 |
|
|
croak ("unable to initialize uudeview library (%s)", UUstrerror (retval)); |
283 |
|
|
|
284 |
|
|
uu_initialized = 1; |
285 |
|
|
} |
286 |
|
|
|
287 |
|
|
void |
288 |
root |
1.8 |
UUCleanUp () |
289 |
root |
1.1 |
CODE: |
290 |
|
|
if (uu_initialized) |
291 |
|
|
UUCleanUp (); |
292 |
|
|
|
293 |
|
|
uu_initialized = 0; |
294 |
|
|
|
295 |
|
|
SV * |
296 |
root |
1.8 |
UUGetOption (opt) |
297 |
root |
1.1 |
int opt |
298 |
|
|
CODE: |
299 |
|
|
{ |
300 |
|
|
if (opt == UUOPT_PROGRESS) |
301 |
|
|
croak ("GetOption(UUOPT_PROGRESS) is not yet implemented"); |
302 |
|
|
else if (uu_opt_isstring (opt)) |
303 |
|
|
{ |
304 |
|
|
char cval[8192]; |
305 |
|
|
|
306 |
|
|
UUGetOption (opt, 0, cval, sizeof cval); |
307 |
|
|
RETVAL = newSVpv (cval, 0); |
308 |
|
|
} |
309 |
|
|
else |
310 |
|
|
{ |
311 |
|
|
RETVAL = newSViv (UUGetOption (opt, 0, 0, 0)); |
312 |
|
|
} |
313 |
|
|
} |
314 |
|
|
OUTPUT: |
315 |
|
|
RETVAL |
316 |
|
|
|
317 |
|
|
int |
318 |
root |
1.8 |
UUSetOption (opt, val) |
319 |
root |
1.1 |
int opt |
320 |
|
|
SV * val |
321 |
|
|
CODE: |
322 |
|
|
{ |
323 |
|
|
STRLEN dc; |
324 |
|
|
|
325 |
|
|
if (uu_opt_isstring (opt)) |
326 |
|
|
RETVAL = UUSetOption (opt, 0, SvPV (val, dc)); |
327 |
|
|
else |
328 |
|
|
RETVAL = UUSetOption (opt, SvIV (val), (void *)0); |
329 |
|
|
} |
330 |
|
|
OUTPUT: |
331 |
|
|
RETVAL |
332 |
|
|
|
333 |
|
|
char * |
334 |
root |
1.8 |
UUstrerror (errcode) |
335 |
root |
1.1 |
int errcode |
336 |
|
|
|
337 |
|
|
void |
338 |
root |
1.8 |
UUSetMsgCallback (func = 0) |
339 |
root |
1.1 |
SV * func |
340 |
|
|
CODE: |
341 |
root |
1.13 |
UUSetMsgCallback (FUNC_CB (uu_msg)); |
342 |
root |
1.1 |
|
343 |
|
|
void |
344 |
root |
1.8 |
UUSetBusyCallback (func = 0,msecs = 1000) |
345 |
root |
1.1 |
SV * func |
346 |
|
|
long msecs |
347 |
|
|
CODE: |
348 |
root |
1.13 |
UUSetBusyCallback (FUNC_CB (uu_busy), msecs); |
349 |
root |
1.1 |
|
350 |
|
|
void |
351 |
root |
1.8 |
UUSetFileCallback (func = 0) |
352 |
root |
1.1 |
SV * func |
353 |
|
|
CODE: |
354 |
root |
1.13 |
UUSetFileCallback (FUNC_CB (uu_file)); |
355 |
root |
1.1 |
|
356 |
|
|
void |
357 |
root |
1.8 |
UUSetFNameFilter (func = 0) |
358 |
root |
1.1 |
SV * func |
359 |
|
|
CODE: |
360 |
root |
1.13 |
UUSetFNameFilter (FUNC_CB (uu_fnamefilter)); |
361 |
root |
1.1 |
|
362 |
root |
1.5 |
void |
363 |
root |
1.8 |
UUSetFileNameCallback (func = 0) |
364 |
root |
1.5 |
SV * func |
365 |
|
|
CODE: |
366 |
root |
1.13 |
UUSetFileNameCallback (FUNC_CB (uu_filename)); |
367 |
root |
1.5 |
|
368 |
root |
1.1 |
char * |
369 |
root |
1.8 |
UUFNameFilter (fname) |
370 |
root |
1.1 |
char * fname |
371 |
|
|
|
372 |
|
|
void |
373 |
root |
1.11 |
UULoadFile (fname, id = 0, delflag = 0, partno = -1) |
374 |
root |
1.1 |
char * fname |
375 |
|
|
char * id |
376 |
|
|
int delflag |
377 |
root |
1.11 |
int partno |
378 |
root |
1.1 |
PPCODE: |
379 |
|
|
{ |
380 |
|
|
int count; |
381 |
|
|
|
382 |
root |
1.10 |
XPUSHs (sv_2mortal (newSViv (UULoadFileWithPartNo (fname, id, delflag, partno, &count)))); |
383 |
root |
1.1 |
if (GIMME_V == G_ARRAY) |
384 |
root |
1.10 |
XPUSHs (sv_2mortal (newSViv (count))); |
385 |
root |
1.1 |
} |
386 |
|
|
|
387 |
root |
1.14 |
void |
388 |
|
|
UUCheckGlobalList () |
389 |
|
|
|
390 |
root |
1.1 |
int |
391 |
root |
1.8 |
UUSmerge (pass) |
392 |
root |
1.1 |
int pass |
393 |
|
|
|
394 |
|
|
int |
395 |
|
|
UUQuickDecode(datain,dataout,boundary,maxpos) |
396 |
|
|
FILE * datain |
397 |
|
|
FILE * dataout |
398 |
|
|
char * boundary |
399 |
|
|
long maxpos |
400 |
|
|
|
401 |
|
|
int |
402 |
|
|
UUEncodeMulti(outfile,infile,infname,encoding,outfname,mimetype,filemode) |
403 |
|
|
FILE * outfile |
404 |
|
|
FILE * infile |
405 |
|
|
char * infname |
406 |
|
|
int encoding |
407 |
|
|
char * outfname |
408 |
|
|
char * mimetype |
409 |
|
|
int filemode |
410 |
|
|
|
411 |
|
|
int |
412 |
|
|
UUEncodePartial(outfile,infile,infname,encoding,outfname,mimetype,filemode,partno,linperfile) |
413 |
|
|
FILE * outfile |
414 |
|
|
FILE * infile |
415 |
|
|
char * infname |
416 |
|
|
int encoding |
417 |
|
|
char * outfname |
418 |
|
|
char * mimetype |
419 |
|
|
int filemode |
420 |
|
|
int partno |
421 |
|
|
long linperfile |
422 |
|
|
|
423 |
|
|
int |
424 |
|
|
UUEncodeToStream(outfile,infile,infname,encoding,outfname,filemode) |
425 |
|
|
FILE * outfile |
426 |
|
|
FILE * infile |
427 |
|
|
char * infname |
428 |
|
|
int encoding |
429 |
|
|
char * outfname |
430 |
|
|
int filemode |
431 |
|
|
|
432 |
|
|
int |
433 |
|
|
UUEncodeToFile(infile,infname,encoding,outfname,diskname,linperfile) |
434 |
|
|
FILE * infile |
435 |
|
|
char * infname |
436 |
|
|
int encoding |
437 |
|
|
char * outfname |
438 |
|
|
char * diskname |
439 |
|
|
long linperfile |
440 |
|
|
|
441 |
|
|
int |
442 |
|
|
UUE_PrepSingle(outfile,infile,infname,encoding,outfname,filemode,destination,from,subject,isemail) |
443 |
|
|
FILE * outfile |
444 |
|
|
FILE * infile |
445 |
|
|
char * infname |
446 |
|
|
int encoding |
447 |
|
|
char * outfname |
448 |
|
|
int filemode |
449 |
|
|
char * destination |
450 |
|
|
char * from |
451 |
|
|
char * subject |
452 |
|
|
int isemail |
453 |
|
|
|
454 |
|
|
int |
455 |
|
|
UUE_PrepPartial(outfile,infile,infname,encoding,outfname,filemode,partno,linperfile,filesize,destination,from,subject,isemail) |
456 |
|
|
FILE * outfile |
457 |
|
|
FILE * infile |
458 |
|
|
char * infname |
459 |
|
|
int encoding |
460 |
|
|
char * outfname |
461 |
|
|
int filemode |
462 |
|
|
int partno |
463 |
|
|
long linperfile |
464 |
|
|
long filesize |
465 |
|
|
char * destination |
466 |
|
|
char * from |
467 |
|
|
char * subject |
468 |
|
|
int isemail |
469 |
|
|
|
470 |
|
|
uulist * |
471 |
root |
1.8 |
UUGetFileListItem (num) |
472 |
root |
1.1 |
int num |
473 |
|
|
|
474 |
root |
1.8 |
MODULE = Convert::UUlib PACKAGE = Convert::UUlib::Item |
475 |
|
|
|
476 |
root |
1.1 |
int |
477 |
root |
1.8 |
rename (item, newname) |
478 |
root |
1.1 |
uulist *item |
479 |
|
|
char * newname |
480 |
root |
1.8 |
CODE: |
481 |
|
|
RETVAL = UURenameFile (item, newname); |
482 |
|
|
OUTPUT: |
483 |
|
|
RETVAL |
484 |
root |
1.1 |
|
485 |
|
|
int |
486 |
root |
1.8 |
decode_temp (item) |
487 |
root |
1.1 |
uulist *item |
488 |
root |
1.8 |
CODE: |
489 |
|
|
RETVAL = UUDecodeToTemp (item); |
490 |
|
|
OUTPUT: |
491 |
|
|
RETVAL |
492 |
root |
1.1 |
|
493 |
|
|
int |
494 |
root |
1.8 |
remove_temp (item) |
495 |
root |
1.1 |
uulist *item |
496 |
root |
1.8 |
CODE: |
497 |
|
|
RETVAL = UURemoveTemp (item); |
498 |
|
|
OUTPUT: |
499 |
|
|
RETVAL |
500 |
root |
1.1 |
|
501 |
|
|
int |
502 |
root |
1.8 |
decode (item, target = 0) |
503 |
root |
1.1 |
uulist *item |
504 |
|
|
char * target |
505 |
root |
1.8 |
CODE: |
506 |
|
|
RETVAL = UUDecodeFile (item, target); |
507 |
|
|
OUTPUT: |
508 |
|
|
RETVAL |
509 |
root |
1.1 |
|
510 |
|
|
void |
511 |
root |
1.8 |
info (item, func) |
512 |
root |
1.1 |
uulist *item |
513 |
|
|
SV * func |
514 |
|
|
CODE: |
515 |
root |
1.8 |
UUInfoFile (item,(void *)func, uu_info_file); |
516 |
root |
1.1 |
|
517 |
|
|
short |
518 |
|
|
state(li) |
519 |
|
|
uulist *li |
520 |
|
|
CODE: |
521 |
|
|
RETVAL = li->state; |
522 |
|
|
OUTPUT: |
523 |
|
|
RETVAL |
524 |
|
|
|
525 |
|
|
short |
526 |
|
|
mode(li,newmode=0) |
527 |
|
|
uulist *li |
528 |
|
|
short newmode |
529 |
|
|
CODE: |
530 |
|
|
if (newmode) |
531 |
|
|
li->mode = newmode; |
532 |
|
|
RETVAL = li->mode; |
533 |
|
|
OUTPUT: |
534 |
|
|
RETVAL |
535 |
|
|
|
536 |
|
|
short |
537 |
|
|
uudet(li) |
538 |
|
|
uulist *li |
539 |
|
|
CODE: |
540 |
|
|
RETVAL = li->uudet; |
541 |
|
|
OUTPUT: |
542 |
|
|
RETVAL |
543 |
|
|
|
544 |
|
|
long |
545 |
|
|
size(li) |
546 |
|
|
uulist *li |
547 |
|
|
CODE: |
548 |
|
|
RETVAL = li->size; |
549 |
|
|
OUTPUT: |
550 |
|
|
RETVAL |
551 |
|
|
|
552 |
|
|
char * |
553 |
root |
1.8 |
filename (li, newfilename = 0) |
554 |
root |
1.1 |
uulist *li |
555 |
|
|
char * newfilename |
556 |
|
|
CODE: |
557 |
|
|
if (newfilename) |
558 |
|
|
{ |
559 |
root |
1.4 |
_FP_free (li->filename); |
560 |
|
|
li->filename = _FP_strdup (newfilename); |
561 |
root |
1.1 |
} |
562 |
|
|
RETVAL = li->filename; |
563 |
|
|
OUTPUT: |
564 |
|
|
RETVAL |
565 |
|
|
|
566 |
|
|
char * |
567 |
root |
1.8 |
subfname (li) |
568 |
root |
1.1 |
uulist *li |
569 |
|
|
CODE: |
570 |
|
|
RETVAL = li->subfname; |
571 |
|
|
OUTPUT: |
572 |
|
|
RETVAL |
573 |
|
|
|
574 |
|
|
char * |
575 |
root |
1.8 |
mimeid (li) |
576 |
root |
1.1 |
uulist *li |
577 |
|
|
CODE: |
578 |
|
|
RETVAL = li->mimeid; |
579 |
|
|
OUTPUT: |
580 |
|
|
RETVAL |
581 |
|
|
|
582 |
|
|
char * |
583 |
root |
1.8 |
mimetype (li) |
584 |
root |
1.1 |
uulist *li |
585 |
|
|
CODE: |
586 |
|
|
RETVAL = li->mimetype; |
587 |
|
|
OUTPUT: |
588 |
|
|
RETVAL |
589 |
|
|
|
590 |
|
|
char * |
591 |
root |
1.8 |
binfile (li) |
592 |
root |
1.1 |
uulist *li |
593 |
|
|
CODE: |
594 |
|
|
RETVAL = li->binfile; |
595 |
|
|
OUTPUT: |
596 |
|
|
RETVAL |
597 |
|
|
|
598 |
root |
1.8 |
# methods accessing internal data(!) |
599 |
root |
1.1 |
|
600 |
|
|
void |
601 |
root |
1.8 |
parts (li) |
602 |
root |
1.1 |
uulist *li |
603 |
|
|
PPCODE: |
604 |
|
|
{ |
605 |
|
|
struct _uufile *p = li->thisfile; |
606 |
|
|
|
607 |
|
|
while (p) |
608 |
|
|
{ |
609 |
|
|
HV *pi = newHV (); |
610 |
|
|
|
611 |
|
|
hv_store (pi, "partno" , 6, newSViv (p->partno) , 0); |
612 |
|
|
|
613 |
|
|
if (p->filename) |
614 |
|
|
hv_store (pi, "filename", 8, newSVpv (p->filename, 0) , 0); |
615 |
|
|
if(p->subfname) |
616 |
|
|
hv_store (pi, "subfname", 8, newSVpv (p->subfname, 0) , 0); |
617 |
|
|
if(p->mimeid) |
618 |
|
|
hv_store (pi, "mimeid" , 6, newSVpv (p->mimeid , 0) , 0); |
619 |
|
|
if(p->mimetype) |
620 |
|
|
hv_store (pi, "mimetype", 8, newSVpv (p->mimetype, 0) , 0); |
621 |
|
|
if (p->data->subject) |
622 |
|
|
hv_store (pi, "subject" , 7, newSVpv (p->data->subject,0), 0); |
623 |
|
|
if (p->data->origin) |
624 |
|
|
hv_store (pi, "origin" , 6, newSVpv (p->data->origin ,0), 0); |
625 |
|
|
if (p->data->sfname) |
626 |
|
|
hv_store (pi, "sfname" , 6, newSVpv (p->data->sfname ,0), 0); |
627 |
|
|
|
628 |
|
|
XPUSHs (sv_2mortal (newRV_noinc ((SV *)pi))); |
629 |
|
|
|
630 |
|
|
p = p->NEXT; |
631 |
|
|
} |
632 |
|
|
} |
633 |
|
|
|
634 |
|
|
BOOT: |
635 |
root |
1.13 |
uu_msg_sv = newSVsv (&PL_sv_undef); |
636 |
|
|
uu_busy_sv = newSVsv (&PL_sv_undef); |
637 |
|
|
uu_file_sv = newSVsv (&PL_sv_undef); |
638 |
|
|
uu_fnamefilter_sv = newSVsv (&PL_sv_undef); |
639 |
|
|
uu_filename_sv = newSVsv (&PL_sv_undef); |
640 |
root |
1.1 |
|