File Coverage

PDFDoc.c
Criterion Covered Total %
statement 21 21 100.0
branch 5 8 62.5
condition n/a
subroutine n/a
pod n/a
total 26 29 89.6


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