MRO.c

filter: Statementstmt 91.4% 32 / 35 Branchbran 58.3% 7 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 82.9% 39 / 47 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« example/inc/Module/Install/Base.pm ↑ Summary example/Makefile.PL »
1 /*
2 * This file was generated automatically by ExtUtils::ParseXS version 3.63 from the
3 * contents of MRO.xs. Do not edit this file, edit MRO.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "MRO.xs"
10 #define PERL_NO_GET_CONTEXT
11 #include <EXTERN.h>
12 #include <perl.h>
13 #include <XSUB.h>
14  
15 #include "ppport.h"
16  
17 #define NEED_mro_get_linear_isa
18 #include "mro_compat.h"
19  
20 typedef HV STASH;
21  
22 /* these mro_* functions are only for tests */
23  
24 #line 25 "MRO.c"
25 #ifndef PERL_UNUSED_VAR
26 # define PERL_UNUSED_VAR(var) if (0) var = var
27 #endif
28  
29 #ifndef dVAR
30 # define dVAR dNOOP
31 #endif
32  
33  
34 /* This stuff is not part of the API! You have been warned. */
35 #ifndef PERL_VERSION_DECIMAL
36 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
37 #endif
38 #ifndef PERL_DECIMAL_VERSION
39 # define PERL_DECIMAL_VERSION \
40 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
41 #endif
42 #ifndef PERL_VERSION_GE
43 # define PERL_VERSION_GE(r,v,s) \
44 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
45 #endif
46 #ifndef PERL_VERSION_LE
47 # define PERL_VERSION_LE(r,v,s) \
48 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
49 #endif
50  
51 /* XS_INTERNAL is the explicit static-linkage variant of the default
52 * XS macro.
53 *
54 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
55 * "static", ie. it exports XSUB symbols. You probably don't want that
56 * for anything but the BOOT XSUB.
57 *
58 * See XSUB.h in core!
59 */
60  
61  
62 /* TODO: This might be compatible further back than 5.10.0. */
63 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
64 # undef XS_EXTERNAL
65 # undef XS_INTERNAL
66 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
67 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
68 # define XS_INTERNAL(name) static XSPROTO(name)
69 # endif
70 # if defined(__SYMBIAN32__)
71 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
72 # define XS_INTERNAL(name) EXPORT_C static XSPROTO(name)
73 # endif
74 # ifndef XS_EXTERNAL
75 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
76 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
77 # define XS_INTERNAL(name) static void name(pTHX_ CV* cv __attribute__unused__)
78 # else
79 # ifdef __cplusplus
80 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
81 # define XS_INTERNAL(name) static XSPROTO(name)
82 # else
83 # define XS_EXTERNAL(name) XSPROTO(name)
84 # define XS_INTERNAL(name) static XSPROTO(name)
85 # endif
86 # endif
87 # endif
88 #endif
89  
90 /* perl >= 5.10.0 && perl <= 5.15.1 */
91  
92  
93 /* The XS_EXTERNAL macro is used for functions that must not be static
94 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
95 * macro defined, the best we can do is assume XS is the same.
96 * Dito for XS_INTERNAL.
97 */
98 #ifndef XS_EXTERNAL
99 # define XS_EXTERNAL(name) XS(name)
100 #endif
101 #ifndef XS_INTERNAL
102 # define XS_INTERNAL(name) XS(name)
103 #endif
104  
105 /* Now, finally, after all this mess, we want an ExtUtils::ParseXS
106 * internal macro that we're free to redefine for varying linkage due
107 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
108 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
109 */
110  
111 #undef XS_EUPXS
112 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
113 # define XS_EUPXS(name) XS_EXTERNAL(name)
114 #else
115 /* default to internal */
116 # define XS_EUPXS(name) XS_INTERNAL(name)
117 #endif
118  
119 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
120 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
121  
122 /* prototype to pass -Wmissing-prototypes */
123 static void
124 S_croak_xs_usage(const CV *const cv, const char *const params);
125  
126 static void
127 S_croak_xs_usage(const CV *const cv, const char *const params)
128 {
129 const GV *const gv = CvGV(cv);
130  
131 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
132  
133 if (gv) {
134 const char *const gvname = GvNAME(gv);
135 const HV *const stash = GvSTASH(gv);
136 const char *const hvname = stash ? HvNAME(stash) : NULL;
137  
138 if (hvname)
139 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
140 else
141 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
142 } else {
143 /* Pants. I don't think that it should be possible to get here. */
144 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
145 }
146 }
147 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
148  
149 #define croak_xs_usage S_croak_xs_usage
150  
151 #endif
152  
153 /* NOTE: the prototype of newXSproto() is different in versions of perls,
154 * so we define a portable version of newXSproto()
155 */
156 #ifdef newXS_flags
157 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
158 #else
159 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
160 #endif /* !defined(newXS_flags) */
161  
162 #if PERL_VERSION_LE(5, 21, 5)
163 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
164 #else
165 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
166 #endif
167  
168 /* simple backcompat versions of the TARGx() macros with no optimisation */
169 #ifndef TARGi
170 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
171 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
172 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
173 #endif
174  
175 #line 176 "MRO.c"
176  
177 XS_EUPXS(XS_Devel__MRO_mro_get_linear_isa); /* prototype to pass -Wmissing-prototypes */
178 7 XS_EUPXS(XS_Devel__MRO_mro_get_linear_isa)
179 {
180 7 dVAR; dXSARGS;
181 7 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 7 7
182 0 croak_xs_usage(cv, "package");
183 {
184 7 STASH* package = gv_stashsv(ST(0), TRUE)
185 ;
186 AV * RETVAL;
187  
188 7 RETVAL = mro_get_linear_isa(package);
189 {
190 SV * RETVALSV;
191 7 RETVALSV = newRV((SV*)RETVAL);
192 7 RETVALSV = sv_2mortal(RETVALSV);
193 7 ST(0) = RETVALSV;
194 }
195 }
196 7 XSRETURN(1);
197 }
198  
199  
200 XS_EUPXS(XS_Devel__MRO_mro_get_pkg_gen); /* prototype to pass -Wmissing-prototypes */
201 6 XS_EUPXS(XS_Devel__MRO_mro_get_pkg_gen)
202 {
203 6 dVAR; dXSARGS;
204 6 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 6 6
205 0 croak_xs_usage(cv, "package");
206 {
207 6 STASH* package = gv_stashsv(ST(0), TRUE)
208 ;
209 U32 RETVAL;
210 6 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 6 0 6
211  
212 6 ▶ RETVAL = mro_get_pkg_gen(package);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = mro_get_pkg_gen(package); 6 0 6
213 6 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 5 1 6
214 6 ST(0) = TARG;
215 }
216 6 XSRETURN(1);
217 }
218  
219  
220 XS_EUPXS(XS_Devel__MRO_mro_method_changed_in); /* prototype to pass -Wmissing-prototypes */
221 6 XS_EUPXS(XS_Devel__MRO_mro_method_changed_in)
222 {
223 6 dVAR; dXSARGS;
224 6 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 6 6
225 0 croak_xs_usage(cv, "package");
226 {
227 6 STASH* package = gv_stashsv(ST(0), TRUE)
228 ;
229  
230 6 mro_method_changed_in(package);
231 }
232 6 XSRETURN_EMPTY;
233 }
234  
235 #ifdef __cplusplus
236 extern "C" {
237 #endif
238 XS_EXTERNAL(boot_Devel__MRO); /* prototype to pass -Wmissing-prototypes */
239 1 XS_EXTERNAL(boot_Devel__MRO)
240 {
241 #if PERL_VERSION_LE(5, 21, 5)
242 dVAR; dXSARGS;
243 #else
244 1 dVAR; dXSBOOTARGSXSAPIVERCHK;
245 #endif
246 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
247 char* file = __FILE__;
248 #else
249 1 const char* file = __FILE__;
250 #endif
251  
252 PERL_UNUSED_VAR(file);
253  
254 PERL_UNUSED_VAR(cv); /* -W */
255 PERL_UNUSED_VAR(items); /* -W */
256 #if PERL_VERSION_LE(5, 21, 5)
257 XS_VERSION_BOOTCHECK;
258 # ifdef XS_APIVERSION_BOOTCHECK
259 XS_APIVERSION_BOOTCHECK;
260 # endif
261 #endif
262  
263 1 newXS_deffile("Devel::MRO::mro_get_linear_isa", XS_Devel__MRO_mro_get_linear_isa);
264 1 newXS_deffile("Devel::MRO::mro_get_pkg_gen", XS_Devel__MRO_mro_get_pkg_gen);
265 1 newXS_deffile("Devel::MRO::mro_method_changed_in", XS_Devel__MRO_mro_method_changed_in);
266 #if PERL_VERSION_LE(5, 21, 5)
267 # if PERL_VERSION_GE(5, 9, 0)
268 if (PL_unitcheckav)
269 call_list(PL_scopestack_ix, PL_unitcheckav);
270 # endif
271 XSRETURN_YES;
272 #else
273 1 Perl_xs_boot_epilog(aTHX_ ax);
274 #endif
275 1 }
276  
277 #ifdef __cplusplus
278 }
279 #endif
« example/inc/Module/Install/Base.pm ↑ Summary example/Makefile.PL »