xs/abi.xs

filter: Statementstmt 100% 9 / 9 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 73.6% 14 / 19 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« include/sc/sc_abi_impl.h ↑ Summary include/sc/sc_codec.h »
1 # The C ABI's Perl-visible ends: the table's address, its version, and the
2 # selftest that walks it.
3  
4 MODULE = Struct::Codec PACKAGE = Struct::Codec
5  
6 # Unsigned, not IV: where the loader maps this object decides the sign bit, and
7 # a 32-bit perl above 0x7fffffff would hand back a negative from PTR2IV.
8 UV
9 _abi_ptr()
10 CODE:
11 2 ▶ RETVAL = PTR2UV(&SC_ABI);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = PTR2UV(&SC_ABI); 0 2 2
12 OUTPUT:
13 RETVAL
14  
15 IV
16 _abi_version()
17 CODE:
18 2 ▶ RETVAL = SC_ABI.abi_version;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = SC_ABI.abi_version; 0 2 2
19 OUTPUT:
20 RETVAL
21  
22 # (step, bytes, data): 0 when every entry answered as its declaration says,
23 # otherwise the number of the check that did not - so a failure names itself
24 # rather than sending somebody to read the whole table. The bytes and the
25 # structure the C side built come back too, so a Perl test can compare the
26 # table's encoding with the Perl surface's for the same data.
27 void
28 _abi_selftest()
29 PREINIT:
30 1 int step = 0;
31 1 SV *data = NULL;
32 SV *bytes;
33 PPCODE:
34 1 bytes = sc_abi_selftest(aTHX_ &step, &data);
35 1 ▶ EXTEND(SP, 3);
Branch: 1 branch
BranchTrueFalseTotal
EXTEND(SP, 3); 0 1 1
36 1 mPUSHi(step);
37 1 ▶ PUSHs(bytes ? sv_2mortal(bytes) : &PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
PUSHs(bytes ? sv_2mortal(bytes) : &PL_sv_undef); 1 0 1
38 1 ▶ PUSHs(data ? sv_2mortal(data) : &PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
PUSHs(data ? sv_2mortal(data) : &PL_sv_undef); 1 0 1
« include/sc/sc_abi_impl.h ↑ Summary include/sc/sc_codec.h »