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