TYPEMAP
const char * T_PTROBJ
-RPM T_PTROBJ
RPM::Database O_RPM_Database
RPM::Header O_RPM_Header
+RPM::Package O_RPM_Blessed
+RPM::Transaction O_RPM_Blessed
#
# The following mappings for O_HvRV are taken directly from Dean Roehrich's
#
OUTPUT
-
O_RPM_Database
if ($var != Null(RPM__Database))
{
$arg = newSVsv(&PL_sv_undef);
}
-INPUT
+O_RPM_Blessed
+ sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\",
+ (void*)$var);
+INPUT
O_RPM_Database
if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV))
$var = (HV*)SvRV($arg);
\"${Package}::$func_name: not a blessed HV reference\");
XSRETURN_UNDEF;
}
+
+O_RPM_Blessed
+ if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\"))
+ {
+ IV tmp = SvIV((SV*)SvRV($arg));
+ $var = ($type) tmp;
+ }
+ else
+ {
+ rpm_error(aTHX_ RPMERR_BADARG,
+ \"$var is not of type ${ntype}\");
+ XSRETURN_UNDEF;
+ }
\ No newline at end of file