--- /dev/null
+# Treat this as -*- text -*-
+
+TYPEMAP
+
+const char * T_PTROBJ
+RPM T_PTROBJ
+RPM::Database O_RPM_Database
+RPM::Header O_RPM_Header
+
+#
+# The following mappings for O_HvRV are taken directly from Dean Roehrich's
+# excellent XS Cookbook, vol. A.
+#
+
+OUTPUT
+
+O_RPM_Database
+ $arg = sv_bless(newRV_noinc((SV*)$var),
+ gv_stashpv("RPM::Database", TRUE));
+ hv_magic($var, (GV *)Nullhv, 'P');
+
+O_RPM_Header
+ $arg = sv_bless(newRV_noinc((SV*)$var),
+ gv_stashpv("RPM::Header", TRUE));
+ hv_magic($var, (GV *)Nullhv, 'P');
+
+INPUT
+
+O_RPM_Database
+ if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV))
+ $var = (HV*)SvRV($arg);
+ else
+ {
+ warn(\"${Package}::$func_name() -- $var is not a blessed HV reference\");
+ XSRETURN_UNDEF;
+ }
+
+O_RPM_Header
+ if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVHV))
+ $var = (HV*)SvRV($arg);
+ else
+ {
+ warn(\"${Package}::$func_name() -- $var is not a blessed HV reference\");
+ XSRETURN_UNDEF;
+ }