summaryrefslogtreecommitdiffabout
path: root/typemap
blob: 695ce9d91d6f5580a143e869b61d979cc1689677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
#################################### DBM SECTION
#

datum_key		T_DATUM_K
datum_key_copy		T_DATUM_K
datum_value		T_DATUM_V
NDBM_File		T_PTROBJ
GDBM_File		T_PTROBJ
SDBM_File		T_PTROBJ
ODBM_File		T_PTROBJ
DB_File			T_PTROBJ
DBZ_File		T_PTROBJ
gdbm_count_t            T_COUNT

INPUT
T_DATUM_K
	DBM_ckFilter($arg, filter[store_key], \"filter_store_key\");
	{
	    STRLEN len;
	    $var.dptr = SvPVbyte($arg, len);
	    $var.dsize = (int)len;
	}
T_DATUM_K_C
	{
	    SV * tmpSV;
	    STRLEN len;
	    if (db->filter[store_key]) {
	        tmpSV = sv_2mortal(newSVsv($arg)); 
	        DBM_ckFilter(tmpSV, filter[store_key], \"filter_store_key\");
            }
            else
                tmpSV = $arg;
	    $var.dptr = SvPVbyte(tmpSV, len);
	    $var.dsize = (int)len;
	}
T_DATUM_V
        DBM_ckFilter($arg, filter[store_value], \"filter_store_value\");
	if (SvOK($arg)) {
	    STRLEN len;
	    $var.dptr = SvPVbyte($arg, len);
	    $var.dsize = (int)len;
	}
	else {
	    $var.dptr = (char *)\"\";	
	    /* better would be for .dptr to be const char * */
	    $var.dsize = 0;
	}
OUTPUT
T_DATUM_K
	output_datum(aTHX_ $arg, $var.dptr, $var.dsize);
	DBM_ckFilter($arg, filter[fetch_key],\"filter_fetch_key\");
T_DATUM_V
	output_datum(aTHX_ $arg, $var.dptr, $var.dsize);
	DBM_ckFilter($arg, filter[fetch_value],\"filter_fetch_value\");
T_PTROBJ
        sv_setref_pv($arg, dbtype, (void*)$var);
T_COUNT
        sv_setuv($arg, (UV)$var);

Return to:

Send suggestions and report system problems to the System administrator.