The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#
# Map C types to Perl types
#

struct in_addr *		T_PTROBJ

#
# Input conversions
#

INPUT

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

#
# Output conversions
#

OUTPUT

T_PTROBJ
	sv_setref_pv($arg, \"${ntype}\", (void*)$var);