File Coverage

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