Newer
Older
NetAddr-IP / Lite / Util / typemap
@Luis Muñoz Luis Muñoz on 21 Oct 2014 354 bytes Import of LUISMUNOZ/NetAddr-IP-4.001 from CPAN.
#
# 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);