]> gitweb.factorcode.org Git - factor.git/blob - extra/tokyo/alien/tcutil/tcutil.factor
factor: trim using lists
[factor.git] / extra / tokyo / alien / tcutil / tcutil.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 system ;
5 IN: tokyo.alien.tcutil
6
7 << "tokyocabinet" {
8     { [ os macosx? ] [ "libtokyocabinet.dylib" ] }
9     { [ os unix? ] [ "libtokyocabinet.so" ] }
10     { [ os windows? ] [ "tokyocabinet.dll" ] }
11 } cond cdecl add-library >>
12
13 LIBRARY: tokyocabinet
14
15 CONSTANT: TCDBTHASH 0
16 CONSTANT: TCDBTBTREE 1
17 CONSTANT: TCDBTFIXED 2
18 CONSTANT: TCDBTTABLE 3
19
20 ! FIXME: on windows 64bits this isn't correct, because long is 32bits there, and time_t is int64
21 TYPEDEF: long tokyo_time_t
22
23 C-TYPE: TCLIST
24
25 FUNCTION: TCLIST* tclistnew ( )
26 FUNCTION: TCLIST* tclistnew2 ( int anum )
27 FUNCTION: void tclistdel ( TCLIST* list )
28 FUNCTION: int tclistnum ( TCLIST* list )
29 FUNCTION: void* tclistval ( TCLIST* list, int index, int* sp )
30 FUNCTION: c-string tclistval2 ( TCLIST* list, int index )
31 FUNCTION: void tclistpush ( TCLIST* list, void* ptr, int size )
32 FUNCTION: void tclistpush2 ( TCLIST* list, c-string str )
33 FUNCTION: void tcfree ( void* ptr )
34
35 TYPEDEF: void* TCCMP
36 TYPEDEF: void* TCCODEC
37 TYPEDEF: void* TCPDPROC
38 TYPEDEF: void* TCITER