File Coverage

pp-plcalc_world.c
Criterion Covered Total %
statement 31 76 40.7
branch 31 586 5.2
condition n/a
subroutine n/a
pod n/a
total 62 662 9.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-plcalc_world.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_plcalc_world_readdata(pdl_trans *__privtrans) {
55             pdl_error PDL_err = {0, NULL, 0};
56             #line 57 "pp-plcalc_world.c"
57 1 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plcalc_world:" "broadcast.incs NULL");
58             /* broadcastloop declarations */
59             int __brcloopval;
60             register PDL_Indx __tind0,__tind1; /* counters along dim */
61 1           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
62             /* dims here are how many steps along those dims */
63 1           register PDL_Indx __tinc0_rx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
64 1           register PDL_Indx __tinc0_ry = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
65 1           register PDL_Indx __tinc0_wx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
66 1           register PDL_Indx __tinc0_wy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
67 1           register PDL_Indx __tinc0_window = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0);
68 1           register PDL_Indx __tinc1_rx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
69 1           register PDL_Indx __tinc1_ry = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
70 1           register PDL_Indx __tinc1_wx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
71 1           register PDL_Indx __tinc1_wy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
72 1           register PDL_Indx __tinc1_window = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1);
73             #define PDL_BROADCASTLOOP_START_plcalc_world_readdata PDL_BROADCASTLOOP_START( \
74             readdata, \
75             __privtrans->broadcast, \
76             __privtrans->vtable, \
77             rx_datap += __offsp[0]; \
78             ry_datap += __offsp[1]; \
79             wx_datap += __offsp[2]; \
80             wy_datap += __offsp[3]; \
81             window_datap += __offsp[4]; \
82             , \
83             ( ,rx_datap += __tinc1_rx - __tinc0_rx * __tdims0 \
84             ,ry_datap += __tinc1_ry - __tinc0_ry * __tdims0 \
85             ,wx_datap += __tinc1_wx - __tinc0_wx * __tdims0 \
86             ,wy_datap += __tinc1_wy - __tinc0_wy * __tdims0 \
87             ,window_datap += __tinc1_window - __tinc0_window * __tdims0 \
88             ), \
89             ( ,rx_datap += __tinc0_rx \
90             ,ry_datap += __tinc0_ry \
91             ,wx_datap += __tinc0_wx \
92             ,wy_datap += __tinc0_wy \
93             ,window_datap += __tinc0_window \
94             ) \
95             )
96             #define PDL_BROADCASTLOOP_END_plcalc_world_readdata PDL_BROADCASTLOOP_END( \
97             __privtrans->broadcast, \
98             rx_datap -= __tinc1_rx * __tdims1 + __offsp[0]; \
99             ry_datap -= __tinc1_ry * __tdims1 + __offsp[1]; \
100             wx_datap -= __tinc1_wx * __tdims1 + __offsp[2]; \
101             wy_datap -= __tinc1_wy * __tdims1 + __offsp[3]; \
102             window_datap -= __tinc1_window * __tdims1 + __offsp[4]; \
103             )
104             #ifndef PDL_DECLARE_PARAMS_plcalc_world_1
105             #define PDL_DECLARE_PARAMS_plcalc_world_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_rx,PDL_PPSYM_PARAM_rx,PDL_TYPE_PARAM_ry,PDL_PPSYM_PARAM_ry,PDL_TYPE_PARAM_wx,PDL_PPSYM_PARAM_wx,PDL_TYPE_PARAM_wy,PDL_PPSYM_PARAM_wy,PDL_TYPE_PARAM_window,PDL_PPSYM_PARAM_window) \
106             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_rx, rx, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_rx) \
107             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_ry, ry, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_ry) \
108             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_wx, wx, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_wx) \
109             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_wy, wy, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_wy) \
110             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_window, window, (__privtrans->pdls[4]), 1, PDL_PPSYM_PARAM_window)
111             #endif
112             #define PDL_IF_BAD(t,f) f
113 1           switch (__privtrans->__datatype) { /* Start generic switch */
114 0           case PDL_SB: {
115 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_SByte,A,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
116 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
117 0           } break;
118 0           case PDL_B: {
119 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Byte,B,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
120 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
121 0           } break;
122 0           case PDL_S: {
123 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Short,S,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
124 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
125 0           } break;
126 0           case PDL_US: {
127 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Ushort,U,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
128 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
129 0           } break;
130 0           case PDL_L: {
131 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Long,L,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
132 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
133 0           } break;
134 0           case PDL_UL: {
135 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_ULong,K,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
136 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
137 0           } break;
138 0           case PDL_IND: {
139 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Indx,N,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
140 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
141 0           } break;
142 0           case PDL_ULL: {
143 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_ULongLong,P,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
144 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
145 0           } break;
146 0           case PDL_LL: {
147 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_LongLong,Q,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
148 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
149 0           } break;
150 0           case PDL_F: {
151 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Float,F,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
152 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
153 0           } break;
154 0           case PDL_D: {
155 0 0         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
156 0 0         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
157 0           } break;
158 1           case PDL_LD: {
159 1 50         PDL_DECLARE_PARAMS_plcalc_world_1(PDL_LDouble,E,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
160 4 50         PDL_BROADCASTLOOP_START_plcalc_world_readdata {c_plcalc_world((rx_datap)[0], (ry_datap)[0], wx_datap, wy_datap, window_datap);}PDL_BROADCASTLOOP_END_plcalc_world_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
161 1           } break;
162 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plcalc_world: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
163             }
164             #undef PDL_IF_BAD
165 1           return PDL_err;
166             }
167              
168             static pdl_datatypes pdl_plcalc_world_vtable_gentypes[] = { PDL_SB, PDL_B, PDL_S, PDL_US, PDL_L, PDL_UL, PDL_IND, PDL_ULL, PDL_LL, PDL_F, PDL_D, PDL_LD, -1 };
169             static PDL_Indx pdl_plcalc_world_vtable_realdims[] = { 0, 0, 0, 0, 0 };
170             static char *pdl_plcalc_world_vtable_parnames[] = { "rx","ry","wx","wy","window" };
171             static short pdl_plcalc_world_vtable_parflags[] = {
172             PDL_PARAM_ISTYPED,
173             PDL_PARAM_ISTYPED,
174             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
175             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
176             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE
177             };
178             static pdl_datatypes pdl_plcalc_world_vtable_partypes[] = { PDL_D, PDL_D, PDL_D, PDL_D, PDL_L };
179             static PDL_Indx pdl_plcalc_world_vtable_realdims_starts[] = { 0, 0, 0, 0, 0 };
180             static PDL_Indx pdl_plcalc_world_vtable_realdims_ind_ids[] = { 0 };
181             static char *pdl_plcalc_world_vtable_indnames[] = { "" };
182             pdl_transvtable pdl_plcalc_world_vtable = {
183             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plcalc_world_vtable_gentypes, 2, 5, NULL /*CORE21*/,
184             pdl_plcalc_world_vtable_realdims, pdl_plcalc_world_vtable_parnames,
185             pdl_plcalc_world_vtable_parflags, pdl_plcalc_world_vtable_partypes,
186             pdl_plcalc_world_vtable_realdims_starts, pdl_plcalc_world_vtable_realdims_ind_ids, 0,
187             0, pdl_plcalc_world_vtable_indnames,
188             NULL, pdl_plcalc_world_readdata, NULL,
189             NULL,
190             0,"PDL::Graphics::PLplot::plcalc_world"
191             };
192              
193              
194 1           pdl_error pdl_run_plcalc_world(pdl *rx,pdl *ry,pdl *wx,pdl *wy,pdl *window) {
195 1           pdl_error PDL_err = {0, NULL, 0};
196 1 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
197 1           pdl_trans *__privtrans = PDL->create_trans(&pdl_plcalc_world_vtable);
198 1 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
199 1           __privtrans->pdls[0] = rx;
200 1           __privtrans->pdls[1] = ry;
201 1           __privtrans->pdls[2] = wx;
202 1           __privtrans->pdls[3] = wy;
203 1           __privtrans->pdls[4] = window;
204 1 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
205 1 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
206 1           return PDL_err;
207             }