File Coverage

pp-plgdidev.c
Criterion Covered Total %
statement 28 29 96.5
branch 29 54 53.7
condition n/a
subroutine n/a
pod n/a
total 57 83 68.6


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-plgdidev.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_plgdidev_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plgdidev.c"
43 1 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plgdidev:" "broadcast.incs NULL");
44             /* broadcastloop declarations */
45             int __brcloopval;
46             register PDL_Indx __tind0,__tind1; /* counters along dim */
47 1           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
48             /* dims here are how many steps along those dims */
49 1           register PDL_Indx __tinc0_p_mar = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 1           register PDL_Indx __tinc0_p_aspect = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 1           register PDL_Indx __tinc0_p_jx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 1           register PDL_Indx __tinc0_p_jy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0);
53 1           register PDL_Indx __tinc1_p_mar = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
54 1           register PDL_Indx __tinc1_p_aspect = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
55 1           register PDL_Indx __tinc1_p_jx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
56 1           register PDL_Indx __tinc1_p_jy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1);
57             #define PDL_BROADCASTLOOP_START_plgdidev_readdata PDL_BROADCASTLOOP_START( \
58             readdata, \
59             __privtrans->broadcast, \
60             __privtrans->vtable, \
61             p_mar_datap += __offsp[0]; \
62             p_aspect_datap += __offsp[1]; \
63             p_jx_datap += __offsp[2]; \
64             p_jy_datap += __offsp[3]; \
65             , \
66             ( ,p_mar_datap += __tinc1_p_mar - __tinc0_p_mar * __tdims0 \
67             ,p_aspect_datap += __tinc1_p_aspect - __tinc0_p_aspect * __tdims0 \
68             ,p_jx_datap += __tinc1_p_jx - __tinc0_p_jx * __tdims0 \
69             ,p_jy_datap += __tinc1_p_jy - __tinc0_p_jy * __tdims0 \
70             ), \
71             ( ,p_mar_datap += __tinc0_p_mar \
72             ,p_aspect_datap += __tinc0_p_aspect \
73             ,p_jx_datap += __tinc0_p_jx \
74             ,p_jy_datap += __tinc0_p_jy \
75             ) \
76             )
77             #define PDL_BROADCASTLOOP_END_plgdidev_readdata PDL_BROADCASTLOOP_END( \
78             __privtrans->broadcast, \
79             p_mar_datap -= __tinc1_p_mar * __tdims1 + __offsp[0]; \
80             p_aspect_datap -= __tinc1_p_aspect * __tdims1 + __offsp[1]; \
81             p_jx_datap -= __tinc1_p_jx * __tdims1 + __offsp[2]; \
82             p_jy_datap -= __tinc1_p_jy * __tdims1 + __offsp[3]; \
83             )
84             #ifndef PDL_DECLARE_PARAMS_plgdidev_1
85             #define PDL_DECLARE_PARAMS_plgdidev_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_p_mar,PDL_PPSYM_PARAM_p_mar,PDL_TYPE_PARAM_p_aspect,PDL_PPSYM_PARAM_p_aspect,PDL_TYPE_PARAM_p_jx,PDL_PPSYM_PARAM_p_jx,PDL_TYPE_PARAM_p_jy,PDL_PPSYM_PARAM_p_jy) \
86             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_p_mar, p_mar, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_p_mar) \
87             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_p_aspect, p_aspect, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_p_aspect) \
88             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_p_jx, p_jx, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_p_jx) \
89             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_p_jy, p_jy, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_p_jy)
90             #endif
91             #define PDL_IF_BAD(t,f) f
92 1 50         switch (__privtrans->__datatype) { /* Start generic switch */
93 1           case PDL_D: {
94 1 50         PDL_DECLARE_PARAMS_plgdidev_1(PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D,PDL_Double,D)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
95 4 50         PDL_BROADCASTLOOP_START_plgdidev_readdata {c_plgdidev(p_mar_datap,p_aspect_datap,p_jx_datap,p_jy_datap);}PDL_BROADCASTLOOP_END_plgdidev_readdata
    50          
    50          
    50          
    50          
    100          
    100          
    50          
    50          
96 1           } break;
97 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plgdidev: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
98             }
99             #undef PDL_IF_BAD
100 1           return PDL_err;
101             }
102              
103             static pdl_datatypes pdl_plgdidev_vtable_gentypes[] = { PDL_D, -1 };
104             static PDL_Indx pdl_plgdidev_vtable_realdims[] = { 0, 0, 0, 0 };
105             static char *pdl_plgdidev_vtable_parnames[] = { "p_mar","p_aspect","p_jx","p_jy" };
106             static short pdl_plgdidev_vtable_parflags[] = {
107             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
108             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
109             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
110             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE
111             };
112             static pdl_datatypes pdl_plgdidev_vtable_partypes[] = { PDL_D, PDL_D, PDL_D, PDL_D };
113             static PDL_Indx pdl_plgdidev_vtable_realdims_starts[] = { 0, 0, 0, 0 };
114             static PDL_Indx pdl_plgdidev_vtable_realdims_ind_ids[] = { 0 };
115             static char *pdl_plgdidev_vtable_indnames[] = { "" };
116             pdl_transvtable pdl_plgdidev_vtable = {
117             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plgdidev_vtable_gentypes, 0, 4, NULL /*CORE21*/,
118             pdl_plgdidev_vtable_realdims, pdl_plgdidev_vtable_parnames,
119             pdl_plgdidev_vtable_parflags, pdl_plgdidev_vtable_partypes,
120             pdl_plgdidev_vtable_realdims_starts, pdl_plgdidev_vtable_realdims_ind_ids, 0,
121             0, pdl_plgdidev_vtable_indnames,
122             NULL, pdl_plgdidev_readdata, NULL,
123             NULL,
124             0,"PDL::Graphics::PLplot::plgdidev"
125             };
126              
127              
128 1           pdl_error pdl_run_plgdidev(pdl *p_mar,pdl *p_aspect,pdl *p_jx,pdl *p_jy) {
129 1           pdl_error PDL_err = {0, NULL, 0};
130 1 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
131 1           pdl_trans *__privtrans = PDL->create_trans(&pdl_plgdidev_vtable);
132 1 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
133 1           __privtrans->pdls[0] = p_mar;
134 1           __privtrans->pdls[1] = p_aspect;
135 1           __privtrans->pdls[2] = p_jx;
136 1           __privtrans->pdls[3] = p_jy;
137 1 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
138 1 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
139 1           return PDL_err;
140             }