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