line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#define PERL_NO_GET_CONTEXT |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#include "EXTERN.h" |
4
|
|
|
|
|
|
|
#include "perl.h" |
5
|
|
|
|
|
|
|
#include "XSUB.h" |
6
|
|
|
|
|
|
|
|
7
|
318
|
|
|
|
|
|
SV *cbf_call_scalar_with_arguments( pTHX_ SV* cb, const U8 count, SV** args ) { |
8
|
|
|
|
|
|
|
// --- Almost all copy-paste from “perlcall” … blegh! |
9
|
318
|
|
|
|
|
|
dSP; |
10
|
|
|
|
|
|
|
|
11
|
318
|
|
|
|
|
|
ENTER; |
12
|
318
|
|
|
|
|
|
SAVETMPS; |
13
|
|
|
|
|
|
|
|
14
|
318
|
50
|
|
|
|
|
PUSHMARK(SP); |
15
|
318
|
50
|
|
|
|
|
EXTEND(SP, count); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
U8 i; |
18
|
912
|
100
|
|
|
|
|
for (i=0; i
|
19
|
|
|
|
|
|
|
|
20
|
318
|
|
|
|
|
|
PUTBACK; |
21
|
|
|
|
|
|
|
|
22
|
318
|
|
|
|
|
|
call_sv(cb, G_SCALAR); |
23
|
|
|
|
|
|
|
|
24
|
100
|
|
|
|
|
|
SV *ret = newSVsv(POPs); |
25
|
|
|
|
|
|
|
|
26
|
100
|
50
|
|
|
|
|
FREETMPS; |
27
|
100
|
|
|
|
|
|
LEAVE; |
28
|
|
|
|
|
|
|
|
29
|
100
|
|
|
|
|
|
return ret; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
218
|
|
|
|
|
|
void cbf_die_with_arguments( pTHX_ U8 argslen, SV** args ) { |
33
|
218
|
|
|
|
|
|
SV* diename = newSVpvs("CBOR::Free::_die"); |
34
|
218
|
|
|
|
|
|
sv_2mortal(diename); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
// NB: args should NOT be mortal because the call to Perl |
37
|
|
|
|
|
|
|
// will do that for us. |
38
|
|
|
|
|
|
|
|
39
|
218
|
|
|
|
|
|
cbf_call_scalar_with_arguments( |
40
|
|
|
|
|
|
|
aTHX_ |
41
|
|
|
|
|
|
|
diename, |
42
|
|
|
|
|
|
|
argslen, |
43
|
|
|
|
|
|
|
args |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
assert(0); |
47
|
0
|
|
|
|
|
|
} |