typemap
raw| 1 | TYPEMAP |
| 2 | DSA * O_OBJECT |
| 3 | DSA_SIG * O_OBJECT |
| 4 | |
| 5 | INPUT |
| 6 | O_OBJECT |
| 7 | if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) |
| 8 | $var = INT2PTR($type, SvIV((SV*)SvRV( $arg ))); |
| 9 | else{ |
| 10 | warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" ); |
| 11 | XSRETURN_UNDEF; |
| 12 | } |
| 13 | |
| 14 | OUTPUT |
| 15 | |
| 16 | # The Perl object is blessed into 'CLASS', which should be a |
| 17 | # char* having the name of the package for the blessing. |
| 18 | O_OBJECT |
| 19 | sv_setref_pv( $arg, (char *)CLASS, (void*)$var ); |