File Coverage

pp-plbin.c
Criterion Covered Total %
statement 0 31 0.0
branch 0 54 0.0
condition n/a
subroutine n/a
pod n/a
total 0 85 0.0


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-plbin.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_plbin_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plbin.c"
43 0 0         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plbin:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 0           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 0           register PDL_Indx __tinc0_nbin = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 0           register PDL_Indx __tinc0_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 0           register PDL_Indx __tinc0_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 0           register PDL_Indx __tinc0_center = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 0           register PDL_Indx __tinc1_nbin = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
54 0           register PDL_Indx __tinc1_x = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
55 0           register PDL_Indx __tinc1_y = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
56 0           register PDL_Indx __tinc1_center = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
57             #define PDL_BROADCASTLOOP_START_plbin_readdata PDL_BROADCASTLOOP_START( \
58             readdata, \
59             __privtrans->broadcast, \
60             __privtrans->vtable, \
61             nbin_datap += __offsp[0]; \
62             x_datap += __offsp[1]; \
63             y_datap += __offsp[2]; \
64             center_datap += __offsp[3]; \
65             , \
66             ( ,nbin_datap += __tinc1_nbin - __tinc0_nbin * __tdims0 \
67             ,x_datap += __tinc1_x - __tinc0_x * __tdims0 \
68             ,y_datap += __tinc1_y - __tinc0_y * __tdims0 \
69             ,center_datap += __tinc1_center - __tinc0_center * __tdims0 \
70             ), \
71             ( ,nbin_datap += __tinc0_nbin \
72             ,x_datap += __tinc0_x \
73             ,y_datap += __tinc0_y \
74             ,center_datap += __tinc0_center \
75             ) \
76             )
77             #define PDL_BROADCASTLOOP_END_plbin_readdata PDL_BROADCASTLOOP_END( \
78             __privtrans->broadcast, \
79             nbin_datap -= __tinc1_nbin * __tdims1 + __offsp[0]; \
80             x_datap -= __tinc1_x * __tdims1 + __offsp[1]; \
81             y_datap -= __tinc1_y * __tdims1 + __offsp[2]; \
82             center_datap -= __tinc1_center * __tdims1 + __offsp[3]; \
83             )
84 0           register PDL_Indx __inc_x_dima = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_x_dima;
85 0           register PDL_Indx __inc_y_dima = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_y_dima;
86             #ifndef PDL_DECLARE_PARAMS_plbin_1
87             #define PDL_DECLARE_PARAMS_plbin_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_nbin,PDL_PPSYM_PARAM_nbin,PDL_TYPE_PARAM_x,PDL_PPSYM_PARAM_x,PDL_TYPE_PARAM_y,PDL_PPSYM_PARAM_y,PDL_TYPE_PARAM_center,PDL_PPSYM_PARAM_center) \
88             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_nbin, nbin, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_nbin) \
89             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_x, x, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_x) \
90             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_y, y, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_y) \
91             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_center, center, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_center)
92             #endif
93             #define PDL_IF_BAD(t,f) f
94 0 0         switch (__privtrans->__datatype) { /* Start generic switch */
95 0           case PDL_D: {
96 0 0         PDL_DECLARE_PARAMS_plbin_1(PDL_Double,D,PDL_Long,L,PDL_Double,D,PDL_Double,D,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
97 0 0         PDL_BROADCASTLOOP_START_plbin_readdata {c_plbin((nbin_datap)[0],x_datap,y_datap,(center_datap)[0]);}PDL_BROADCASTLOOP_END_plbin_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
98 0           } break;
99 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plbin: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
100             }
101             #undef PDL_IF_BAD
102 0           return PDL_err;
103             }
104              
105             static pdl_datatypes pdl_plbin_vtable_gentypes[] = { PDL_D, -1 };
106             static PDL_Indx pdl_plbin_vtable_realdims[] = { 0, 1, 1, 0 };
107             static char *pdl_plbin_vtable_parnames[] = { "nbin","x","y","center" };
108             static short pdl_plbin_vtable_parflags[] = {
109             PDL_PARAM_ISTYPED,
110             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED,
111             PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED,
112             PDL_PARAM_ISTYPED
113             };
114             static pdl_datatypes pdl_plbin_vtable_partypes[] = { PDL_L, PDL_D, PDL_D, PDL_L };
115             static PDL_Indx pdl_plbin_vtable_realdims_starts[] = { 0, 0, 1, 2 };
116             static PDL_Indx pdl_plbin_vtable_realdims_ind_ids[] = { 0, 0 };
117             static char *pdl_plbin_vtable_indnames[] = { "dima" };
118             pdl_transvtable pdl_plbin_vtable = {
119             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plbin_vtable_gentypes, 4, 4, NULL /*CORE21*/,
120             pdl_plbin_vtable_realdims, pdl_plbin_vtable_parnames,
121             pdl_plbin_vtable_parflags, pdl_plbin_vtable_partypes,
122             pdl_plbin_vtable_realdims_starts, pdl_plbin_vtable_realdims_ind_ids, 2,
123             1, pdl_plbin_vtable_indnames,
124             NULL, pdl_plbin_readdata, NULL,
125             NULL,
126             0,"PDL::Graphics::PLplot::plbin"
127             };
128              
129              
130 0           pdl_error pdl_run_plbin(pdl *nbin,pdl *x,pdl *y,pdl *center) {
131 0           pdl_error PDL_err = {0, NULL, 0};
132 0 0         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
133 0           pdl_trans *__privtrans = PDL->create_trans(&pdl_plbin_vtable);
134 0 0         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
135 0           __privtrans->pdls[0] = nbin;
136 0           __privtrans->pdls[1] = x;
137 0           __privtrans->pdls[2] = y;
138 0           __privtrans->pdls[3] = center;
139 0 0         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
140 0 0         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
141 0           return PDL_err;
142             }