File Coverage

pp-init_pltr.c
Criterion Covered Total %
statement 27 28 96.4
branch 18 32 56.2
condition n/a
subroutine n/a
pod n/a
total 45 60 75.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-init_pltr.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 1846 "lib/PDL/PP.pm"
54             typedef struct pdl_params_init_pltr {
55             #line 56 "pp-init_pltr.c"
56             SV *p0;
57             SV *p1;
58             SV *p2;
59             } pdl_params_init_pltr;
60              
61              
62             #line 1857 "lib/PDL/PP.pm"
63             pdl_error pdl_init_pltr_readdata(pdl_trans *__privtrans) {
64             pdl_error PDL_err = {0, NULL, 0};
65             #line 66 "pp-init_pltr.c"
66 32           pdl_params_init_pltr *__params = __privtrans->params; (void)__params;
67 32 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in init_pltr:" "broadcast.incs NULL");
68             /* broadcastloop declarations */
69             int __brcloopval;
70             register PDL_Indx __tind0,__tind1; /* counters along dim */
71 32           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
72             /* dims here are how many steps along those dims */
73             #define PDL_BROADCASTLOOP_START_init_pltr_readdata PDL_BROADCASTLOOP_START( \
74             readdata, \
75             __privtrans->broadcast, \
76             __privtrans->vtable, \
77             , \
78             ( ), \
79             ( ) \
80             )
81             #define PDL_BROADCASTLOOP_END_init_pltr_readdata PDL_BROADCASTLOOP_END( \
82             __privtrans->broadcast, \
83             )
84             #ifndef PDL_DECLARE_PARAMS_init_pltr_1
85             #define PDL_DECLARE_PARAMS_init_pltr_1(PDL_TYPE_OP,PDL_PPSYM_OP) \
86            
87             #endif
88             #define PDL_IF_BAD(t,f) f
89 32 50         switch (__privtrans->__datatype) { /* Start generic switch */
90 32           case PDL_D: {
91             PDL_DECLARE_PARAMS_init_pltr_1(PDL_Double,D)
92 128 50         PDL_BROADCASTLOOP_START_init_pltr_readdata {
    50          
    50          
    50          
    50          
    100          
    100          
93 32           pltr_iv_set(
94 32           (IV) SvRV (__params->p0),
95 32           (IV) SvRV (__params->p1),
96 64 50         (IV) SvRV (__params->p2));}PDL_BROADCASTLOOP_END_init_pltr_readdata
    50          
97 32           } break;
98 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in init_pltr: unhandled datatype(%d), only handles (D)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
99             }
100             #undef PDL_IF_BAD
101 32           return PDL_err;
102             }
103              
104              
105             #line 1857 "lib/PDL/PP.pm"
106             pdl_error pdl_init_pltr_free(pdl_trans *__privtrans, char destroy) {
107             pdl_error PDL_err = {0, NULL, 0};
108             #line 109 "pp-init_pltr.c"
109 32           pdl_params_init_pltr *__params = __privtrans->params; (void)__params;
110 32 50         PDL_FREE_CODE(__privtrans, destroy, SvREFCNT_dec(__params->p0); /* CType.get_free */
111             SvREFCNT_dec(__params->p1); /* CType.get_free */
112             SvREFCNT_dec(__params->p2); /* CType.get_free */
113 32           , ) return PDL_err;
114             }
115              
116             static pdl_datatypes pdl_init_pltr_vtable_gentypes[] = { PDL_D, -1 };
117             static PDL_Indx pdl_init_pltr_vtable_realdims[] = { 0 };
118             static char *pdl_init_pltr_vtable_parnames[] = { "" };
119             static short pdl_init_pltr_vtable_parflags[] = {
120             0
121             };
122             static pdl_datatypes pdl_init_pltr_vtable_partypes[] = { -1 };
123             static PDL_Indx pdl_init_pltr_vtable_realdims_starts[] = { 0 };
124             static PDL_Indx pdl_init_pltr_vtable_realdims_ind_ids[] = { 0 };
125             static char *pdl_init_pltr_vtable_indnames[] = { "" };
126             pdl_transvtable pdl_init_pltr_vtable = {
127             PDL_TRANS_DO_BROADCAST|PDL_TRANS_NO_PARALLEL, 0, pdl_init_pltr_vtable_gentypes, 0, 0, NULL /*CORE21*/,
128             pdl_init_pltr_vtable_realdims, pdl_init_pltr_vtable_parnames,
129             pdl_init_pltr_vtable_parflags, pdl_init_pltr_vtable_partypes,
130             pdl_init_pltr_vtable_realdims_starts, pdl_init_pltr_vtable_realdims_ind_ids, 0,
131             0, pdl_init_pltr_vtable_indnames,
132             NULL, pdl_init_pltr_readdata, NULL,
133             pdl_init_pltr_free,
134             sizeof(pdl_params_init_pltr),"PDL::Graphics::PLplot::init_pltr"
135             };
136              
137              
138 32           pdl_error pdl_run_init_pltr(SV *p0,SV *p1,SV *p2) {
139 32           pdl_error PDL_err = {0, NULL, 0};
140 32 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
141 32           pdl_trans *__privtrans = PDL->create_trans(&pdl_init_pltr_vtable);
142 32 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
143 32           pdl_params_init_pltr *__params = __privtrans->params;
144 32 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
145 32           (__params->p0) = newSVsv(p0); /* CType.get_copy */
146 32           (__params->p1) = newSVsv(p1); /* CType.get_copy */
147 32           (__params->p2) = newSVsv(p2); /* CType.get_copy */
148 32 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
149 32           return PDL_err;
150             }