File Coverage

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