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