File Coverage

pp-plsmem.c
Criterion Covered Total %
statement 0 27 0.0
branch 0 48 0.0
condition n/a
subroutine n/a
pod n/a
total 0 75 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-plsmem.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_plsmem_readdata(pdl_trans *__privtrans) {
41             pdl_error PDL_err = {0, NULL, 0};
42             #line 43 "pp-plsmem.c"
43 0 0         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in plsmem:" "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_maxx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
50 0           register PDL_Indx __tinc0_maxy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
51 0           register PDL_Indx __tinc0_image = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
52 0           register PDL_Indx __tinc1_maxx = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
53 0           register PDL_Indx __tinc1_maxy = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
54 0           register PDL_Indx __tinc1_image = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
55             #define PDL_BROADCASTLOOP_START_plsmem_readdata PDL_BROADCASTLOOP_START( \
56             readdata, \
57             __privtrans->broadcast, \
58             __privtrans->vtable, \
59             maxx_datap += __offsp[0]; \
60             maxy_datap += __offsp[1]; \
61             image_datap += __offsp[2]; \
62             , \
63             ( ,maxx_datap += __tinc1_maxx - __tinc0_maxx * __tdims0 \
64             ,maxy_datap += __tinc1_maxy - __tinc0_maxy * __tdims0 \
65             ,image_datap += __tinc1_image - __tinc0_image * __tdims0 \
66             ), \
67             ( ,maxx_datap += __tinc0_maxx \
68             ,maxy_datap += __tinc0_maxy \
69             ,image_datap += __tinc0_image \
70             ) \
71             )
72             #define PDL_BROADCASTLOOP_END_plsmem_readdata PDL_BROADCASTLOOP_END( \
73             __privtrans->broadcast, \
74             maxx_datap -= __tinc1_maxx * __tdims1 + __offsp[0]; \
75             maxy_datap -= __tinc1_maxy * __tdims1 + __offsp[1]; \
76             image_datap -= __tinc1_image * __tdims1 + __offsp[2]; \
77             )
78 0           register PDL_Indx __inc_image_3 = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_image_3;register PDL_Indx __inc_image_x = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,1)]; (void)__inc_image_x;register PDL_Indx __inc_image_y = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,2)]; (void)__inc_image_y;
79             #ifndef PDL_DECLARE_PARAMS_plsmem_1
80             #define PDL_DECLARE_PARAMS_plsmem_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_maxx,PDL_PPSYM_PARAM_maxx,PDL_TYPE_PARAM_maxy,PDL_PPSYM_PARAM_maxy) \
81             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_maxx, maxx, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_maxx) \
82             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_maxy, maxy, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_maxy) \
83             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, image, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP)
84             #endif
85             #define PDL_IF_BAD(t,f) f
86 0 0         switch (__privtrans->__datatype) { /* Start generic switch */
87 0           case PDL_B: {
88 0 0         PDL_DECLARE_PARAMS_plsmem_1(PDL_Byte,B,PDL_Long,L,PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
89 0 0         PDL_BROADCASTLOOP_START_plsmem_readdata {c_plsmem((maxx_datap)[0],(maxy_datap)[0],image_datap);}PDL_BROADCASTLOOP_END_plsmem_readdata
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
90 0           } break;
91 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in plsmem: unhandled datatype(%d), only handles (B)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
92             }
93             #undef PDL_IF_BAD
94 0           return PDL_err;
95             }
96              
97             static pdl_datatypes pdl_plsmem_vtable_gentypes[] = { PDL_B, -1 };
98             static PDL_Indx pdl_plsmem_vtable_realdims[] = { 0, 0, 3 };
99             static char *pdl_plsmem_vtable_parnames[] = { "maxx","maxy","image" };
100             static short pdl_plsmem_vtable_parflags[] = {
101             PDL_PARAM_ISTYPED,
102             PDL_PARAM_ISTYPED,
103             PDL_PARAM_ISPHYS
104             };
105             static pdl_datatypes pdl_plsmem_vtable_partypes[] = { PDL_L, PDL_L, -1 };
106             static PDL_Indx pdl_plsmem_vtable_realdims_starts[] = { 0, 0, 0 };
107             static PDL_Indx pdl_plsmem_vtable_realdims_ind_ids[] = { 0, 1, 2 };
108             static char *pdl_plsmem_vtable_indnames[] = { "3","x","y" };
109             pdl_transvtable pdl_plsmem_vtable = {
110             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_plsmem_vtable_gentypes, 3, 3, NULL /*CORE21*/,
111             pdl_plsmem_vtable_realdims, pdl_plsmem_vtable_parnames,
112             pdl_plsmem_vtable_parflags, pdl_plsmem_vtable_partypes,
113             pdl_plsmem_vtable_realdims_starts, pdl_plsmem_vtable_realdims_ind_ids, 3,
114             3, pdl_plsmem_vtable_indnames,
115             NULL, pdl_plsmem_readdata, NULL,
116             NULL,
117             0,"PDL::Graphics::PLplot::plsmem"
118             };
119              
120              
121 0           pdl_error pdl_run_plsmem(pdl *maxx,pdl *maxy,pdl *image) {
122 0           pdl_error PDL_err = {0, NULL, 0};
123 0 0         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
124 0           pdl_trans *__privtrans = PDL->create_trans(&pdl_plsmem_vtable);
125 0 0         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
126 0           __privtrans->pdls[0] = maxx;
127 0           __privtrans->pdls[1] = maxy;
128 0           __privtrans->pdls[2] = image;
129 0 0         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
130 0 0         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
131 0           return PDL_err;
132             }