File Coverage

pp-plscmap1l.c
Criterion Covered Total %
statement 45 47 95.7
branch 39 70 55.7
condition n/a
subroutine n/a
pod n/a
total 84 117 71.7


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-plscmap1l.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             void pltr_iv_set(IV iv0, IV iv1, IV iv2);
40             void pltr_callback_set(SV *sv, char *msg);
41             void pltr_callback(PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, PLPointer pltr_data);
42             void* get_standard_pltrcb(SV* cb);
43             void defined_callback_set(SV *sv, char *msg);
44             PLINT defined_callback(PLFLT x, PLFLT y);
45             void default_magic(pdl *p, size_t pa);
46             void mapform_callback_set(SV *sv, char *msg);
47             void mapform_callback(PLINT n, PLFLT* x, PLFLT* y);
48             void xform_callback_set(SV *sv, char *msg);
49             void xform_callback(PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data);
50             void labelfunc_callback_set(SV *sv, char *msg);
51             void labelfunc_callback(PLINT axis, PLFLT value, char *label_text, PLINT length, void *data);
52              
53             #line 1857 "lib/PDL/PP.pm"
54             pdl_error pdl_plscmap1l_readdata(pdl_trans *__privtrans) {
55             pdl_error PDL_err = {0, NULL, 0};
56             #line 57 "pp-plscmap1l.c"
57 25 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plscmap1l:" "broadcast.incs NULL");
58             /* broadcastloop declarations */
59             int __brcloopval;
60             register PDL_Indx __tind0,__tind1; /* counters along dim */
61 25           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
62             /* dims here are how many steps along those dims */
63 25           register PDL_Indx __tinc0_itype = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
64 25           register PDL_Indx __tinc0_isty = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
65 25           register PDL_Indx __tinc0_coord1 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
66 25           register PDL_Indx __tinc0_coord2 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
67 25           register PDL_Indx __tinc0_coord3 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0);
68 25           register PDL_Indx __tinc0_rev = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,5,0);
69 25           register PDL_Indx __tinc1_itype = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
70 25           register PDL_Indx __tinc1_isty = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
71 25           register PDL_Indx __tinc1_coord1 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
72 25           register PDL_Indx __tinc1_coord2 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
73 25           register PDL_Indx __tinc1_coord3 = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1);
74 25           register PDL_Indx __tinc1_rev = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,5,1);
75             #define PDL_BROADCASTLOOP_START_plscmap1l_readdata PDL_BROADCASTLOOP_START( \
76             readdata, \
77             __privtrans->broadcast, \
78             __privtrans->vtable, \
79             itype_datap += __offsp[0]; \
80             isty_datap += __offsp[1]; \
81             coord1_datap += __offsp[2]; \
82             coord2_datap += __offsp[3]; \
83             coord3_datap += __offsp[4]; \
84             rev_datap += __offsp[5]; \
85             , \
86             ( ,itype_datap += __tinc1_itype - __tinc0_itype * __tdims0 \
87             ,isty_datap += __tinc1_isty - __tinc0_isty * __tdims0 \
88             ,coord1_datap += __tinc1_coord1 - __tinc0_coord1 * __tdims0 \
89             ,coord2_datap += __tinc1_coord2 - __tinc0_coord2 * __tdims0 \
90             ,coord3_datap += __tinc1_coord3 - __tinc0_coord3 * __tdims0 \
91             ,rev_datap += __tinc1_rev - __tinc0_rev * __tdims0 \
92             ), \
93             ( ,itype_datap += __tinc0_itype \
94             ,isty_datap += __tinc0_isty \
95             ,coord1_datap += __tinc0_coord1 \
96             ,coord2_datap += __tinc0_coord2 \
97             ,coord3_datap += __tinc0_coord3 \
98             ,rev_datap += __tinc0_rev \
99             ) \
100             )
101             #define PDL_BROADCASTLOOP_END_plscmap1l_readdata PDL_BROADCASTLOOP_END( \
102             __privtrans->broadcast, \
103             itype_datap -= __tinc1_itype * __tdims1 + __offsp[0]; \
104             isty_datap -= __tinc1_isty * __tdims1 + __offsp[1]; \
105             coord1_datap -= __tinc1_coord1 * __tdims1 + __offsp[2]; \
106             coord2_datap -= __tinc1_coord2 * __tdims1 + __offsp[3]; \
107             coord3_datap -= __tinc1_coord3 * __tdims1 + __offsp[4]; \
108             rev_datap -= __tinc1_rev * __tdims1 + __offsp[5]; \
109             )
110 25           register PDL_Indx __inc_coord1_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_coord1_n;
111 25           register PDL_Indx __inc_coord2_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_coord2_n;
112 25           register PDL_Indx __inc_coord3_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,4,0)]; (void)__inc_coord3_n;
113 25           register PDL_Indx __inc_isty_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_isty_n;
114 25           register PDL_Indx __inc_rev_nrev = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,5,0)]; (void)__inc_rev_nrev;
115             #ifndef PDL_DECLARE_PARAMS_plscmap1l_1
116             #define PDL_DECLARE_PARAMS_plscmap1l_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_itype,PDL_PPSYM_PARAM_itype,PDL_TYPE_PARAM_rev,PDL_PPSYM_PARAM_rev) \
117             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_itype, itype, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_itype) \
118             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, isty, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \
119             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, coord1, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP) \
120             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, coord2, (__privtrans->pdls[3]), 1, PDL_PPSYM_OP) \
121             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, coord3, (__privtrans->pdls[4]), 1, PDL_PPSYM_OP) \
122             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_rev, rev, (__privtrans->pdls[5]), 1, PDL_PPSYM_PARAM_rev)
123             #endif
124             #define PDL_IF_BAD(t,f) f
125 25 50         switch (__privtrans->__datatype) { /* Start generic switch */
126 25           case PDL_D: {
127 25 50         PDL_DECLARE_PARAMS_plscmap1l_1(PDL_Double,D,PDL_Long,L,PDL_Long,L)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    100          
    50          
128 100 50         PDL_BROADCASTLOOP_START_plscmap1l_readdata {
    50          
    50          
    50          
    50          
    100          
    100          
129             PLINT* rev;
130              
131 25 100         if (__privtrans->ind_sizes[1] == 0)
132 21           rev = NULL;
133 4 50         else if (__privtrans->ind_sizes[1] == __privtrans->ind_sizes[0])
134 4           rev = rev_datap;
135             else
136 0           return PDL->make_error(PDL_EUSERERROR, "Error in plscmap1l:" "plscmap1l: rev must have either length == 0 or have the same length of the other input arguments");
137              
138 25           c_plscmap1l ((itype_datap)[0], __privtrans->ind_sizes[0], isty_datap, coord1_datap,
139 25 50         coord2_datap, coord3_datap, rev);}PDL_BROADCASTLOOP_END_plscmap1l_readdata
    50          
140 25           } break;
141 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plscmap1l: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
142             }
143             #undef PDL_IF_BAD
144 25           return PDL_err;
145             }
146              
147             static pdl_datatypes pdl_plscmap1l_vtable_gentypes[] = { PDL_D, -1 };
148             static PDL_Indx pdl_plscmap1l_vtable_realdims[] = { 0, 1, 1, 1, 1, 1 };
149             static char *pdl_plscmap1l_vtable_parnames[] = { "itype","isty","coord1","coord2","coord3","rev" };
150             static short pdl_plscmap1l_vtable_parflags[] = {
151             PDL_PARAM_ISTYPED,
152             PDL_PARAM_ISPHYS,
153             PDL_PARAM_ISPHYS,
154             PDL_PARAM_ISPHYS,
155             PDL_PARAM_ISPHYS,
156             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED
157             };
158             static pdl_datatypes pdl_plscmap1l_vtable_partypes[] = { PDL_L, -1, -1, -1, -1, PDL_L };
159             static PDL_Indx pdl_plscmap1l_vtable_realdims_starts[] = { 0, 0, 1, 2, 3, 4 };
160             static PDL_Indx pdl_plscmap1l_vtable_realdims_ind_ids[] = { 0, 0, 0, 0, 1 };
161             static char *pdl_plscmap1l_vtable_indnames[] = { "n","nrev" };
162             pdl_transvtable pdl_plscmap1l_vtable = {
163             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plscmap1l_vtable_gentypes, 6, 6, NULL /*CORE21*/,
164             pdl_plscmap1l_vtable_realdims, pdl_plscmap1l_vtable_parnames,
165             pdl_plscmap1l_vtable_parflags, pdl_plscmap1l_vtable_partypes,
166             pdl_plscmap1l_vtable_realdims_starts, pdl_plscmap1l_vtable_realdims_ind_ids, 5,
167             2, pdl_plscmap1l_vtable_indnames,
168             NULL, pdl_plscmap1l_readdata, NULL,
169             NULL,
170             0,"PDL::Graphics::PLplot::plscmap1l"
171             };
172              
173              
174 25           pdl_error pdl_run_plscmap1l(pdl *itype,pdl *isty,pdl *coord1,pdl *coord2,pdl *coord3,pdl *rev) {
175 25           pdl_error PDL_err = {0, NULL, 0};
176 25 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
177 25           pdl_trans *__privtrans = PDL->create_trans(&pdl_plscmap1l_vtable);
178 25 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
179 25           __privtrans->pdls[0] = itype;
180 25           __privtrans->pdls[1] = isty;
181 25           __privtrans->pdls[2] = coord1;
182 25           __privtrans->pdls[3] = coord2;
183 25           __privtrans->pdls[4] = coord3;
184 25           __privtrans->pdls[5] = rev;
185 25 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
186 25 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
187 25           return PDL_err;
188             }