doc: Add guestfish 'lvcreate 1M' gotcha.
[libguestfs.git] / perl / typemap
1 TYPEMAP
2 char *          T_PV
3 const char *    T_PV
4 guestfs_h *     O_OBJECT_guestfs_h
5 int64_t         T_IV
6
7 INPUT
8 O_OBJECT_guestfs_h
9     if (sv_isobject ($arg) && sv_derived_from ($arg, \"Sys::Guestfs\") &&
10         SvTYPE ($arg) == SVt_RV &&
11         SvTYPE (SvRV ($arg)) == SVt_PVHV) {
12         HV *hv = (HV *) SvRV ($arg);
13         SV **svp = hv_fetch (hv, \"_g\", 2, 0);
14         if (svp == NULL)
15             croak (\"${Package}::$func_name(): called on a closed handle\");
16         $var = ($type) SvIV (*svp);
17     } else {
18         croak (\"${Package}::$func_name(): $var is not a blessed HV reference\");
19     }
20
21 OUTPUT
22 O_OBJECT_guestfs_h
23     sv_setiv ($arg, PTR2IV ($var));