JISX0213.c

filter: Statementstmt 100% 18 / 18 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 88.4% 23 / 26 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Encode/JISX0213/CCS.pm ↑ Summary blib/lib/Encode/JISX0213.pm »
1 /*
2 * This file was generated automatically by ExtUtils::ParseXS version 3.63 from the
3 * contents of JISX0213.xs. Do not edit this file, edit JISX0213.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #include <EXTERN.h>
10 #include <perl.h>
11 #include <XSUB.h>
12 #define U8 U8
13 #include "encode.h"
14 #include "ji_00_t.h"
15 #include "ji_01_t.h"
16 #include "ji_02_t.h"
17 #include "ji_03_t.h"
18 #include "ji_04_t.h"
19 #include "ji_05_t.h"
20  
21 static void
22 12 Encode_XSEncoding(pTHX_ encode_t *enc)
23 {
24 12 dSP;
25 12 HV *stash = gv_stashpv("Encode::XS", TRUE);
26 12 SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
27 12 int i = 0;
28 12 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 12 12
29 12 ▶ XPUSHs(sv);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv); 0 12 12
30 24 ▶ while (enc->name[i])
Branch: 1 branch
BranchTrueFalseTotal
while (enc->name[i]) 12 12 24
31 {
32 12 const char *name = enc->name[i++];
33 12 ▶ XPUSHs(sv_2mortal(newSVpvn(name,strlen(name))));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSVpvn(name,strlen(name)))); 0 12 12
34 }
35 12 PUTBACK;
36 12 call_pv("Encode::define_encoding",G_DISCARD);
37 12 SvREFCNT_dec(sv);
38 12 }
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 /* simple backcompat versions of the TARGx() macros with no optimisation */
184 #ifndef TARGi
185 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
186 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
187 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
188 #endif
189  
190 #ifdef __cplusplus
191 extern "C" {
192 #endif
193 XS_EXTERNAL(boot_Encode__JISX0213); /* prototype to pass -Wmissing-prototypes */
194 2 XS_EXTERNAL(boot_Encode__JISX0213)
195 {
196 #if PERL_VERSION_LE(5, 21, 5)
197 dVAR; dXSARGS;
198 #else
199 2 dVAR; dXSBOOTARGSXSAPIVERCHK;
200 #endif
201  
202 PERL_UNUSED_VAR(cv); /* -W */
203 PERL_UNUSED_VAR(items); /* -W */
204 #if PERL_VERSION_LE(5, 21, 5)
205 XS_VERSION_BOOTCHECK;
206 # ifdef XS_APIVERSION_BOOTCHECK
207 XS_APIVERSION_BOOTCHECK;
208 # endif
209 #endif
210  
211  
212 /* Initialisation Section */
213  
214 {
215 #include "ji_00_t.exh"
216 #include "ji_01_t.exh"
217 #include "ji_02_t.exh"
218 #include "ji_03_t.exh"
219 #include "ji_04_t.exh"
220 #include "ji_05_t.exh"
221 }
222  
223  
224 /* End of Initialisation Section */
225  
226 #if PERL_VERSION_LE(5, 21, 5)
227 # if PERL_VERSION_GE(5, 9, 0)
228 if (PL_unitcheckav)
229 call_list(PL_scopestack_ix, PL_unitcheckav);
230 # endif
231 XSRETURN_YES;
232 #else
233 2 Perl_xs_boot_epilog(aTHX_ ax);
234 #endif
235 2 }
236  
237 #ifdef __cplusplus
238 }
239 #endif
« blib/lib/Encode/JISX0213/CCS.pm ↑ Summary blib/lib/Encode/JISX0213.pm »