lib/Bio/PhyloXS/Util/Exceptions.c

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