File Coverage

cpan/Encode/CN/CN.c
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine n/a
total 19 19 100.0


line stmt bran cond sub time code
1           /*
2           * This file was generated automatically by ExtUtils::ParseXS version 3.22 from the
3           * contents of CN.xs. Do not edit this file, edit CN.xs instead.
4           *
5           * ANY CHANGES MADE HERE WILL BE LOST!
6           *
7           */
8            
9           #include
10           #include
11           #include
12           #define U8 U8
13           #include "encode.h"
14           #include "cp_00_t.h"
15           #include "eu_01_t.h"
16           #include "gb_02_t.h"
17           #include "gb_03_t.h"
18           #include "ir_04_t.h"
19           #include "ma_05_t.h"
20            
21           static void
22 72         Encode_XSEncoding(pTHX_ encode_t *enc)
23           {
24 72         dSP;
25 72         HV *stash = gv_stashpv("Encode::XS", TRUE);
26 72         SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
27           int i = 0;
28 72         PUSHMARK(sp);
29 72         XPUSHs(sv);
30 216         while (enc->name[i])
31           {
32 72         const char *name = enc->name[i++];
33 72         XPUSHs(sv_2mortal(newSVpvn(name,strlen(name))));
34           }
35 72         PUTBACK;
36 72         call_pv("Encode::define_encoding",G_DISCARD);
37           SvREFCNT_dec(sv);
38 72         }
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(pTHX_ const CV *const cv, const char *const params);
140            
141           STATIC void
142           S_croak_xs_usage(pTHX_ 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(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
155           else
156           Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
157           } else {
158           /* Pants. I don't think that it should be possible to get here. */
159           Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
160           }
161           }
162           #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
163            
164           #ifdef PERL_IMPLICIT_CONTEXT
165           #define croak_xs_usage(a,b) S_croak_xs_usage(aTHX_ a,b)
166           #else
167           #define croak_xs_usage S_croak_xs_usage
168           #endif
169            
170           #endif
171            
172           /* NOTE: the prototype of newXSproto() is different in versions of perls,
173           * so we define a portable version of newXSproto()
174           */
175           #ifdef newXS_flags
176           #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
177           #else
178           #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
179           #endif /* !defined(newXS_flags) */
180            
181           #ifdef __cplusplus
182           extern "C"
183           #endif
184           XS_EXTERNAL(boot_Encode__CN); /* prototype to pass -Wmissing-prototypes */
185 12         XS_EXTERNAL(boot_Encode__CN)
186           {
187 12         dVAR; dXSARGS;
188            
189           PERL_UNUSED_VAR(cv); /* -W */
190           PERL_UNUSED_VAR(items); /* -W */
191           #ifdef XS_APIVERSION_BOOTCHECK
192 12         XS_APIVERSION_BOOTCHECK;
193           #endif
194 12         XS_VERSION_BOOTCHECK;
195            
196            
197           /* Initialisation Section */
198            
199           {
200           #include "cp_00_t.exh"
201           #include "eu_01_t.exh"
202           #include "gb_02_t.exh"
203           #include "gb_03_t.exh"
204           #include "ir_04_t.exh"
205           #include "ma_05_t.exh"
206           }
207            
208            
209           /* End of Initialisation Section */
210            
211           #if (PERL_REVISION == 5 && PERL_VERSION >= 9)
212 12         if (PL_unitcheckav)
213 12         call_list(PL_scopestack_ix, PL_unitcheckav);
214           #endif
215 12         XSRETURN_YES;
216           }
217