2612dfda143848f466ee71273bf062387b1e41c8
[perl.git] / ext / ODBM_File / typemap
1 #
2 #################################### DBM SECTION
3 #
4
5 datum_key               T_DATUM_K
6 datum_key_copy          T_DATUM_K_C
7 datum_value             T_DATUM_V
8 gdatum                  T_GDATUM
9 NDBM_File               T_PTROBJ
10 GDBM_File               T_PTROBJ
11 SDBM_File               T_PTROBJ
12 ODBM_File               T_PTROBJ
13 DB_File                 T_PTROBJ
14 DBZ_File                T_PTROBJ
15 FATALFUNC               T_OPAQUEPTR
16
17 INPUT
18 T_DATUM_K
19         {
20             STRLEN len;
21             DBM_ckFilter($arg, filter[store_key], \"filter_store_key\");
22             $var.dptr = SvPVbyte($arg, len);
23             $var.dsize = (int)len;
24         }
25 T_DATUM_K_C
26         {
27             SV * tmpSV ;
28             STRLEN len;
29             if (db->filter[store_key]){
30                 tmpSV = sv_2mortal(newSVsv($arg));
31                 DBM_ckFilter(tmpSV, filter[store_key], \"filter_store_key\");
32             }
33             else
34                 tmpSV = $arg;
35             $var.dptr = SvPVbyte(tmpSV, len);
36             $var.dsize = (int)len;
37         }
38 T_DATUM_V
39         DBM_ckFilter($arg, filter[store_value], \"filter_store_value\");
40         if (SvOK($arg)) {
41             STRLEN len;
42             $var.dptr = SvPVbyte($arg, len);
43             $var.dsize = (int)len;
44         }
45         else {
46             $var.dptr = \"\";
47             $var.dsize = 0;
48         }
49 T_GDATUM
50         UNIMPLEMENTED
51 OUTPUT
52 T_DATUM_K
53         sv_setpvn($arg, $var.dptr, $var.dsize);
54         DBM_ckFilter($arg, filter[fetch_key],\"filter_fetch_key\");
55 T_DATUM_V
56         sv_setpvn($arg, $var.dptr, $var.dsize);
57         DBM_ckFilter($arg, filter[fetch_value],\"filter_fetch_value\");
58 T_GDATUM
59         sv_usepvn($arg, $var.dptr, $var.dsize);
60 T_PTROBJ
61         sv_setref_pv($arg, dbtype, (void*)$var);