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