Tidx.c

filter: Statementstmt 0.0% 0 / 78 Branchbran 0.0% 0 / 48 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 126 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Text/Tidx.pm ↑ Summary fastq-lib.cpp »
1 /*
2 * This file was generated automatically by ExtUtils::ParseXS version 3.63 from the
3 * contents of Tidx.xs. Do not edit this file, edit Tidx.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "Tidx.xs"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13  
14 #include "EXTERN.h"
15 #include "perl.h"
16 #include "XSUB.h"
17  
18 #include "ppport.h"
19  
20 #ifdef __cplusplus
21 }
22 #endif
23  
24 #include "tidx.h"
25  
26 #line 27 "Tidx.c"
27 #ifndef PERL_UNUSED_VAR
28 # define PERL_UNUSED_VAR(var) if (0) var = var
29 #endif
30  
31 #ifndef dVAR
32 # define dVAR dNOOP
33 #endif
34  
35  
36 /* This stuff is not part of the API! You have been warned. */
37 #ifndef PERL_VERSION_DECIMAL
38 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
39 #endif
40 #ifndef PERL_DECIMAL_VERSION
41 # define PERL_DECIMAL_VERSION \
42 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
43 #endif
44 #ifndef PERL_VERSION_GE
45 # define PERL_VERSION_GE(r,v,s) \
46 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
47 #endif
48 #ifndef PERL_VERSION_LE
49 # define PERL_VERSION_LE(r,v,s) \
50 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
51 #endif
52  
53 /* XS_INTERNAL is the explicit static-linkage variant of the default
54 * XS macro.
55 *
56 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
57 * "static", ie. it exports XSUB symbols. You probably don't want that
58 * for anything but the BOOT XSUB.
59 *
60 * See XSUB.h in core!
61 */
62  
63  
64 /* TODO: This might be compatible further back than 5.10.0. */
65 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
66 # undef XS_EXTERNAL
67 # undef XS_INTERNAL
68 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
69 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
70 # define XS_INTERNAL(name) static XSPROTO(name)
71 # endif
72 # if defined(__SYMBIAN32__)
73 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
74 # define XS_INTERNAL(name) EXPORT_C static XSPROTO(name)
75 # endif
76 # ifndef XS_EXTERNAL
77 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
78 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
79 # define XS_INTERNAL(name) static void name(pTHX_ CV* cv __attribute__unused__)
80 # else
81 # ifdef __cplusplus
82 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
83 # define XS_INTERNAL(name) static XSPROTO(name)
84 # else
85 # define XS_EXTERNAL(name) XSPROTO(name)
86 # define XS_INTERNAL(name) static XSPROTO(name)
87 # endif
88 # endif
89 # endif
90 #endif
91  
92 /* perl >= 5.10.0 && perl <= 5.15.1 */
93  
94  
95 /* The XS_EXTERNAL macro is used for functions that must not be static
96 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
97 * macro defined, the best we can do is assume XS is the same.
98 * Dito for XS_INTERNAL.
99 */
100 #ifndef XS_EXTERNAL
101 # define XS_EXTERNAL(name) XS(name)
102 #endif
103 #ifndef XS_INTERNAL
104 # define XS_INTERNAL(name) XS(name)
105 #endif
106  
107 /* Now, finally, after all this mess, we want an ExtUtils::ParseXS
108 * internal macro that we're free to redefine for varying linkage due
109 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
110 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
111 */
112  
113 #undef XS_EUPXS
114 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
115 # define XS_EUPXS(name) XS_EXTERNAL(name)
116 #else
117 /* default to internal */
118 # define XS_EUPXS(name) XS_INTERNAL(name)
119 #endif
120  
121 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
122 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
123  
124 /* prototype to pass -Wmissing-prototypes */
125 static void
126 S_croak_xs_usage(const CV *const cv, const char *const params);
127  
128 static void
129 S_croak_xs_usage(const CV *const cv, const char *const params)
130 {
131 const GV *const gv = CvGV(cv);
132  
133 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
134  
135 if (gv) {
136 const char *const gvname = GvNAME(gv);
137 const HV *const stash = GvSTASH(gv);
138 const char *const hvname = stash ? HvNAME(stash) : NULL;
139  
140 if (hvname)
141 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
142 else
143 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
144 } else {
145 /* Pants. I don't think that it should be possible to get here. */
146 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
147 }
148 }
149 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
150  
151 #define croak_xs_usage S_croak_xs_usage
152  
153 #endif
154  
155 /* NOTE: the prototype of newXSproto() is different in versions of perls,
156 * so we define a portable version of newXSproto()
157 */
158 #ifdef newXS_flags
159 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
160 #else
161 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
162 #endif /* !defined(newXS_flags) */
163  
164 #if PERL_VERSION_LE(5, 21, 5)
165 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
166 #else
167 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
168 #endif
169  
170 /* simple backcompat versions of the TARGx() macros with no optimisation */
171 #ifndef TARGi
172 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
173 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
174 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
175 #endif
176  
177 #line 178 "Tidx.c"
178  
179 XS_EUPXS(XS_Text__Tidx_new); /* prototype to pass -Wmissing-prototypes */
180 0 XS_EUPXS(XS_Text__Tidx_new)
181 {
182 0 dVAR; dXSARGS;
183 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
184 0 croak_xs_usage(cv, "CLASS, path");
185 {
186 0 char * CLASS = (char *)SvPV_nolen(ST(0))
187 ;
188 tidx * RETVAL;
189 0 ▶ char * path = (char *)SvPV_nolen(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
char * path = (char *)SvPV_nolen(ST(1)) 0 0 0
190 ;
191  
192 0 ▶ RETVAL = new tidx(path);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = new tidx(path); 0 0 0
RETVAL = new tidx(path); 0 0 0
193 {
194 SV * RETVALSV;
195 0 RETVALSV = sv_newmortal();
196 0 sv_setref_pv( RETVALSV, CLASS, (void*)RETVAL );
197 0 ST(0) = RETVALSV;
198 }
199 }
200 0 XSRETURN(1);
201 }
202  
203  
204 XS_EUPXS(XS_Text__Tidx_DESTROY); /* prototype to pass -Wmissing-prototypes */
205 0 XS_EUPXS(XS_Text__Tidx_DESTROY)
206 {
207 0 dVAR; dXSARGS;
208 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
209 0 croak_xs_usage(cv, "THIS");
210 {
211 tidx * THIS;
212  
213 0 ▶ if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
Branch: 3 branches
BranchTrueFalseTotal
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
214 0 THIS = (tidx *)SvIV((SV*)SvRV( ST(0) ));
215 else{
216 0 warn( "Text::Tidx::DESTROY() -- THIS is not a blessed SV reference" );
217 0 XSRETURN_UNDEF;
218 }
219 ;
220  
221 0 ▶ delete THIS;
Branch: 1 branch
BranchTrueFalseTotal
delete THIS; 0 0 0
222 }
223 0 XSRETURN_EMPTY;
224 }
225  
226  
227 XS_EUPXS(XS_Text__Tidx_lookup_c); /* prototype to pass -Wmissing-prototypes */
228 0 XS_EUPXS(XS_Text__Tidx_lookup_c)
229 {
230 0 dVAR; dXSARGS;
231 0 ▶ if (items != 4)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 4) 0 0 0
232 0 croak_xs_usage(cv, "THIS, chr, pos, msep");
233 {
234 tidx * THIS;
235 const char * RETVAL;
236 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
237 0 const char * chr = (const char *)SvPV_nolen(ST(1))
238 ;
239 0 int pos = (int)SvIV(ST(2))
240 ;
241 0 ▶ const char * msep = (const char *)SvPV_nolen(ST(3))
Branch: 1 branch
BranchTrueFalseTotal
const char * msep = (const char *)SvPV_nolen(ST(3)) 0 0 0
242 ;
243  
244 0 ▶ if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
Branch: 3 branches
BranchTrueFalseTotal
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
245 0 THIS = (tidx *)SvIV((SV*)SvRV( ST(0) ));
246 else{
247 0 warn( "Text::Tidx::lookup_c() -- THIS is not a blessed SV reference" );
248 0 XSRETURN_UNDEF;
249 }
250 ;
251  
252 0 RETVAL = THIS->lookup_c(chr, pos, msep);
253 0 sv_setpv((SV*)TARG, RETVAL);
254 0 ST(0) = TARG;
255 }
256 0 XSRETURN(1);
257 }
258  
259  
260 XS_EUPXS(XS_Text__Tidx_lookup_cr); /* prototype to pass -Wmissing-prototypes */
261 0 XS_EUPXS(XS_Text__Tidx_lookup_cr)
262 {
263 0 dVAR; dXSARGS;
264 0 ▶ if (items != 5)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 5) 0 0 0
265 0 croak_xs_usage(cv, "THIS, chr, beg, end, msep");
266 {
267 tidx * THIS;
268 const char * RETVAL;
269 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
270 0 const char * chr = (const char *)SvPV_nolen(ST(1))
271 ;
272 0 int beg = (int)SvIV(ST(2))
273 ;
274 0 int end = (int)SvIV(ST(3))
275 ;
276 0 ▶ const char * msep = (const char *)SvPV_nolen(ST(4))
Branch: 1 branch
BranchTrueFalseTotal
const char * msep = (const char *)SvPV_nolen(ST(4)) 0 0 0
277 ;
278  
279 0 ▶ if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
Branch: 3 branches
BranchTrueFalseTotal
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) 0 0 0
280 0 THIS = (tidx *)SvIV((SV*)SvRV( ST(0) ));
281 else{
282 0 warn( "Text::Tidx::lookup_cr() -- THIS is not a blessed SV reference" );
283 0 XSRETURN_UNDEF;
284 }
285 ;
286  
287 0 RETVAL = THIS->lookup_cr(chr, beg, end, msep);
288 0 sv_setpv((SV*)TARG, RETVAL);
289 0 ST(0) = TARG;
290 }
291 0 XSRETURN(1);
292 }
293  
294  
295 XS_EUPXS(XS_Text__Tidx_tidx_build); /* prototype to pass -Wmissing-prototypes */
296 0 XS_EUPXS(XS_Text__Tidx_tidx_build)
297 {
298 0 dVAR; dXSARGS;
299 0 ▶ if (items != 8)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 8) 0 0 0
300 0 croak_xs_usage(cv, "file, sep, chr, beg, end, skip_i, skip_c, sub_e");
301 {
302 0 const char * file = (const char *)SvPV_nolen(ST(0))
303 ;
304 0 ▶ const char * sep = (const char *)SvPV_nolen(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
const char * sep = (const char *)SvPV_nolen(ST(1)) 0 0 0
305 ;
306 0 int chr = (int)SvIV(ST(2))
307 ;
308 0 int beg = (int)SvIV(ST(3))
309 ;
310 0 int end = (int)SvIV(ST(4))
311 ;
312 0 int skip_i = (int)SvIV(ST(5))
313 ;
314 0 ▶ char skip_c = (char)*SvPV_nolen(ST(6))
Branch: 1 branch
BranchTrueFalseTotal
char skip_c = (char)*SvPV_nolen(ST(6)) 0 0 0
315 ;
316 0 bool sub_e = (bool)SvTRUE(ST(7))
317 ;
318  
319 0 tidx_build(file, sep, chr, beg, end, skip_i, skip_c, sub_e);
320 }
321 0 XSRETURN_EMPTY;
322 }
323  
324 #ifdef __cplusplus
325 extern "C" {
326 #endif
327 XS_EXTERNAL(boot_Text__Tidx); /* prototype to pass -Wmissing-prototypes */
328 0 XS_EXTERNAL(boot_Text__Tidx)
329 {
330 #if PERL_VERSION_LE(5, 21, 5)
331 dVAR; dXSARGS;
332 #else
333 0 dVAR; dXSBOOTARGSXSAPIVERCHK;
334 #endif
335 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
336 char* file = __FILE__;
337 #else
338 0 const char* file = __FILE__;
339 #endif
340  
341 PERL_UNUSED_VAR(file);
342  
343 PERL_UNUSED_VAR(cv); /* -W */
344 PERL_UNUSED_VAR(items); /* -W */
345 #if PERL_VERSION_LE(5, 21, 5)
346 XS_VERSION_BOOTCHECK;
347 # ifdef XS_APIVERSION_BOOTCHECK
348 XS_APIVERSION_BOOTCHECK;
349 # endif
350 #endif
351  
352 0 newXS_deffile("Text::Tidx::new", XS_Text__Tidx_new);
353 0 newXS_deffile("Text::Tidx::DESTROY", XS_Text__Tidx_DESTROY);
354 0 newXS_deffile("Text::Tidx::lookup_c", XS_Text__Tidx_lookup_c);
355 0 newXS_deffile("Text::Tidx::lookup_cr", XS_Text__Tidx_lookup_cr);
356 0 newXS_deffile("Text::Tidx::tidx_build", XS_Text__Tidx_tidx_build);
357 #if PERL_VERSION_LE(5, 21, 5)
358 # if PERL_VERSION_GE(5, 9, 0)
359 if (PL_unitcheckav)
360 call_list(PL_scopestack_ix, PL_unitcheckav);
361 # endif
362 XSRETURN_YES;
363 #else
364 0 Perl_xs_boot_epilog(aTHX_ ax);
365 #endif
366 0 }
367  
368 #ifdef __cplusplus
369 }
370 #endif
« blib/lib/Text/Tidx.pm ↑ Summary fastq-lib.cpp »