]> gitweb.factorcode.org Git - factor.git/blob - extra/tokyo/alien/tchdb/tchdb.factor
factor: trim using lists
[factor.git] / extra / tokyo / alien / tchdb / tchdb.factor
1 ! Copyright (C) 2009 Bruno Deferrari
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax tokyo.alien.tcutil ;
4 IN: tokyo.alien.tchdb
5
6 LIBRARY: tokyocabinet
7
8 C-TYPE: TCXSTR
9 C-TYPE: TCHDB
10
11 CONSTANT: HDBFOPEN  1
12 CONSTANT: HDBFFATAL 2
13
14 CONSTANT: HDBTLARGE   1
15 CONSTANT: HDBTDEFLATE 2
16 CONSTANT: HDBTBZIP    4
17 CONSTANT: HDBTTCBS    8
18 CONSTANT: HDBTEXCODEC 16
19
20 CONSTANT: HDBOREADER 1
21 CONSTANT: HDBOWRITER 2
22 CONSTANT: HDBOCREAT  4
23 CONSTANT: HDBOTRUNC  8
24 CONSTANT: HDBONOLCK  16
25 CONSTANT: HDBOLCKNB  32
26 CONSTANT: HDBOTSYNC  64
27
28 FUNCTION: c-string tchdberrmsg ( int ecode )
29 FUNCTION: TCHDB* tchdbnew ( )
30 FUNCTION: void tchdbdel ( TCHDB* hdb )
31 FUNCTION: int tchdbecode ( TCHDB* hdb )
32 FUNCTION: bool tchdbsetmutex ( TCHDB* hdb )
33 FUNCTION: bool tchdbtune ( TCHDB* hdb, longlong bnum, char apow, char fpow, uchar opts )
34 FUNCTION: bool tchdbsetcache ( TCHDB* hdb, int rcnum )
35 FUNCTION: bool tchdbsetxmsiz ( TCHDB* hdb, longlong xmsiz )
36 FUNCTION: bool tchdbopen ( TCHDB* hdb, c-string path, int omode )
37 FUNCTION: bool tchdbclose ( TCHDB* hdb )
38 FUNCTION: bool tchdbput ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz )
39 FUNCTION: bool tchdbput2 ( TCHDB* hdb, c-string kstr, c-string vstr )
40 FUNCTION: bool tchdbputkeep ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz )
41 FUNCTION: bool tchdbputkeep2 ( TCHDB* hdb, c-string kstr, c-string vstr )
42 FUNCTION: bool tchdbputcat ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz )
43 FUNCTION: bool tchdbputcat2 ( TCHDB* hdb, c-string kstr, c-string vstr )
44 FUNCTION: bool tchdbputasync ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz )
45 FUNCTION: bool tchdbputasync2 ( TCHDB* hdb, c-string kstr, c-string vstr )
46 FUNCTION: bool tchdbout ( TCHDB* hdb, void* kbuf, int ksiz )
47 FUNCTION: bool tchdbout2 ( TCHDB* hdb, c-string kstr )
48 FUNCTION: void* tchdbget ( TCHDB* hdb, void* kbuf, int ksiz, int* sp )
49 FUNCTION: c-string tchdbget2 ( TCHDB* hdb, c-string kstr )
50 FUNCTION: int tchdbget3 ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int max )
51 FUNCTION: int tchdbvsiz ( TCHDB* hdb, void* kbuf, int ksiz )
52 FUNCTION: int tchdbvsiz2 ( TCHDB* hdb, c-string kstr )
53 FUNCTION: bool tchdbiterinit ( TCHDB* hdb )
54 FUNCTION: void* tchdbiternext ( TCHDB* hdb, int* sp )
55 FUNCTION: c-string tchdbiternext2 ( TCHDB* hdb )
56 FUNCTION: bool tchdbiternext3 ( TCHDB* hdb, TCXSTR* kxstr, TCXSTR* vxstr )
57 FUNCTION: TCLIST* tchdbfwmkeys ( TCHDB* hdb, void* pbuf, int psiz, int max )
58 FUNCTION: TCLIST* tchdbfwmkeys2 ( TCHDB* hdb, c-string pstr, int max )
59 FUNCTION: int tchdbaddint ( TCHDB* hdb, void* kbuf, int ksiz, int num )
60 FUNCTION: double tchdbadddouble ( TCHDB* hdb, void* kbuf, int ksiz, double num )
61 FUNCTION: bool tchdbsync ( TCHDB* hdb )
62 FUNCTION: bool tchdboptimize ( TCHDB* hdb, longlong bnum, char apow, char fpow, uchar opts )
63 FUNCTION: bool tchdbvanish ( TCHDB* hdb )
64 FUNCTION: bool tchdbcopy ( TCHDB* hdb, c-string path )
65 FUNCTION: bool tchdbtranbegin ( TCHDB* hdb )
66 FUNCTION: bool tchdbtrancommit ( TCHDB* hdb )
67 FUNCTION: bool tchdbtranabort ( TCHDB* hdb )
68 FUNCTION: c-string tchdbpath ( TCHDB* hdb )
69 FUNCTION: ulonglong tchdbrnum ( TCHDB* hdb )
70 FUNCTION: ulonglong tchdbfsiz ( TCHDB* hdb )
71
72 ! --------
73
74 FUNCTION: void tchdbsetecode ( TCHDB* hdb, int ecode, c-string filename, int line, c-string func )
75 FUNCTION: void tchdbsettype ( TCHDB* hdb, uchar type )
76 FUNCTION: void tchdbsetdbgfd ( TCHDB* hdb, int fd )
77 FUNCTION: int tchdbdbgfd ( TCHDB* hdb )
78 FUNCTION: bool tchdbhasmutex ( TCHDB* hdb )
79 FUNCTION: bool tchdbmemsync ( TCHDB* hdb, bool phys )
80 FUNCTION: bool tchdbcacheclear ( TCHDB* hdb )
81 FUNCTION: ulonglong tchdbbnum ( TCHDB* hdb )
82 FUNCTION: uint tchdbalign ( TCHDB* hdb )
83 FUNCTION: uint tchdbfbpmax ( TCHDB* hdb )
84 FUNCTION: ulonglong tchdbxmsiz ( TCHDB* hdb )
85 FUNCTION: ulonglong tchdbinode ( TCHDB* hdb )
86 FUNCTION: tokyo_time_t tchdbmtime ( TCHDB* hdb )
87 FUNCTION: int tchdbomode ( TCHDB* hdb )
88 FUNCTION: uchar tchdbtype ( TCHDB* hdb )
89 FUNCTION: uchar tchdbflags ( TCHDB* hdb )
90 FUNCTION: uchar tchdbopts ( TCHDB* hdb )
91 FUNCTION: c-string tchdbopaque ( TCHDB* hdb )
92 FUNCTION: ulonglong tchdbbnumused ( TCHDB* hdb )
93 FUNCTION: bool tchdbsetcodecfunc ( TCHDB* hdb, TCCODEC enc, void* encop, TCCODEC dec, void* decop )
94 FUNCTION: void tchdbcodecfunc ( TCHDB* hdb, TCCODEC* ep, void* *eop, TCCODEC* dp, void* *dop )
95 FUNCTION: bool tchdbputproc ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz, TCPDPROC proc, void* op )
96 FUNCTION: void* tchdbgetnext ( TCHDB* hdb, void* kbuf, int ksiz, int* sp )
97 FUNCTION: c-string tchdbgetnext2 ( TCHDB* hdb, c-string kstr )
98 FUNCTION: c-string tchdbgetnext3 ( TCHDB* hdb, c-string kbuf, int ksiz, int* sp, c-string *vbp, int* vsp )
99 FUNCTION: bool tchdbforeach ( TCHDB* hdb, TCITER iter, void* op )
100 FUNCTION: bool tchdbtranvoid ( TCHDB* hdb )