/************************************************************************************************* * IDL for bindings of scripting languages * Copyright (C) 2006-2008 Mikio Hirabayashi * 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); }; //---------------------------------------------------------------- // 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; string errmsg(in long ecode); }; //---------------------------------------------------------------- // the hash database API //---------------------------------------------------------------- interface HDB :ECODE { const long TLARGE = 1 << 0; const long TDEFLATE = 1 << 1; const long TTCBS = 1 << 2; 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; long ecode(); boolean tune(in long long bnum, in long apow, in long fpow, in long opts); boolean setcache(in long rcnum); 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); boolean sync(); boolean optimize(in long long bnum, in long apow, in long fpow, in long opts); boolean vanish(); boolean copy(in string path); 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 TTCBS = 1 << 2; 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; long ecode(); 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 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); 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(); }; }; /* END OF FILE */