Blame typemap

Packit 67f6e7
TYPEMAP
Packit 67f6e7
Detector *	O_OBJECT
Packit 67f6e7
Packit 67f6e7
INPUT
Packit 67f6e7
O_OBJECT
Packit 67f6e7
	if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG)) {
Packit 67f6e7
	    $var = ($type)SvIV((SV*)SvRV( $arg ));
Packit 67f6e7
	} else {
Packit 67f6e7
	    warn(\"${Package}::$func_name() -- $var is not a blessed SV reference\");
Packit 67f6e7
	    XSRETURN_UNDEF;
Packit 67f6e7
	}
Packit 67f6e7
Packit 67f6e7
OUTPUT
Packit 67f6e7
# The Perl object is blessed into 'CLASS', which should be a
Packit 67f6e7
# char * having the name of the package for the blessing.
Packit 67f6e7
O_OBJECT
Packit 67f6e7
	sv_setref_pv($arg, CLASS, (void*)$var);
Packit 67f6e7