summaryrefslogtreecommitdiffstats
path: root/perl/typemap
diff options
context:
space:
mode:
Diffstat (limited to 'perl/typemap')
-rw-r--r--perl/typemap18
1 files changed, 18 insertions, 0 deletions
diff --git a/perl/typemap b/perl/typemap
new file mode 100644
index 0000000..752ca0d
--- /dev/null
+++ b/perl/typemap
@@ -0,0 +1,18 @@
+TYPEMAP
+char * T_PV
+const char * T_PV
+guestfs_h * O_OBJECT_guestfs_h
+int64_t T_IV
+
+INPUT
+O_OBJECT_guestfs_h
+ if (sv_isobject ($arg) && SvTYPE (SvRV ($arg)) == SVt_PVMG)
+ $var = ($type) SvIV ((SV *) SvRV ($arg));
+ else {
+ warn (\"${Package}::$func_name(): $var is not a blessed SV reference\");
+ XSRETURN_UNDEF;
+ }
+
+OUTPUT
+O_OBJECT_guestfs_h
+ sv_setref_pv ($arg, "Sys::Guestfs", (void *) $var);