-
Notifications
You must be signed in to change notification settings - Fork 3
/
typemap
57 lines (53 loc) · 1.36 KB
/
typemap
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
# typemap for Perl 5 interface to Berkeley
#
# written by Paul Marquess <pmqs@cpan.org>
# last modified 20th June 2004
# version 1.809
#
#################################### DB SECTION
#
#
u_int T_U_INT
DB_File T_PTROBJ
DBT T_dbtdatum
DBTKEY T_dbtkeydatum
INPUT
T_dbtkeydatum
{
SV * my_sv = $arg;
DBM_ckFilter(my_sv, filter_store_key, \"filter_store_key\");
DBT_clear($var) ;
SvGETMAGIC(my_sv) ;
if (db->type == DB_RECNO) {
if (SvOK(my_sv))
Value = GetRecnoKey(aTHX_ db, SvIV(my_sv)) ;
else
Value = 1 ;
$var.data = & Value;
$var.size = (int)sizeof(recno_t);
}
else if (SvOK(my_sv)) {
STRLEN len;
$var.data = SvPVbyte(my_sv, len);
$var.size = (int)len;
}
}
T_dbtdatum
{
SV * my_sv = $arg;
DBM_ckFilter(my_sv, filter_store_value, \"filter_store_value\");
DBT_clear($var) ;
SvGETMAGIC(my_sv) ;
if (SvOK(my_sv)) {
STRLEN len;
$var.data = SvPVbyte(my_sv, len);
$var.size = (int)len;
}
}
OUTPUT
T_dbtkeydatum
OutputKey($arg, $var)
T_dbtdatum
OutputValue($arg, $var)
T_PTROBJ
sv_setref_pv($arg, dbtype, (void*)$var);