The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
BOOL                    T_IV
DWORD                   T_IV
LPCSTR                  T_PV
HANDLE			T_PTROBJ

#############################################################################
INPUT
T_PTROBJ
	if (sv_derived_from($arg, \"${Package}\")) {
	    IV tmp = SvIV((SV*)SvRV($arg));
	    $var = ($type) tmp;
	}
	else
	    croak(\"$var is not of type ${Package}\")

#############################################################################
OUTPUT
T_PTROBJ
	sv_setref_pv($arg, className, (void*)$var);