UUlib.xs

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