]> gitweb.factorcode.org Git - factor.git/blob - extra/tokyo/alien/tcadb/tcadb.factor
cb2a805cba6352cd70cc3a3eb06cb729b98cc88d
[factor.git] / extra / tokyo / alien / tcadb / tcadb.factor
1 ! Copyright (C) 2009 Bruno Deferrari
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types alien.libraries alien.syntax
4 combinators kernel tokyo.alien.tchdb tokyo.alien.tcutil
5 tokyo.alien.tcbdb tokyo.alien.tcfdb tokyo.alien.tctdb ;
6 IN: tokyo.alien.tcadb
7
8 LIBRARY: tokyocabinet
9
10 TYPEDEF: void* TCADB
11
12 ENUM: f
13     ADBOVOID
14     ADBOMDB
15     ADBONDB
16     ADBOHDB
17     ADBOBDB
18     ADBOFDB
19     ADBOTDB
20     ADBOSKEL ;
21
22 FUNCTION: TCADB* tcadbnew ( ) ;
23 FUNCTION: void tcadbdel ( TCADB* adb ) ;
24 FUNCTION: bool tcadbopen ( TCADB* adb, c-string name ) ;
25 FUNCTION: bool tcadbclose ( TCADB* adb ) ;
26 FUNCTION: bool tcadbput ( TCADB* adb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ;
27 FUNCTION: bool tcadbput2 ( TCADB* adb, c-string kstr, c-string vstr ) ;
28 FUNCTION: bool tcadbputkeep ( TCADB* adb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ;
29 FUNCTION: bool tcadbputkeep2 ( TCADB* adb, c-string kstr, c-string vstr ) ;
30 FUNCTION: bool tcadbputcat ( TCADB* adb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ;
31 FUNCTION: bool tcadbputcat2 ( TCADB* adb, c-string kstr, c-string vstr ) ;
32 FUNCTION: bool tcadbout ( TCADB* adb, void* kbuf, int ksiz ) ;
33 FUNCTION: bool tcadbout2 ( TCADB* adb, c-string kstr ) ;
34 FUNCTION: void* tcadbget ( TCADB* adb, void* kbuf, int ksiz, int* sp ) ;
35 FUNCTION: c-string tcadbget2 ( TCADB* adb, c-string kstr ) ;
36 FUNCTION: int tcadbvsiz ( TCADB* adb, void* kbuf, int ksiz ) ;
37 FUNCTION: int tcadbvsiz2 ( TCADB* adb, c-string kstr ) ;
38 FUNCTION: bool tcadbiterinit ( TCADB* adb ) ;
39 FUNCTION: void* tcadbiternext ( TCADB* adb, int* sp ) ;
40 FUNCTION: c-string tcadbiternext2 ( TCADB* adb ) ;
41 FUNCTION: TCLIST* tcadbfwmkeys ( TCADB* adb, void* pbuf, int psiz, int max ) ;
42 FUNCTION: TCLIST* tcadbfwmkeys2 ( TCADB* adb, c-string pstr, int max ) ;
43 FUNCTION: int tcadbaddint ( TCADB* adb, void* kbuf, int ksiz, int num ) ;
44 FUNCTION: double tcadbadddouble ( TCADB* adb, void* kbuf, int ksiz, double num ) ;
45 FUNCTION: bool tcadbsync ( TCADB* adb ) ;
46 FUNCTION: bool tcadboptimize ( TCADB* adb, c-string params ) ;
47 FUNCTION: bool tcadbvanish ( TCADB* adb ) ;
48 FUNCTION: bool tcadbcopy ( TCADB* adb, c-string path ) ;
49 FUNCTION: bool tcadbtranbegin ( TCADB* adb ) ;
50 FUNCTION: bool tcadbtrancommit ( TCADB* adb ) ;
51 FUNCTION: bool tcadbtranabort ( TCADB* adb ) ;
52 FUNCTION: c-string tcadbpath ( TCADB* adb ) ;
53 FUNCTION: ulonglong tcadbrnum ( TCADB* adb ) ;
54 FUNCTION: ulonglong tcadbsize ( TCADB* adb ) ;
55 FUNCTION: TCLIST* tcadbmisc ( TCADB* adb, c-string name, TCLIST* args ) ;
56
57 ! -----
58
59 TYPEDEF: void* ADBSKEL
60
61 TYPEDEF: void* ADBMAPPROC
62
63 FUNCTION: bool tcadbsetskel ( TCADB* adb, ADBSKEL* skel ) ;
64 FUNCTION: int tcadbomode ( TCADB* adb ) ;
65 FUNCTION: void* tcadbreveal ( TCADB* adb ) ;
66 FUNCTION: bool tcadbputproc ( TCADB* adb, void* kbuf, int ksiz, void* vbuf, int vsiz, TCPDPROC proc, void* op ) ;
67 FUNCTION: bool tcadbforeach ( TCADB* adb, TCITER iter, void* op ) ;
68 FUNCTION: bool tcadbmapbdb ( TCADB* adb, TCLIST* keys, TCBDB* bdb, ADBMAPPROC proc, void* op, longlong csiz ) ;
69 FUNCTION: bool tcadbmapbdbemit ( void* map, c-string kbuf, int ksiz, c-string vbuf, int vsiz ) ;