~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/perl/BerkeleyDB/typemap

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# typemap for Perl 5 interface to Berkeley DB version 2 & 3
2
 
#
3
 
# SCCS: %I%, %G%     
4
 
#
5
 
# written by Paul Marquess <Paul.Marquess@btinternet.com>
6
 
#
7
 
#################################### DB SECTION
8
 
#
9
 
10
 
 
11
 
void *                  T_PV
12
 
u_int                   T_U_INT
13
 
u_int32_t               T_U_INT
14
 
const char *            T_PV_NULL
15
 
PV_or_NULL              T_PV_NULL
16
 
IO_or_NULL              T_IO_NULL
17
 
 
18
 
AV *                    T_AV
19
 
 
20
 
BerkeleyDB              T_PTROBJ
21
 
BerkeleyDB::Common      T_PTROBJ_AV
22
 
BerkeleyDB::Hash        T_PTROBJ_AV
23
 
BerkeleyDB::Btree       T_PTROBJ_AV
24
 
BerkeleyDB::Recno       T_PTROBJ_AV
25
 
BerkeleyDB::Queue       T_PTROBJ_AV
26
 
BerkeleyDB::Cursor      T_PTROBJ_AV
27
 
BerkeleyDB::TxnMgr      T_PTROBJ_AV
28
 
BerkeleyDB::Txn         T_PTROBJ_AV
29
 
BerkeleyDB::Log         T_PTROBJ_AV
30
 
BerkeleyDB::Lock        T_PTROBJ_AV
31
 
BerkeleyDB::Env         T_PTROBJ_AV
32
 
 
33
 
BerkeleyDB::Raw         T_RAW
34
 
BerkeleyDB::Common::Raw T_RAW
35
 
BerkeleyDB::Hash::Raw   T_RAW
36
 
BerkeleyDB::Btree::Raw  T_RAW
37
 
BerkeleyDB::Recno::Raw  T_RAW
38
 
BerkeleyDB::Queue::Raw  T_RAW
39
 
BerkeleyDB::Cursor::Raw T_RAW
40
 
BerkeleyDB::TxnMgr::Raw T_RAW
41
 
BerkeleyDB::Txn::Raw    T_RAW
42
 
BerkeleyDB::Log::Raw    T_RAW
43
 
BerkeleyDB::Lock::Raw   T_RAW
44
 
BerkeleyDB::Env::Raw    T_RAW
45
 
 
46
 
BerkeleyDB::Env::Inner  T_INNER
47
 
BerkeleyDB::Common::Inner       T_INNER
48
 
BerkeleyDB::Txn::Inner  T_INNER
49
 
BerkeleyDB::TxnMgr::Inner       T_INNER
50
 
# BerkeleyDB__Env       T_PTR
51
 
DBT                     T_dbtdatum
52
 
DBT_OPT                 T_dbtdatum_opt
53
 
DBT_B                   T_dbtdatum_btree
54
 
DBTKEY                  T_dbtkeydatum
55
 
DBTKEY_B                T_dbtkeydatum_btree
56
 
DBTYPE                  T_U_INT
57
 
DualType                T_DUAL
58
 
BerkeleyDB_type *       T_IV
59
 
BerkeleyDB_ENV_type *   T_IV
60
 
BerkeleyDB_TxnMgr_type * T_IV
61
 
BerkeleyDB_Txn_type *   T_IV
62
 
BerkeleyDB__Cursor_type * T_IV
63
 
DB *                    T_IV
64
 
 
65
 
INPUT
66
 
 
67
 
T_AV
68
 
        if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV)
69
 
        /* if (sv_isa($arg, \"${ntype}\")) */
70
 
            $var = (AV*)SvRV($arg);
71
 
        else
72
 
            croak(\"$var is not an array reference\")
73
 
 
74
 
T_RAW
75
 
        $var = INT2PTR($type,SvIV($arg)
76
 
 
77
 
T_U_INT
78
 
        $var = SvUV($arg)
79
 
 
80
 
T_SV_REF_NULL
81
 
        if ($arg == &PL_sv_undef)
82
 
            $var = NULL ;
83
 
        else if (sv_derived_from($arg, \"${ntype}\")) {
84
 
            IV tmp = SvIV((SV *)GetInternalObject($arg));
85
 
            $var =  INT2PTR($type, tmp);
86
 
        }
87
 
        else
88
 
            croak(\"$var is not of type ${ntype}\")
89
 
 
90
 
T_HV_REF_NULL
91
 
        if ($arg == &PL_sv_undef)
92
 
            $var = NULL ;
93
 
        else if (sv_derived_from($arg, \"${ntype}\")) {
94
 
            HV * hv = (HV *)GetInternalObject($arg);
95
 
            SV ** svp = hv_fetch(hv, \"db\", 2, FALSE);
96
 
            IV tmp = SvIV(*svp);
97
 
            $var =  INT2PTR($type, tmp);
98
 
        }
99
 
        else
100
 
            croak(\"$var is not of type ${ntype}\")
101
 
 
102
 
T_HV_REF
103
 
        if (sv_derived_from($arg, \"${ntype}\")) {
104
 
            HV * hv = (HV *)GetInternalObject($arg);
105
 
            SV ** svp = hv_fetch(hv, \"db\", 2, FALSE);
106
 
            IV tmp = SvIV(*svp);
107
 
            $var =  INT2PTR($type, tmp);
108
 
        }
109
 
        else
110
 
            croak(\"$var is not of type ${ntype}\")
111
 
 
112
 
 
113
 
T_P_REF
114
 
        if (sv_derived_from($arg, \"${ntype}\")) {
115
 
            IV tmp = SvIV((SV*)SvRV($arg));
116
 
            $var = INT2PTR($type, tmp);
117
 
        }
118
 
        else
119
 
            croak(\"$var is not of type ${ntype}\")
120
 
 
121
 
 
122
 
T_INNER
123
 
        {
124
 
            HV * hv = (HV *)SvRV($arg);
125
 
            SV ** svp = hv_fetch(hv, \"db\", 2, FALSE);
126
 
            IV tmp = SvIV(*svp);
127
 
            $var =  INT2PTR($type, tmp);
128
 
        }
129
 
 
130
 
T_PV_NULL
131
 
        if ($arg == &PL_sv_undef)
132
 
            $var = NULL ;
133
 
        else {
134
 
            $var = ($type)SvPV($arg,PL_na) ;
135
 
            if (PL_na == 0)
136
 
                $var = NULL ;
137
 
        }
138
 
 
139
 
T_IO_NULL
140
 
        if ($arg == &PL_sv_undef)
141
 
            $var = NULL ; 
142
 
        else 
143
 
            $var = IoOFP(sv_2io($arg))
144
 
 
145
 
T_PTROBJ_NULL
146
 
        if ($arg == &PL_sv_undef)
147
 
            $var = NULL ;
148
 
        else if (sv_derived_from($arg, \"${ntype}\")) {
149
 
            IV tmp = SvIV((SV*)SvRV($arg));
150
 
            $var = INT2PTR($type, tmp);
151
 
        }
152
 
        else
153
 
            croak(\"$var is not of type ${ntype}\")
154
 
 
155
 
T_PTROBJ_SELF
156
 
        if ($arg == &PL_sv_undef)
157
 
            $var = NULL ;
158
 
        else if (sv_derived_from($arg, \"${ntype}\")) {
159
 
            IV tmp = SvIV((SV*)SvRV($arg));
160
 
            $var = INT2PTR($type, tmp);
161
 
        }
162
 
        else
163
 
            croak(\"$var is not of type ${ntype}\")
164
 
 
165
 
T_PTROBJ_AV
166
 
        if ($arg == &PL_sv_undef || $arg == NULL)
167
 
            $var = NULL ;
168
 
        else if (sv_derived_from($arg, \"${ntype}\")) {
169
 
            IV tmp = SvIV(getInnerObject($arg)) ;
170
 
            $var = INT2PTR($type, tmp);
171
 
        }
172
 
        else
173
 
            croak(\"$var is not of type ${ntype}\")
174
 
 
175
 
T_dbtkeydatum
176
 
        DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
177
 
        DBT_clear($var) ;
178
 
        if (db->recno_or_queue) {
179
 
            Value = GetRecnoKey(db, SvIV($arg)) ; 
180
 
            $var.data = & Value; 
181
 
            $var.size = (int)sizeof(db_recno_t);
182
 
        }
183
 
        else {
184
 
            $var.data = SvPV($arg, PL_na);
185
 
            $var.size = (int)PL_na;
186
 
        }
187
 
 
188
 
T_dbtkeydatum_btree
189
 
        DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
190
 
        DBT_clear($var) ;
191
 
        if (db->recno_or_queue ||
192
 
                (db->type == DB_BTREE && flagSet(DB_SET_RECNO))) {
193
 
            Value = GetRecnoKey(db, SvIV($arg)) ; 
194
 
            $var.data = & Value; 
195
 
            $var.size = (int)sizeof(db_recno_t);
196
 
        }
197
 
        else {
198
 
            $var.data = SvPV($arg, PL_na);
199
 
            $var.size = (int)PL_na;
200
 
        }
201
 
 
202
 
T_dbtdatum
203
 
        DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
204
 
        DBT_clear($var) ;
205
 
        $var.data = SvPV($arg, PL_na);
206
 
        $var.size = (int)PL_na;
207
 
        $var.flags = db->partial ;
208
 
        $var.dlen  = db->dlen ;
209
 
        $var.doff  = db->doff ;
210
 
        
211
 
T_dbtdatum_opt
212
 
        DBT_clear($var) ;
213
 
        if (flagSet(DB_GET_BOTH)) {
214
 
           DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
215
 
           $var.data = SvPV($arg, PL_na);
216
 
           $var.size = (int)PL_na;
217
 
           $var.flags = db->partial ;
218
 
           $var.dlen  = db->dlen ;
219
 
           $var.doff  = db->doff ;
220
 
        }
221
 
        
222
 
T_dbtdatum_btree
223
 
        DBT_clear($var) ;
224
 
        if (flagSet(DB_GET_BOTH)) {
225
 
            DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
226
 
            $var.data = SvPV($arg, PL_na);
227
 
            $var.size = (int)PL_na;
228
 
            $var.flags = db->partial ;
229
 
            $var.dlen  = db->dlen ;
230
 
            $var.doff  = db->doff ;
231
 
        }
232
 
        
233
 
 
234
 
OUTPUT
235
 
 
236
 
T_RAW
237
 
        sv_setiv($arg, PTR2IV($var));
238
 
 
239
 
T_SV_REF_NULL
240
 
        sv_setiv($arg, PTR2IV($var));
241
 
 
242
 
T_HV_REF_NULL
243
 
        sv_setiv($arg, PTR2IV($var));
244
 
 
245
 
T_HV_REF
246
 
        sv_setiv($arg, PTR2IV($var));
247
 
 
248
 
T_P_REF
249
 
        sv_setiv($arg, PTR2IV($var));
250
 
 
251
 
T_DUAL
252
 
        setDUALerrno($arg, $var) ;
253
 
 
254
 
T_U_INT
255
 
        sv_setuv($arg, (UV)$var);
256
 
 
257
 
T_PV_NULL
258
 
        sv_setpv((SV*)$arg, $var);
259
 
 
260
 
T_dbtkeydatum_btree
261
 
        OutputKey_B($arg, $var)
262
 
T_dbtkeydatum
263
 
        OutputKey($arg, $var)
264
 
T_dbtdatum
265
 
        OutputValue($arg, $var)
266
 
T_dbtdatum_opt
267
 
        OutputValue($arg, $var)
268
 
T_dbtdatum_btree
269
 
        OutputValue_B($arg, $var)
270
 
 
271
 
T_PTROBJ_NULL
272
 
        sv_setref_pv($arg, \"${ntype}\", (void*)$var);
273
 
 
274
 
T_PTROBJ_SELF
275
 
        sv_setref_pv($arg, self, (void*)$var);