-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypemap
40 lines (37 loc) · 1.1 KB
/
typemap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
TYPEMAP
cmark_node * T_NODE
cmark_iter * T_ITER
cmark_parser * T_PARSER
const char * T_UTF8
char * T_UTF8
# The custom OUTPUT for T_IV generates better code than the default.
# It looks like this is due to weirdness in ExtUtils::ParseXS which creates
# suboptimal code for "targetable" return types.
int T_IV
long T_IV
cmark_node_type T_IV
cmark_event_type T_IV
INPUT
T_NODE
$var = (cmark_node*)S_sv2c(aTHX_ $arg, \"CommonMark::Node\", 16, cv,
\"$var\");
T_ITER
$var = (cmark_iter*)S_sv2c(aTHX_ $arg, \"CommonMark::Iterator\", 20, cv,
\"$var\");
T_PARSER
$var = (cmark_parser*)S_sv2c(aTHX_ $arg, \"CommonMark::Parser\", 18, cv,
\"$var\");
T_UTF8
$var = SvPVutf8_nolen($arg)
OUTPUT
T_NODE
$arg = S_node2sv(aTHX_ $var);
T_ITER
sv_setref_pv($arg, \"CommonMark::Iterator\", $var);
T_PARSER
sv_setref_pv($arg, \"CommonMark::Parser\", $var);
T_UTF8
$arg = newSVpv($var, 0);
SvUTF8_on($arg);
T_IV
$arg = newSViv((IV)$var);