File Coverage

pp-plspage.c
Criterion Covered Total %
statement 34 35 97.1
branch 35 66 53.0
condition n/a
subroutine n/a
pod n/a
total 69 101 68.3


line stmt bran cond sub pod time code
1              
2             #line 453 "lib/PDL/PP.pm"
3             /*
4             * THIS FILE WAS GENERATED BY PDL::PP from plplot.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_Graphics_PLplot
21             extern Core* PDL; /* Structure hold core C functions */
22             #line 23 "pp-plspage.c"
23             #include
24             #include
25             #include
26             #include
27              
28             #ifndef PDL /* this is needed for PDL pre-2.058 */
29             #define PDL PDL_Graphics_PLplot
30             Core* PDL = NULL; PDL_COMMENT("Structure hold core C functions")
31             #endif
32              
33             #define PLPTR_DEFINE(t) typedef t *t ## Ptr; typedef t *t ## Ptr__OUT;
34             PLPTR_DEFINE(PLcGrid)
35             PLPTR_DEFINE(PLcGrid2)
36             #define PLPTR_RECEIVE_IN(t, v, v_in) t *v = (t *)v_in;
37             #define PLPTR_RECEIVE_SV(v) ((PLPointer) (SvROK(v) ? SvIV((SV*)SvRV(v)) : (IV)NULL))
38              
39             #line 1857 "lib/PDL/PP.pm"
40             pdl_error pdl_plspage_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plspage.c"
43 154 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plspage:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 154           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 154           register PDL_Indx __tinc0_xp = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 154           register PDL_Indx __tinc0_yp = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 154           register PDL_Indx __tinc0_xleng = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 154           register PDL_Indx __tinc0_yleng = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 154           register PDL_Indx __tinc0_xoff = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0);
54 154           register PDL_Indx __tinc0_yoff = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,5,0);
55 154           register PDL_Indx __tinc1_xp = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
56 154           register PDL_Indx __tinc1_yp = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
57 154           register PDL_Indx __tinc1_xleng = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
58 154           register PDL_Indx __tinc1_yleng = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
59 154           register PDL_Indx __tinc1_xoff = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1);
60 154           register PDL_Indx __tinc1_yoff = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,5,1);
61             #define PDL_BROADCASTLOOP_START_plspage_readdata PDL_BROADCASTLOOP_START( \
62             readdata, \
63             __privtrans->broadcast, \
64             __privtrans->vtable, \
65             xp_datap += __offsp[0]; \
66             yp_datap += __offsp[1]; \
67             xleng_datap += __offsp[2]; \
68             yleng_datap += __offsp[3]; \
69             xoff_datap += __offsp[4]; \
70             yoff_datap += __offsp[5]; \
71             , \
72             ( ,xp_datap += __tinc1_xp - __tinc0_xp * __tdims0 \
73             ,yp_datap += __tinc1_yp - __tinc0_yp * __tdims0 \
74             ,xleng_datap += __tinc1_xleng - __tinc0_xleng * __tdims0 \
75             ,yleng_datap += __tinc1_yleng - __tinc0_yleng * __tdims0 \
76             ,xoff_datap += __tinc1_xoff - __tinc0_xoff * __tdims0 \
77             ,yoff_datap += __tinc1_yoff - __tinc0_yoff * __tdims0 \
78             ), \
79             ( ,xp_datap += __tinc0_xp \
80             ,yp_datap += __tinc0_yp \
81             ,xleng_datap += __tinc0_xleng \
82             ,yleng_datap += __tinc0_yleng \
83             ,xoff_datap += __tinc0_xoff \
84             ,yoff_datap += __tinc0_yoff \
85             ) \
86             )
87             #define PDL_BROADCASTLOOP_END_plspage_readdata PDL_BROADCASTLOOP_END( \
88             __privtrans->broadcast, \
89             xp_datap -= __tinc1_xp * __tdims1 + __offsp[0]; \
90             yp_datap -= __tinc1_yp * __tdims1 + __offsp[1]; \
91             xleng_datap -= __tinc1_xleng * __tdims1 + __offsp[2]; \
92             yleng_datap -= __tinc1_yleng * __tdims1 + __offsp[3]; \
93             xoff_datap -= __tinc1_xoff * __tdims1 + __offsp[4]; \
94             yoff_datap -= __tinc1_yoff * __tdims1 + __offsp[5]; \
95             )
96             #ifndef PDL_DECLARE_PARAMS_plspage_1
97             #define PDL_DECLARE_PARAMS_plspage_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_xp,PDL_PPSYM_PARAM_xp,PDL_TYPE_PARAM_yp,PDL_PPSYM_PARAM_yp,PDL_TYPE_PARAM_xleng,PDL_PPSYM_PARAM_xleng,PDL_TYPE_PARAM_yleng,PDL_PPSYM_PARAM_yleng,PDL_TYPE_PARAM_xoff,PDL_PPSYM_PARAM_xoff,PDL_TYPE_PARAM_yoff,PDL_PPSYM_PARAM_yoff) \
98             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_xp, xp, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_xp) \
99             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_yp, yp, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_yp) \
100             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_xleng, xleng, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_xleng) \
101             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_yleng, yleng, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_yleng) \
102             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_xoff, xoff, (__privtrans->pdls[4]), 1, PDL_PPSYM_PARAM_xoff) \
103             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_yoff, yoff, (__privtrans->pdls[5]), 1, PDL_PPSYM_PARAM_yoff)
104             #endif
105             #define PDL_IF_BAD(t,f) f
106 154 50         switch (__privtrans->__datatype) { /* Start generic switch */
107 154           case PDL_D: {
108 154 50         PDL_DECLARE_PARAMS_plspage_1(PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L,PDL_Long,L,PDL_Long,L,PDL_Long,L)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
109 616 50         PDL_BROADCASTLOOP_START_plspage_readdata {c_plspage((xp_datap)[0],(yp_datap)[0],(xleng_datap)[0],(yleng_datap)[0],(xoff_datap)[0],(yoff_datap)[0]);}PDL_BROADCASTLOOP_END_plspage_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
110 154           } break;
111 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plspage: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
112             }
113             #undef PDL_IF_BAD
114 154           return PDL_err;
115             }
116              
117             static pdl_datatypes pdl_plspage_vtable_gentypes[] = { PDL_D, -1 };
118             static PDL_Indx pdl_plspage_vtable_realdims[] = { 0, 0, 0, 0, 0, 0 };
119             static char *pdl_plspage_vtable_parnames[] = { "xp","yp","xleng","yleng","xoff","yoff" };
120             static short pdl_plspage_vtable_parflags[] = {
121             PDL_PARAM_ISTYPED,
122             PDL_PARAM_ISTYPED,
123             PDL_PARAM_ISTYPED,
124             PDL_PARAM_ISTYPED,
125             PDL_PARAM_ISTYPED,
126             PDL_PARAM_ISTYPED
127             };
128             static pdl_datatypes pdl_plspage_vtable_partypes[] = { PDL_D, PDL_D, PDL_L, PDL_L, PDL_L, PDL_L };
129             static PDL_Indx pdl_plspage_vtable_realdims_starts[] = { 0, 0, 0, 0, 0, 0 };
130             static PDL_Indx pdl_plspage_vtable_realdims_ind_ids[] = { 0 };
131             static char *pdl_plspage_vtable_indnames[] = { "" };
132             pdl_transvtable pdl_plspage_vtable = {
133             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plspage_vtable_gentypes, 6, 6, NULL /*CORE21*/,
134             pdl_plspage_vtable_realdims, pdl_plspage_vtable_parnames,
135             pdl_plspage_vtable_parflags, pdl_plspage_vtable_partypes,
136             pdl_plspage_vtable_realdims_starts, pdl_plspage_vtable_realdims_ind_ids, 0,
137             0, pdl_plspage_vtable_indnames,
138             NULL, pdl_plspage_readdata, NULL,
139             NULL,
140             0,"PDL::Graphics::PLplot::plspage"
141             };
142              
143              
144 154           pdl_error pdl_run_plspage(pdl *xp,pdl *yp,pdl *xleng,pdl *yleng,pdl *xoff,pdl *yoff) {
145 154           pdl_error PDL_err = {0, NULL, 0};
146 154 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
147 154           pdl_trans *__privtrans = PDL->create_trans(&pdl_plspage_vtable);
148 154 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
149 154           __privtrans->pdls[0] = xp;
150 154           __privtrans->pdls[1] = yp;
151 154           __privtrans->pdls[2] = xleng;
152 154           __privtrans->pdls[3] = yleng;
153 154           __privtrans->pdls[4] = xoff;
154 154           __privtrans->pdls[5] = yoff;
155 154 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
156 154 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
157 154           return PDL_err;
158             }