File Coverage

pp-plunfbox1.c
Criterion Covered Total %
statement 0 38 0.0
branch 0 54 0.0
condition n/a
subroutine n/a
pod n/a
total 0 92 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-plunfbox1.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_plunfbox1_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plunfbox1.c"
43 0 0         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plunfbox1:" "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_xo = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 0           register PDL_Indx __tinc0_yo = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 0           register PDL_Indx __tinc0_bh = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 0           register PDL_Indx __tinc0_w = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 0           register PDL_Indx __tinc1_xo = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
54 0           register PDL_Indx __tinc1_yo = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
55 0           register PDL_Indx __tinc1_bh = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
56 0           register PDL_Indx __tinc1_w = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
57             #define PDL_BROADCASTLOOP_START_plunfbox1_readdata PDL_BROADCASTLOOP_START( \
58             readdata, \
59             __privtrans->broadcast, \
60             __privtrans->vtable, \
61             xo_datap += __offsp[0]; \
62             yo_datap += __offsp[1]; \
63             bh_datap += __offsp[2]; \
64             w_datap += __offsp[3]; \
65             , \
66             ( ,xo_datap += __tinc1_xo - __tinc0_xo * __tdims0 \
67             ,yo_datap += __tinc1_yo - __tinc0_yo * __tdims0 \
68             ,bh_datap += __tinc1_bh - __tinc0_bh * __tdims0 \
69             ,w_datap += __tinc1_w - __tinc0_w * __tdims0 \
70             ), \
71             ( ,xo_datap += __tinc0_xo \
72             ,yo_datap += __tinc0_yo \
73             ,bh_datap += __tinc0_bh \
74             ,w_datap += __tinc0_w \
75             ) \
76             )
77             #define PDL_BROADCASTLOOP_END_plunfbox1_readdata PDL_BROADCASTLOOP_END( \
78             __privtrans->broadcast, \
79             xo_datap -= __tinc1_xo * __tdims1 + __offsp[0]; \
80             yo_datap -= __tinc1_yo * __tdims1 + __offsp[1]; \
81             bh_datap -= __tinc1_bh * __tdims1 + __offsp[2]; \
82             w_datap -= __tinc1_w * __tdims1 + __offsp[3]; \
83             )
84             #ifndef PDL_DECLARE_PARAMS_plunfbox1_1
85             #define PDL_DECLARE_PARAMS_plunfbox1_1(PDL_TYPE_OP,PDL_PPSYM_OP) \
86             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, xo, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \
87             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, yo, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \
88             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, bh, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP) \
89             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, w, (__privtrans->pdls[3]), 1, PDL_PPSYM_OP)
90             #endif
91             #define PDL_IF_BAD(t,f) f
92 0 0         switch (__privtrans->__datatype) { /* Start generic switch */
93 0           case PDL_D: {
94 0 0         PDL_DECLARE_PARAMS_plunfbox1_1(PDL_Double,D)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
95 0 0         PDL_BROADCASTLOOP_START_plunfbox1_readdata {PLFLT x[4], y[4];
    0          
    0          
    0          
    0          
    0          
    0          
96 0           x[0] = (xo_datap)[0] - ( 0.5 * (w_datap)[0] );
97 0           y[0] = (bh_datap)[0];
98 0           x[1] = (xo_datap)[0] - ( 0.5 * (w_datap)[0] );
99 0           y[1] = (bh_datap)[0] + (yo_datap)[0];
100 0           x[2] = (xo_datap)[0] + ( 0.5 * (w_datap)[0] );
101 0           y[2] = (bh_datap)[0] + (yo_datap)[0];
102 0           x[3] = (xo_datap)[0] + ( 0.5 * (w_datap)[0] );
103 0           y[3] = (bh_datap)[0];
104 0 0         plline(4, x, y);}PDL_BROADCASTLOOP_END_plunfbox1_readdata
    0          
105 0           } break;
106 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plunfbox1: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
107             }
108             #undef PDL_IF_BAD
109 0           return PDL_err;
110             }
111              
112             static pdl_datatypes pdl_plunfbox1_vtable_gentypes[] = { PDL_D, -1 };
113             static PDL_Indx pdl_plunfbox1_vtable_realdims[] = { 0, 0, 0, 0 };
114             static char *pdl_plunfbox1_vtable_parnames[] = { "xo","yo","bh","w" };
115             static short pdl_plunfbox1_vtable_parflags[] = {
116             0,
117             0,
118             0,
119             0
120             };
121             static pdl_datatypes pdl_plunfbox1_vtable_partypes[] = { -1, -1, -1, -1 };
122             static PDL_Indx pdl_plunfbox1_vtable_realdims_starts[] = { 0, 0, 0, 0 };
123             static PDL_Indx pdl_plunfbox1_vtable_realdims_ind_ids[] = { 0 };
124             static char *pdl_plunfbox1_vtable_indnames[] = { "" };
125             pdl_transvtable pdl_plunfbox1_vtable = {
126             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plunfbox1_vtable_gentypes, 4, 4, NULL /*CORE21*/,
127             pdl_plunfbox1_vtable_realdims, pdl_plunfbox1_vtable_parnames,
128             pdl_plunfbox1_vtable_parflags, pdl_plunfbox1_vtable_partypes,
129             pdl_plunfbox1_vtable_realdims_starts, pdl_plunfbox1_vtable_realdims_ind_ids, 0,
130             0, pdl_plunfbox1_vtable_indnames,
131             NULL, pdl_plunfbox1_readdata, NULL,
132             NULL,
133             0,"PDL::Graphics::PLplot::plunfbox1"
134             };
135              
136              
137 0           pdl_error pdl_run_plunfbox1(pdl *xo,pdl *yo,pdl *bh,pdl *w) {
138 0           pdl_error PDL_err = {0, NULL, 0};
139 0 0         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
140 0           pdl_trans *__privtrans = PDL->create_trans(&pdl_plunfbox1_vtable);
141 0 0         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
142 0           __privtrans->pdls[0] = xo;
143 0           __privtrans->pdls[1] = yo;
144 0           __privtrans->pdls[2] = bh;
145 0           __privtrans->pdls[3] = w;
146 0 0         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
147 0 0         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
148 0           return PDL_err;
149             }