lib/PDL/IO/Pnm.xs

filter: Statementstmt 80.0% 20 / 25 Branchbran 36.1% 34 / 94 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 45.3% 54 / 119 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/PDL/Compression/ricecomp.c ↑ Summary lib/PDL/ImageND-pp-combcoords.c »
1  
2 #line 453 "lib/PDL/PP.pm"
3 /*
4 * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/IO/Pnm.pd! Do not modify!
5 */
6  
7 #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \
8 if (destroy) { \
9 comp_free_code \
10 } \
11 if ((trans)->dims_redone) { \
12 ntpriv_free_code \
13 }
14  
15 #include "EXTERN.h"
16 #include "perl.h"
17 #include "XSUB.h"
18 #include "pdl.h"
19 #include "pdlcore.h"
20 #define PDL PDL_IO_Pnm
21 extern Core* PDL; /* Structure hold core C functions */
22 #line 23 "lib/PDL/IO/Pnm.xs"
23 pdl_error pdl_run_pnminraw(pdl *type,pdl *im,IV ms,IV ns,int isbin,PerlIO *fp);
24 pdl_error pdl_run_pnminascii(pdl *type,pdl *im,IV ms,IV ns,int format,PerlIO *fp);
25 pdl_error pdl_run_pnmout(pdl *a,int israw,int isbin,PerlIO *fp);
26  
27 #line 449 "lib/PDL/PP.pm"
28 #include "pdlperl.h"
29 #line 30 "lib/PDL/IO/Pnm.xs"
30  
31 Core* PDL = NULL; /* Structure hold core C functions */
32  
33 MODULE = PDL::IO::Pnm PACKAGE = PDL PREFIX=pdl_run_
34  
35 PROTOTYPES: DISABLE
36  
37  
38 void
39 pdl_run_pnminraw(type, im=im, ms=ms, ns=ns, isbin=isbin, fp=fp)
40 SV *im_SV = (items == 6) ? ST(1) : NULL;
41 SV *ms_SV = (items == 6) ? ST(2) : ST(1);
42 SV *ns_SV = (items == 6) ? ST(3) : ST(2);
43 SV *isbin_SV = (items == 6) ? ST(4) : ST(3);
44 SV *fp_SV = (items == 6) ? ST(5) : ST(4);
45 PREINIT:
46 32 ▶ PDL_XS_PREAMBLE((items == 6) ? 0 : 1);
Branch: 10 branches
BranchTrueFalseTotal
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 32 0 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 32 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 0 0
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 32 0 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 32 0 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 32 0 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 32 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 0 0
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 32 0 32
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 32 32
47 32 ▶ if (!((items == 5) || (items == 6)))
Branch: 2 branches
BranchTrueFalseTotal
if (!((items == 5) || (items == 6))) 32 0 32
if (!((items == 5) || (items == 6))) 0 32 32
48 0 croak("Usage: PDL::pnminraw(type,[im],ms,ns,isbin,fp) (you may leave [outputs] and values with =defaults out of list)");
49 INPUT:
50 pdl *type
51 pdl *im=NO_INIT
52 IV ms; { ms = (IV)SvIV(ms_SV); }
53 IV ns; { ns = (IV)SvIV(ns_SV); }
54 int isbin; { isbin = (int)SvIV(isbin_SV); }
55 PerlIO *fp; { fp = IoIFP(sv_2io(fp_SV)); }
56 PPCODE:
57 32 ▶ if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV);
Branch: 2 branches
BranchTrueFalseTotal
if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV); 32 0 32
if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV); 0 0 0
58 32 ▶ if (PDL_IS_INPLACE(type)) PDL->pdl_barf("pnminraw: type->inplace but not supported");
Branch: 1 branch
BranchTrueFalseTotal
if (PDL_IS_INPLACE(type)) PDL->pdl_barf("pnminraw: type->inplace but not supported"); 0 32 32
59 32 PDL->barf_if_error(pdl_run_pnminraw(type,im,ms,ns,isbin,fp));
60 32 ▶ PDL_XS_RETURN(ST(0) = im_SV)
Branch: 5 branches
BranchTrueFalseTotal
PDL_XS_RETURN(ST(0) = im_SV) 0 32 32
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 32 32
61  
62 void
63 pdl_run_pnminascii(type, im=im, ms=ms, ns=ns, format=format, fp=fp)
64 SV *im_SV = (items == 6) ? ST(1) : NULL;
65 SV *ms_SV = (items == 6) ? ST(2) : ST(1);
66 SV *ns_SV = (items == 6) ? ST(3) : ST(2);
67 SV *format_SV = (items == 6) ? ST(4) : ST(3);
68 SV *fp_SV = (items == 6) ? ST(5) : ST(4);
69 PREINIT:
70 16 ▶ PDL_XS_PREAMBLE((items == 6) ? 0 : 1);
Branch: 10 branches
BranchTrueFalseTotal
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 16 0 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 16 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 0 0
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 16 0 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 16 0 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 16 0 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 16 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 0 0
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 16 0 16
PDL_XS_PREAMBLE((items == 6) ? 0 : 1); 0 16 16
71 16 ▶ if (!((items == 5) || (items == 6)))
Branch: 2 branches
BranchTrueFalseTotal
if (!((items == 5) || (items == 6))) 16 0 16
if (!((items == 5) || (items == 6))) 0 16 16
72 0 croak("Usage: PDL::pnminascii(type,[im],ms,ns,format,fp) (you may leave [outputs] and values with =defaults out of list)");
73 INPUT:
74 pdl *type
75 pdl *im=NO_INIT
76 IV ms; { ms = (IV)SvIV(ms_SV); }
77 IV ns; { ns = (IV)SvIV(ns_SV); }
78 int format; { format = (int)SvIV(format_SV); }
79 PerlIO *fp; { fp = IoIFP(sv_2io(fp_SV)); }
80 PPCODE:
81 16 ▶ if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV);
Branch: 2 branches
BranchTrueFalseTotal
if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV); 16 0 16
if (im_SV) { im = PDL_CORE_(SvPDLV)(im_SV); } else im = PDL_XS_PERLINIT_initsv(im_SV); 0 0 0
82 16 ▶ if (PDL_IS_INPLACE(type)) PDL->pdl_barf("pnminascii: type->inplace but not supported");
Branch: 1 branch
BranchTrueFalseTotal
if (PDL_IS_INPLACE(type)) PDL->pdl_barf("pnminascii: type->inplace but not supported"); 0 16 16
83 16 PDL->barf_if_error(pdl_run_pnminascii(type,im,ms,ns,format,fp));
84 16 ▶ PDL_XS_RETURN(ST(0) = im_SV)
Branch: 5 branches
BranchTrueFalseTotal
PDL_XS_RETURN(ST(0) = im_SV) 0 16 16
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 0 0
PDL_XS_RETURN(ST(0) = im_SV) 0 16 16
85  
86 void
87 pdl_run_pnmout(a, israw, isbin, fp)
88 pdl *a
89 int israw
90 int isbin
91 PerlIO *fp
92 PPCODE:
93 42 ▶ if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnmout: a->inplace but not supported");
Branch: 1 branch
BranchTrueFalseTotal
if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnmout: a->inplace but not supported"); 0 42 42
94 42 PDL->barf_if_error(pdl_run_pnmout(a,israw,isbin,fp));
95  
96  
97 #line 483 "lib/PDL/PP.pm"
98 BOOT:
99 /* Get pointer to structure of core shared C routines */
100 /* make sure PDL::Core is loaded */
101 #line 102 "lib/PDL/IO/Pnm.xs"
102 15 perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */
103 #ifndef aTHX_
104 #define aTHX_
105 #endif
106 15 ▶ if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV));
Branch: 3 branches
BranchTrueFalseTotal
if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); 15 0 15
if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); 0 15 15
if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); 0 0 0
107 15 SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */
108 15 ▶ if (!CoreSV)
Branch: 1 branch
BranchTrueFalseTotal
if (!CoreSV) 0 15 15
109 0 Perl_croak(aTHX_ "We require the PDL::Core module, which was not found");
110 15 ▶ if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */
Branch: 1 branch
BranchTrueFalseTotal
if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ 0 15 15
111 0 Perl_croak(aTHX_ "Got NULL pointer for PDL");
112 15 ▶ if (PDL->Version != PDL_CORE_VERSION)
Branch: 1 branch
BranchTrueFalseTotal
if (PDL->Version != PDL_CORE_VERSION) 0 15 15
113 0 Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::IO::Pnm needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION);
« lib/PDL/Compression/ricecomp.c ↑ Summary lib/PDL/ImageND-pp-combcoords.c »