struct thread now stored in an SV and uses '~'-magic for access.
[p5sagit/p5-mst-13.2.git] / typemap
CommitLineData
683929b4 1Thread T_XSOBJ
d9bb3666 2
3INPUT
683929b4 4T_XSOBJ
5 STMT_START {
6 MAGIC *mg;
7 SV *sv = ($arg);
8
9 if (!sv_isobject(sv))
10 croak(\"$var is not an object\");
11 if (!SvRMAGICAL(sv) || !(mg = mg_find(sv, '~')))
12 croak(\"$arg is a counterfeit ${ntype} object\");
13 $var = ($type) SvPVX(mg->mg_obj);
dd32f564 14 DEBUG_L(PerlIO_printf(PerlIO_stderr(),
683929b4 15 \"XSUB ${func_name}: %p\\n\", $var);)
16 } STMT_END
734689b1 17T_IVREF
18 if (SvROK($arg))
19 $var = ($type) SvIV((SV*)SvRV($arg));
20 else
21 croak(\"$var is not a reference\")
d9bb3666 22