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