This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
usurp GVOP slot for new PADOP (one small step to making optree
[perl5.git] / ext / B / typemap
1 TYPEMAP
2
3 B::OP           T_OP_OBJ
4 B::UNOP         T_OP_OBJ
5 B::BINOP        T_OP_OBJ
6 B::LOGOP        T_OP_OBJ
7 B::LISTOP       T_OP_OBJ
8 B::PMOP         T_OP_OBJ
9 B::SVOP         T_OP_OBJ
10 B::PADOP        T_OP_OBJ
11 B::PVOP         T_OP_OBJ
12 B::CVOP         T_OP_OBJ
13 B::LOOP         T_OP_OBJ
14 B::COP          T_OP_OBJ
15
16 B::SV           T_SV_OBJ
17 B::PV           T_SV_OBJ
18 B::IV           T_SV_OBJ
19 B::NV           T_SV_OBJ
20 B::PVMG         T_SV_OBJ
21 B::PVLV         T_SV_OBJ
22 B::BM           T_SV_OBJ
23 B::RV           T_SV_OBJ
24 B::GV           T_SV_OBJ
25 B::CV           T_SV_OBJ
26 B::HV           T_SV_OBJ
27 B::AV           T_SV_OBJ
28 B::IO           T_SV_OBJ
29
30 B::MAGIC        T_MG_OBJ
31 SSize_t         T_IV
32 STRLEN          T_IV
33 PADOFFSET       T_UV
34
35 INPUT
36 T_OP_OBJ
37         if (SvROK($arg)) {
38             IV tmp = SvIV((SV*)SvRV($arg));
39             $var = INT2PTR($type,tmp);
40         }
41         else
42             croak(\"$var is not a reference\")
43
44 T_SV_OBJ
45         if (SvROK($arg)) {
46             IV tmp = SvIV((SV*)SvRV($arg));
47             $var = INT2PTR($type,tmp);
48         }
49         else
50             croak(\"$var is not a reference\")
51
52 T_MG_OBJ
53         if (SvROK($arg)) {
54             IV tmp = SvIV((SV*)SvRV($arg));
55             $var = INT2PTR($type,tmp);
56         }
57         else
58             croak(\"$var is not a reference\")
59
60 OUTPUT
61 T_OP_OBJ
62         sv_setiv(newSVrv($arg, cc_opclassname(aTHX_ (OP*)$var)), PTR2IV($var));
63
64 T_SV_OBJ
65         make_sv_object(aTHX_ ($arg), (SV*)($var));
66
67
68 T_MG_OBJ
69         sv_setiv(newSVrv($arg, "B::MAGIC"), PTR2IV($var));