summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrjray <devnull@localhost>2000-05-22 08:37:02 +0000
committerrjray <devnull@localhost>2000-05-22 08:37:02 +0000
commit14bb8abeb2b4659418b58b29fd8f4a9316b8b228 (patch)
tree855b38e8a2a4374ee3a3b122c6698cdb799e9527
parentc1b186dee0b9d32be73df3e9f2bd114189f43daa (diff)
downloadlibrpm-tizen-14bb8abeb2b4659418b58b29fd8f4a9316b8b228.tar.gz
librpm-tizen-14bb8abeb2b4659418b58b29fd8f4a9316b8b228.tar.bz2
librpm-tizen-14bb8abeb2b4659418b58b29fd8f4a9316b8b228.zip
C type to Perl type mappings
CVS patchset: 3745 CVS date: 2000/05/22 08:37:02
-rw-r--r--Perl-RPM/typemap45
1 files changed, 45 insertions, 0 deletions
diff --git a/Perl-RPM/typemap b/Perl-RPM/typemap
new file mode 100644
index 000000000..0a592a223
--- /dev/null
+++ b/Perl-RPM/typemap
@@ -0,0 +1,45 @@
+# 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;
+ }