873681619f36b74ef76066ff4a75cf62eba016c3
[perl.git] / ext / Compress-Raw-Bzip2 / typemap
1 Compress::Raw::Bzip2             T_PTROBJ
2 Compress::Raw::Bunzip2             T_PTROBJ
3
4 const char *                    T_PV
5 char *                          T_PV
6 uLong                           T_UV
7 z_off_t                         T_UV
8 DualType                        T_DUAL
9 int_undef           T_IV_undef
10
11
12 #############################################################################
13 INPUT
14 T_UV
15         $var = (unsigned long)SvUV($arg)
16 T_IV_undef
17         if (SvOK($arg))
18         $var = SvIV($arg);
19     else
20         $var = 0 ;
21 T_PV
22         if (SvOK($arg))
23             $var = ($type)SvPVbyte_nolen($arg);
24         else
25             $var = NULL ;
26
27 T_PTROBJ_AV
28         if ($arg == &PL_sv_undef || $arg == NULL)
29             $var = NULL ;
30         else if (sv_derived_from($arg, \"${ntype}\")) {
31             IV tmp = SvIV(getInnerObject($arg)) ;
32             $var = INT2PTR($type, tmp);
33             
34         }
35         else
36             croak(\"$var is not of type ${ntype}\")
37
38
39
40 #############################################################################
41 OUTPUT
42 T_UV
43         sv_setuv($arg, (IV)$var);
44
45
46 T_DUAL
47         setDUALstatus($arg, $var) ;
48
49
50 T_PV
51         sv_setpv((SV*)$arg, $var);
52         
53
54