]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/lib/tokyocabinet/tokyocabinet.idl
ebl Add tokyocabinet source to bacula
[bacula/bacula] / bacula / src / lib / tokyocabinet / tokyocabinet.idl
1 /*************************************************************************************************
2  * IDL for bindings of scripting languages
3  *                                                      Copyright (C) 2006-2008 Mikio Hirabayashi
4  * This file is part of Tokyo Cabinet.
5  * Tokyo Cabinet is free software; you can redistribute it and/or modify it under the terms of
6  * the GNU Lesser General Public License as published by the Free Software Foundation; either
7  * version 2.1 of the License or any later version.  Tokyo Cabinet is distributed in the hope
8  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
10  * License for more details.
11  * You should have received a copy of the GNU Lesser General Public License along with Tokyo
12  * Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
13  * Boston, MA 02111-1307 USA.
14  *************************************************************************************************/
15
16
17 /**
18  * namespace of Tokyo Cabinet
19  */
20 module TokyoCabinet {
21   //----------------------------------------------------------------
22   // list of strings (substituted for by the native mechanism).
23   //----------------------------------------------------------------
24   interface List {
25     string get(in long index);
26   };
27   //----------------------------------------------------------------
28   // the error codes
29   //----------------------------------------------------------------
30   interface ECODE {
31     const long ESUCCESS = 0;
32     const long ETHREAD = 1;
33     const long EINVALID = 2;
34     const long ENOFILE = 3;
35     const long ENOPERM = 4;
36     const long EMETA = 5;
37     const long ERHEAD = 6;
38     const long EOPEN = 7;
39     const long ECLOSE = 8;
40     const long ETRUNC = 9;
41     const long ESYNC = 10;
42     const long ESTAT = 11;
43     const long ESEEK = 12;
44     const long EREAD = 13;
45     const long EWRITE = 14;
46     const long EMMAP = 15;
47     const long ELOCK = 16;
48     const long EUNLINK = 17;
49     const long ERENAME = 18;
50     const long EMKDIR = 19;
51     const long ERMDIR = 20;
52     const long EKEEP = 21;
53     const long ENOREC = 22;
54     const long EMISC = 9999;
55     string errmsg(in long ecode);
56   };
57   //----------------------------------------------------------------
58   // the hash database API
59   //----------------------------------------------------------------
60   interface HDB :ECODE {
61     const long TLARGE = 1 << 0;
62     const long TDEFLATE = 1 << 1;
63     const long TTCBS = 1 << 2;
64     const long OREADER = 1 << 0;
65     const long OWRITER = 1 << 1;
66     const long OCREAT = 1 << 2;
67     const long OTRUNC = 1 << 3;
68     const long ONOLCK = 1 << 4;
69     const long OLCKNB = 1 << 5;
70     long ecode();
71     boolean tune(in long long bnum, in long apow, in long fpow, in long opts);
72     boolean setcache(in long rcnum);
73     boolean open(in string path, in long omode);
74     boolean close();
75     boolean put(in string key, in string value);
76     boolean putkeep(in string key, in string value);
77     boolean putcat(in string key, in string value);
78     boolean putasync(in string key, in string value);
79     boolean out(in string key);
80     string get(in string key);
81     long vsiz(in string key);
82     boolean iterinit();
83     string iternext();
84     List fwmkeys(in string prefix, in long max);
85     boolean sync();
86     boolean optimize(in long long bnum, in long apow, in long fpow, in long opts);
87     boolean vanish();
88     boolean copy(in string path);
89     string path();
90     long long rnum();
91     long long fsiz();
92   };
93   //----------------------------------------------------------------
94   // the B+ tree database API
95   //----------------------------------------------------------------
96   interface BDB :ECODE {
97     const long TLARGE = 1 << 0;
98     const long TDEFLATE = 1 << 1;
99     const long TTCBS = 1 << 2;
100     const long OREADER = 1 << 0;
101     const long OWRITER = 1 << 1;
102     const long OCREAT = 1 << 2;
103     const long OTRUNC = 1 << 3;
104     const long ONOLCK = 1 << 4;
105     const long OLCKNB = 1 << 5;
106     long ecode();
107     boolean tune(in long lmemb, in long nmemb,
108                  in long long bnum, in long apow, in long fpow, in long opts);
109     boolean setcache(in long lcnum, in long ncnum);
110     boolean open(in string path, in long omode);
111     boolean close();
112     boolean put(in string key, in string value);
113     boolean putkeep(in string key, in string value);
114     boolean putcat(in string key, in string value);
115     boolean putdup(in string key, in string value);
116     boolean putlist(in string key, in List values);
117     boolean out(in string key);
118     boolean outlist(in string key);
119     string get(in string key);
120     List getlist(in string key);
121     long vnum(in string key);
122     long vsiz(in string key);
123     List range(in string bkey, in boolean binc, in string ekey, in boolean einc, in long max);
124     List fwmkeys(in string prefix, in long max);
125     boolean sync();
126     boolean optimize(in long lmemb, in long nmemb,
127                      in long long bnum, in long apow, in long fpow, in long opts);
128     boolean vanish();
129     boolean copy(in string path);
130     boolean tranbegin();
131     boolean trancommit();
132     boolean tranabort();
133     string path();
134     long long rnum();
135     long long fsiz();
136   };
137   //----------------------------------------------------------------
138   // the B+ tree cursor API
139   //----------------------------------------------------------------
140   interface BDBCUR {
141     const long CPCURRENT = 0;
142     const long CPBEFORE = 1;
143     const long CPAFTER = 2;
144     boolean first();
145     boolean last();
146     boolean jump(in string key);
147     boolean prev();
148     boolean next();
149     boolean put(in string value, in long cpmode);
150     boolean out();
151     string key();
152     string val();
153   };
154 };
155
156
157
158 /* END OF FILE */