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