# @(#) $Id: typemap 612 2005-03-16 22:11:04Z dom $

# T_PTROBJ_SPECIAL definition derived from the example in perlxs(1).

XML_Genx		T_PTROBJ_SPECIAL
XML_Genx_Namespace	T_PTROBJ_SPECIAL
XML_Genx_Element	T_PTROBJ_SPECIAL
XML_Genx_Attribute	T_PTROBJ_SPECIAL
genxStatus		T_ENUM
utf8			T_PV
constUtf8		T_PV

INPUT
T_PTROBJ_SPECIAL
	if (!SvOK($arg)) {
	    $var = ($type) NULL;
	} else if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")) {
	    IV tmp = SvIV((SV*)SvRV($arg));
	    $var = INT2PTR($type, tmp);
	} else {
	    croak(\"$var is not undef or of type ${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\");
	}

OUTPUT
T_PTROBJ_SPECIAL
	sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\",(void*)$var);
