struct hid_device_info *                    T_PTROBJ
hid_device *                                T_PTROBJ
const unsigned char *                       T_PV
const wchar_t *                             T_NULLABLE_PTR

INPUT
#####

T_NULLABLE_PTR
    if ( !SvOK( $arg ) ) {  /* if not defined */
        $var = NULL;
    }
    else if ( sv_derived_from( $arg, \"${ntype}\" ) ) {
        IV tmp = SvIV( (SV*)SvRV( $arg ) );
        $var = INT2PTR( $type, tmp );
    }
    else {
        Perl_croak( aTHX_ \"$var is not of type ${ntype}\" );
    }

OUTPUT
######

T_NULLABLE_PTR
    if ( $var )  /* if defined */
        sv_setref_pv( $arg, \"${ntype}\", (void*)$var );
    else
        $arg = &PL_sv_undef;
