This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a few helpers to B for INVLIST
[perl5.git] / ext / B / typemap
CommitLineData
a8a597b2
MB
1TYPEMAP
2
3B::OP T_OP_OBJ
4B::UNOP T_OP_OBJ
5B::BINOP T_OP_OBJ
6B::LOGOP T_OP_OBJ
a8a597b2
MB
7B::LISTOP T_OP_OBJ
8B::PMOP T_OP_OBJ
9B::SVOP T_OP_OBJ
7934575e 10B::PADOP T_OP_OBJ
a8a597b2 11B::PVOP T_OP_OBJ
a8a597b2
MB
12B::LOOP T_OP_OBJ
13B::COP T_OP_OBJ
14
15B::SV T_SV_OBJ
16B::PV T_SV_OBJ
17B::IV T_SV_OBJ
18B::NV T_SV_OBJ
19B::PVMG T_SV_OBJ
5c35adbb 20B::REGEXP T_SV_OBJ
a8a597b2
MB
21B::PVLV T_SV_OBJ
22B::BM T_SV_OBJ
23B::RV T_SV_OBJ
24B::GV T_SV_OBJ
25B::CV T_SV_OBJ
26B::HV T_SV_OBJ
27B::AV T_SV_OBJ
28B::IO T_SV_OBJ
1df34986 29B::FM T_SV_OBJ
47e6c6d9 30B::INVLIST T_SV_OBJ
a8a597b2
MB
31
32B::MAGIC T_MG_OBJ
33SSize_t T_IV
fee282c3 34STRLEN T_UV
7934575e 35PADOFFSET T_UV
a8a597b2 36
fd9f6265
JJ
37B::HE T_HE_OBJ
38B::RHE T_RHE_OBJ
39
7261499d 40B::PADLIST T_PL_OBJ
9b7476d7 41B::PADNAMELIST T_PNL_OBJ
f584841e 42B::PADNAME T_PN_OBJ
7261499d 43
a8a597b2
MB
44INPUT
45T_OP_OBJ
46 if (SvROK($arg)) {
47 IV tmp = SvIV((SV*)SvRV($arg));
56431972 48 $var = INT2PTR($type,tmp);
a8a597b2
MB
49 }
50 else
51 croak(\"$var is not a reference\")
52
53T_SV_OBJ
54 if (SvROK($arg)) {
55 IV tmp = SvIV((SV*)SvRV($arg));
56431972 56 $var = INT2PTR($type,tmp);
a8a597b2
MB
57 }
58 else
59 croak(\"$var is not a reference\")
60
61T_MG_OBJ
62 if (SvROK($arg)) {
63 IV tmp = SvIV((SV*)SvRV($arg));
56431972 64 $var = INT2PTR($type,tmp);
a8a597b2
MB
65 }
66 else
67 croak(\"$var is not a reference\")
68
fd9f6265
JJ
69T_HE_OBJ
70 if (SvROK($arg)) {
71 IV tmp = SvIV((SV*)SvRV($arg));
72 $var = INT2PTR($type,tmp);
73 }
74 else
75 croak(\"$var is not a reference\")
76
77T_RHE_OBJ
78 if (SvROK($arg)) {
79 IV tmp = SvIV((SV*)SvRV($arg));
80 $var = INT2PTR($type,tmp);
81 }
82 else
83 croak(\"$var is not a reference\")
84
7261499d
FC
85T_PL_OBJ
86 if (SvROK($arg)) {
87 IV tmp = SvIV((SV*)SvRV($arg));
88 $var = INT2PTR($type,tmp);
89 }
90 else
91 croak(\"$var is not a reference\")
92
9b7476d7
FC
93T_PNL_OBJ
94 if (SvROK($arg)) {
95 IV tmp = SvIV((SV*)SvRV($arg));
96 $var = INT2PTR($type,tmp);
97 }
98 else
99 croak(\"$var is not a reference\")
100
f584841e
FC
101T_PN_OBJ
102 if (SvROK($arg)) {
103 IV tmp = SvIV((SV*)SvRV($arg));
104 $var = INT2PTR($type,tmp);
105 }
106 else
107 croak(\"$var is not a reference\")
108
a8a597b2 109OUTPUT
a8a597b2 110T_MG_OBJ
56431972 111 sv_setiv(newSVrv($arg, "B::MAGIC"), PTR2IV($var));
fd9f6265
JJ
112
113T_HE_OBJ
114 sv_setiv(newSVrv($arg, "B::HE"), PTR2IV($var));
115
116T_RHE_OBJ
117 sv_setiv(newSVrv($arg, "B::RHE"), PTR2IV($var));
7261499d
FC
118
119T_PL_OBJ
120 sv_setiv(newSVrv($arg, $var ? "B::PADLIST" : "B::NULL"),
121 PTR2IV($var));
9b7476d7
FC
122
123T_PNL_OBJ
124 sv_setiv(newSVrv($arg, $var ? "B::PADNAMELIST" : "B::NULL"),
125 PTR2IV($var));
f584841e
FC
126
127T_PN_OBJ
128 sv_setiv(newSVrv($arg, $var ? "B::PADNAME" : "B::SPECIAL"),
129 PTR2IV($var));