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