-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtokyocabinet.idl
executable file
·336 lines (331 loc) · 11.8 KB
/
tokyocabinet.idl
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/*************************************************************************************************
* IDL for bindings of scripting languages
* Copyright (C) 2006-2011 FAL Labs
* This file is part of Tokyo Cabinet.
* Tokyo Cabinet is free software; you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software Foundation; either
* version 2.1 of the License or any later version. Tokyo Cabinet is distributed in the hope
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
* You should have received a copy of the GNU Lesser General Public License along with Tokyo
* Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA.
*************************************************************************************************/
/**
* namespace of Tokyo Cabinet
*/
module tokyocabinet {
//----------------------------------------------------------------
// list of strings (substituted for by the native mechanism)
//----------------------------------------------------------------
interface List {
string get(in long index);
};
//----------------------------------------------------------------
// map of strings (substituted for by the native mechanism)
//----------------------------------------------------------------
interface Map {
string get(in string key);
};
//----------------------------------------------------------------
// the error codes
//----------------------------------------------------------------
interface ECODE {
const long ESUCCESS = 0;
const long ETHREAD = 1;
const long EINVALID = 2;
const long ENOFILE = 3;
const long ENOPERM = 4;
const long EMETA = 5;
const long ERHEAD = 6;
const long EOPEN = 7;
const long ECLOSE = 8;
const long ETRUNC = 9;
const long ESYNC = 10;
const long ESTAT = 11;
const long ESEEK = 12;
const long EREAD = 13;
const long EWRITE = 14;
const long EMMAP = 15;
const long ELOCK = 16;
const long EUNLINK = 17;
const long ERENAME = 18;
const long EMKDIR = 19;
const long ERMDIR = 20;
const long EKEEP = 21;
const long ENOREC = 22;
const long EMISC = 9999;
long ecode();
string errmsg(in long ecode);
};
//----------------------------------------------------------------
// the hash database API
//----------------------------------------------------------------
interface HDB :ECODE {
const long TLARGE = 1 << 0;
const long TDEFLATE = 1 << 1;
const long TBZIP = 1 << 2;
const long TTCBS = 1 << 3;
const long OREADER = 1 << 0;
const long OWRITER = 1 << 1;
const long OCREAT = 1 << 2;
const long OTRUNC = 1 << 3;
const long ONOLCK = 1 << 4;
const long OLCKNB = 1 << 5;
const long OTSYNC = 1 << 6;
boolean tune(in long long bnum, in long apow, in long fpow, in long opts);
boolean setcache(in long rcnum);
boolean setxmsiz(in long long xmsiz);
boolean setdfunit(in long dfunit);
boolean open(in string path, in long omode);
boolean close();
boolean put(in string key, in string value);
boolean putkeep(in string key, in string value);
boolean putcat(in string key, in string value);
boolean putasync(in string key, in string value);
boolean out(in string key);
string get(in string key);
long vsiz(in string key);
boolean iterinit();
string iternext();
List fwmkeys(in string prefix, in long max);
long addint(in string key, in long num);
double adddouble(in string key, in double num);
boolean sync();
boolean optimize(in long long bnum, in long apow, in long fpow, in long opts);
boolean vanish();
boolean copy(in string path);
boolean tranbegin();
boolean trancommit();
boolean tranabort();
string path();
long long rnum();
long long fsiz();
};
//----------------------------------------------------------------
// the B+ tree database API
//----------------------------------------------------------------
interface BDB :ECODE {
const long TLARGE = 1 << 0;
const long TDEFLATE = 1 << 1;
const long TBZIP = 1 << 2;
const long TTCBS = 1 << 3;
const long OREADER = 1 << 0;
const long OWRITER = 1 << 1;
const long OCREAT = 1 << 2;
const long OTRUNC = 1 << 3;
const long ONOLCK = 1 << 4;
const long OLCKNB = 1 << 5;
const long OTSYNC = 1 << 6;
boolean tune(in long lmemb, in long nmemb,
in long long bnum, in long apow, in long fpow, in long opts);
boolean setcache(in long lcnum, in long ncnum);
boolean setxmsiz(in long long xmsiz);
boolean setdfunit(in long dfunit);
boolean open(in string path, in long omode);
boolean close();
boolean put(in string key, in string value);
boolean putkeep(in string key, in string value);
boolean putcat(in string key, in string value);
boolean putdup(in string key, in string value);
boolean putlist(in string key, in List values);
boolean out(in string key);
boolean outlist(in string key);
string get(in string key);
List getlist(in string key);
long vnum(in string key);
long vsiz(in string key);
List range(in string bkey, in boolean binc, in string ekey, in boolean einc, in long max);
List fwmkeys(in string prefix, in long max);
long addint(in string key, in long num);
double adddouble(in string key, in double num);
boolean sync();
boolean optimize(in long lmemb, in long nmemb,
in long long bnum, in long apow, in long fpow, in long opts);
boolean vanish();
boolean copy(in string path);
boolean tranbegin();
boolean trancommit();
boolean tranabort();
string path();
long long rnum();
long long fsiz();
};
//----------------------------------------------------------------
// the B+ tree cursor API
//----------------------------------------------------------------
interface BDBCUR {
const long CPCURRENT = 0;
const long CPBEFORE = 1;
const long CPAFTER = 2;
boolean first();
boolean last();
boolean jump(in string key);
boolean prev();
boolean next();
boolean put(in string value, in long cpmode);
boolean out();
string key();
string val();
};
//----------------------------------------------------------------
// the fixed-length database API
//----------------------------------------------------------------
interface FDB :ECODE {
const long OREADER = 1 << 0;
const long OWRITER = 1 << 1;
const long OCREAT = 1 << 2;
const long OTRUNC = 1 << 3;
const long ONOLCK = 1 << 4;
const long OLCKNB = 1 << 5;
const long OTSYNC = 1 << 6;
boolean tune(in long width, in long long limsiz);
boolean open(in string path, in long omode);
boolean close();
boolean put(in string key, in string value);
boolean putkeep(in string key, in string value);
boolean putcat(in string key, in string value);
boolean out(in string key);
string get(in string key);
long vsiz(in string key);
boolean iterinit();
string iternext();
List range(in string interval, in long max);
long addint(in string key, in long num);
double adddouble(in string key, in double num);
boolean sync();
boolean optimize(in long width, in long long limsiz);
boolean vanish();
boolean copy(in string path);
boolean tranbegin();
boolean trancommit();
boolean tranabort();
string path();
long long rnum();
long long fsiz();
};
//----------------------------------------------------------------
// the table database API
//----------------------------------------------------------------
interface TDB :ECODE {
const long TLARGE = 1 << 0;
const long TDEFLATE = 1 << 1;
const long TBZIP = 1 << 2;
const long TTCBS = 1 << 3;
const long OREADER = 1 << 0;
const long OWRITER = 1 << 1;
const long OCREAT = 1 << 2;
const long OTRUNC = 1 << 3;
const long ONOLCK = 1 << 4;
const long OLCKNB = 1 << 5;
const long OTSYNC = 1 << 6;
const long ITLEXICAL = 0;
const long ITDECIMAL = 1;
const long ITTOKEN = 2;
const long ITQGRAM = 3;
const long ITOPT = 9998;
const long ITVOID = 9999;
const long ITKEEP = 1 << 24;
boolean tune(in long long bnum, in long apow, in long fpow, in long opts);
boolean setcache(in long rcnum, in long lcnum, in long ncnum);
boolean setxmsiz(in long long xmsiz);
boolean setdfunit(in long dfunit);
boolean open(in string path, in long omode);
boolean close();
boolean put(in string pkey, in Map cols);
boolean putkeep(in string pkey, in Map cols);
boolean putcat(in string pkey, in Map cols);
boolean out(in string pkey);
Map get(in string pkey);
long vsiz(in string pkey);
boolean iterinit();
string iternext();
List fwmkeys(in string prefix, in long max);
long addint(in string pkey, in long num);
double adddouble(in string pkey, in double num);
boolean sync();
boolean optimize(in long long bnum, in long apow, in long fpow, in long opts);
boolean vanish();
boolean copy(in string path);
boolean tranbegin();
boolean trancommit();
boolean tranabort();
string path();
long long rnum();
long long fsiz();
boolean setindex(in string name, in long type);
long long genuid();
};
//----------------------------------------------------------------
// the table query API
//----------------------------------------------------------------
interface TDBQRY {
const long QCSTREQ = 0;
const long QCSTRINC = 1;
const long QCSTRBW = 2;
const long QCSTREW = 3;
const long QCSTRAND = 4;
const long QCSTROR = 5;
const long QCSTROREQ = 6;
const long QCSTRRX = 7;
const long QCNUMEQ = 8;
const long QCNUMGT = 9;
const long QCNUMGE = 10;
const long QCNUMLT = 11;
const long QCNUMLE = 12;
const long QCNUMBT = 13;
const long QCNUMOREQ = 14;
const long QCFTSPH = 15;
const long QCFTSAND = 16;
const long QCFTSOR = 17;
const long QCFTSEX = 18;
const long QCNEGATE = 1 << 24;
const long QCNOIDX = 1 << 25;
const long QOSTRASC = 0;
const long QOSTRDESC = 1;
const long QONUMASC = 2;
const long QONUMDESC = 3;
const long MSUNION = 0;
const long MSISECT = 1;
const long MSDIFF = 2;
void addcond(in string name, in long op, in string expr);
void setorder(in string name, in long type);
void setlimit(in long max, in long skip);
List search();
boolean searchout();
string hint();
typedef sequence<TDBQRY> QueryList;
List metasearch(in QueryList qrys, in long type);
};
//----------------------------------------------------------------
// the abstract database API
//----------------------------------------------------------------
interface ADB {
boolean open(in string name);
boolean close();
boolean put(in string key, in string value);
boolean putkeep(in string key, in string value);
boolean putcat(in string key, in string value);
boolean out(in string key);
string get(in string key);
long vsiz(in string key);
boolean iterinit();
string iternext();
List fwmkeys(in string prefix, in long max);
long addint(in string key, in long num);
double adddouble(in string key, in double num);
boolean sync();
boolean optimize(in string params);
boolean vanish();
boolean copy(in string path);
boolean tranbegin();
boolean trancommit();
boolean tranabort();
string path();
long long rnum();
long long size();
List misc(in string name, in List args);
};
};
/* END OF FILE */