The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
TYPEMAP
Net_Lorcon *	T_PTROBJ_SPECIAL

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

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