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

INPUT
MPZ
        if (sv_derived_from($arg, \"Math::GMP\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = ($type) tmp;
        }
        else
            croak(\"$var is not of type Math::GMP\")

OUTPUT
MPZ
	sv_setref_pv($arg, \"Math::GMP\", (void*)$var);