File Coverage

IMB.c
Criterion Covered Total %
statement 19 20 95.0
branch 4 8 50.0
condition n/a
subroutine n/a
pod n/a
total 23 28 82.1


line stmt bran cond sub pod time code
1             /*
2             * This file was generated automatically by ExtUtils::ParseXS version 3.57 from the
3             * contents of IMB.xs. Do not edit this file, edit IMB.xs instead.
4             *
5             * ANY CHANGES MADE HERE WILL BE LOST!
6             *
7             */
8              
9             #line 1 "IMB.xs"
10             #include "EXTERN.h"
11             #include "perl.h"
12             #include "XSUB.h"
13              
14             #include "ppport.h"
15              
16             #include <./libs/usps4cb.h>
17              
18             #line 19 "IMB.c"
19             #ifndef PERL_UNUSED_VAR
20             # define PERL_UNUSED_VAR(var) if (0) var = var
21             #endif
22              
23             #ifndef dVAR
24             # define dVAR dNOOP
25             #endif
26              
27              
28             /* This stuff is not part of the API! You have been warned. */
29             #ifndef PERL_VERSION_DECIMAL
30             # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
31             #endif
32             #ifndef PERL_DECIMAL_VERSION
33             # define PERL_DECIMAL_VERSION \
34             PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
35             #endif
36             #ifndef PERL_VERSION_GE
37             # define PERL_VERSION_GE(r,v,s) \
38             (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
39             #endif
40             #ifndef PERL_VERSION_LE
41             # define PERL_VERSION_LE(r,v,s) \
42             (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
43             #endif
44              
45             /* XS_INTERNAL is the explicit static-linkage variant of the default
46             * XS macro.
47             *
48             * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
49             * "STATIC", ie. it exports XSUB symbols. You probably don't want that
50             * for anything but the BOOT XSUB.
51             *
52             * See XSUB.h in core!
53             */
54              
55              
56             /* TODO: This might be compatible further back than 5.10.0. */
57             #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
58             # undef XS_EXTERNAL
59             # undef XS_INTERNAL
60             # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
61             # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
62             # define XS_INTERNAL(name) STATIC XSPROTO(name)
63             # endif
64             # if defined(__SYMBIAN32__)
65             # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
66             # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
67             # endif
68             # ifndef XS_EXTERNAL
69             # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
70             # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
71             # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
72             # else
73             # ifdef __cplusplus
74             # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
75             # define XS_INTERNAL(name) static XSPROTO(name)
76             # else
77             # define XS_EXTERNAL(name) XSPROTO(name)
78             # define XS_INTERNAL(name) STATIC XSPROTO(name)
79             # endif
80             # endif
81             # endif
82             #endif
83              
84             /* perl >= 5.10.0 && perl <= 5.15.1 */
85              
86              
87             /* The XS_EXTERNAL macro is used for functions that must not be static
88             * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
89             * macro defined, the best we can do is assume XS is the same.
90             * Dito for XS_INTERNAL.
91             */
92             #ifndef XS_EXTERNAL
93             # define XS_EXTERNAL(name) XS(name)
94             #endif
95             #ifndef XS_INTERNAL
96             # define XS_INTERNAL(name) XS(name)
97             #endif
98              
99             /* Now, finally, after all this mess, we want an ExtUtils::ParseXS
100             * internal macro that we're free to redefine for varying linkage due
101             * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
102             * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
103             */
104              
105             #undef XS_EUPXS
106             #if defined(PERL_EUPXS_ALWAYS_EXPORT)
107             # define XS_EUPXS(name) XS_EXTERNAL(name)
108             #else
109             /* default to internal */
110             # define XS_EUPXS(name) XS_INTERNAL(name)
111             #endif
112              
113             #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
114             #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
115              
116             /* prototype to pass -Wmissing-prototypes */
117             STATIC void
118             S_croak_xs_usage(const CV *const cv, const char *const params);
119              
120             STATIC void
121             S_croak_xs_usage(const CV *const cv, const char *const params)
122             {
123             const GV *const gv = CvGV(cv);
124              
125             PERL_ARGS_ASSERT_CROAK_XS_USAGE;
126              
127             if (gv) {
128             const char *const gvname = GvNAME(gv);
129             const HV *const stash = GvSTASH(gv);
130             const char *const hvname = stash ? HvNAME(stash) : NULL;
131              
132             if (hvname)
133             Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
134             else
135             Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
136             } else {
137             /* Pants. I don't think that it should be possible to get here. */
138             Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
139             }
140             }
141             #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
142              
143             #define croak_xs_usage S_croak_xs_usage
144              
145             #endif
146              
147             /* NOTE: the prototype of newXSproto() is different in versions of perls,
148             * so we define a portable version of newXSproto()
149             */
150             #ifdef newXS_flags
151             #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
152             #else
153             #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
154             #endif /* !defined(newXS_flags) */
155              
156             #if PERL_VERSION_LE(5, 21, 5)
157             # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
158             #else
159             # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
160             #endif
161              
162             /* simple backcompat versions of the TARGx() macros with no optimisation */
163             #ifndef TARGi
164             # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
165             # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
166             # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
167             #endif
168              
169             #line 170 "IMB.c"
170              
171             XS_EUPXS(XS_Business__US__USPS__IMB_usps4cb); /* prototype to pass -Wmissing-prototypes */
172 2           XS_EUPXS(XS_Business__US__USPS__IMB_usps4cb)
173             {
174 2           dVAR; dXSARGS;
175 2 50         if (items != 3)
176 0           croak_xs_usage(cv, "TrackPtr, RoutePtr, BarPtr");
177             {
178 2           char * TrackPtr = (char *)SvPV_nolen(ST(0))
179             ;
180 2           char * RoutePtr = (char *)SvPV_nolen(ST(1))
181             ;
182 2           char * BarPtr = (char *)SvPV_nolen(ST(2))
183             ;
184             int RETVAL;
185 2 50         dXSTARG;
186              
187 2           RETVAL = usps4cb(TrackPtr, RoutePtr, BarPtr);
188 2           sv_setpv((SV*)ST(2), BarPtr);
189 2 50         SvSETMAGIC(ST(2));
190 2 50         TARGi((IV)RETVAL, 1);
191 2           ST(0) = TARG;
192             }
193 2           XSRETURN(1);
194             }
195              
196             #ifdef __cplusplus
197             extern "C" {
198             #endif
199             XS_EXTERNAL(boot_Business__US__USPS__IMB); /* prototype to pass -Wmissing-prototypes */
200 1           XS_EXTERNAL(boot_Business__US__USPS__IMB)
201             {
202             #if PERL_VERSION_LE(5, 21, 5)
203             dVAR; dXSARGS;
204             #else
205 1           dVAR; dXSBOOTARGSXSAPIVERCHK;
206             #endif
207             #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
208             char* file = __FILE__;
209             #else
210 1           const char* file = __FILE__;
211             #endif
212              
213             PERL_UNUSED_VAR(file);
214              
215             PERL_UNUSED_VAR(cv); /* -W */
216             PERL_UNUSED_VAR(items); /* -W */
217             #if PERL_VERSION_LE(5, 21, 5)
218             XS_VERSION_BOOTCHECK;
219             # ifdef XS_APIVERSION_BOOTCHECK
220             XS_APIVERSION_BOOTCHECK;
221             # endif
222             #endif
223              
224 1           newXS_deffile("Business::US::USPS::IMB::usps4cb", XS_Business__US__USPS__IMB_usps4cb);
225             #if PERL_VERSION_LE(5, 21, 5)
226             # if PERL_VERSION_GE(5, 9, 0)
227             if (PL_unitcheckav)
228             call_list(PL_scopestack_ix, PL_unitcheckav);
229             # endif
230             XSRETURN_YES;
231             #else
232 1           Perl_xs_boot_epilog(aTHX_ ax);
233             #endif
234 1           }
235              
236             #ifdef __cplusplus
237             }
238             #endif