From: Bruno Deferrari Date: Sat, 13 Jun 2009 23:13:53 +0000 (-0300) Subject: tokyo.alien: Add code that loads the dlls (not working right now for me) X-Git-Tag: 0.97~6105^2^2~12 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=cb300e3a8401ae4bc81cb35009c82cf18079dcf7 tokyo.alien: Add code that loads the dlls (not working right now for me) --- diff --git a/extra/tokyo/alien/tcadb/tcadb.factor b/extra/tokyo/alien/tcadb/tcadb.factor index 203a0b8cbb..4e8ca56531 100644 --- a/extra/tokyo/alien/tcadb/tcadb.factor +++ b/extra/tokyo/alien/tcadb/tcadb.factor @@ -5,6 +5,8 @@ combinators kernel tokyo.alien.tchdb tokyo.alien.tcutil tokyo.alien.tcbdb tokyo.alien.tcfdb tokyo.alien.tctdb ; IN: tokyo.alien.tcrdb +LIBRARY: tokyocabinet + TYPEDEF: void* TCADB C-ENUM: @@ -48,8 +50,8 @@ FUNCTION: bool tcadbtranbegin ( TCADB* adb ) ; FUNCTION: bool tcadbtrancommit ( TCADB* adb ) ; FUNCTION: bool tcadbtranabort ( TCADB* adb ) ; FUNCTION: char* tcadbpath ( TCADB* adb ) ; -FUNCTION: uint64_t tcadbrnum ( TCADB* adb ) ; -FUNCTION: uint64_t tcadbsize ( TCADB* adb ) ; +FUNCTION: ulonglong tcadbrnum ( TCADB* adb ) ; +FUNCTION: ulonglong tcadbsize ( TCADB* adb ) ; FUNCTION: TCLIST* tcadbmisc ( TCADB* adb, char* name, TCLIST* args ) ; ! ----- @@ -63,5 +65,5 @@ FUNCTION: int tcadbomode ( TCADB* adb ) ; FUNCTION: void* tcadbreveal ( TCADB* adb ) ; FUNCTION: bool tcadbputproc ( TCADB* adb, void* kbuf, int ksiz, void* vbuf, int vsiz, TCPDPROC proc, void* op ) ; FUNCTION: bool tcadbforeach ( TCADB* adb, TCITER iter, void* op ) ; -FUNCTION: bool tcadbmapbdb ( TCADB* adb, TCLIST* keys, TCBDB* bdb, ADBMAPPROC proc, void* op, int64_t csiz ) ; +FUNCTION: bool tcadbmapbdb ( TCADB* adb, TCLIST* keys, TCBDB* bdb, ADBMAPPROC proc, void* op, longlong csiz ) ; FUNCTION: bool tcadbmapbdbemit ( void* map, char* kbuf, int ksiz, char* vbuf, int vsiz ) ; diff --git a/extra/tokyo/alien/tcbdb/tcbdb.factor b/extra/tokyo/alien/tcbdb/tcbdb.factor index 9e539e7036..ad359762e8 100644 --- a/extra/tokyo/alien/tcbdb/tcbdb.factor +++ b/extra/tokyo/alien/tcbdb/tcbdb.factor @@ -5,6 +5,8 @@ combinators kernel tokyo.alien.tchdb tokyo.alien.tcutil tokyo.alien.tchdb ; IN: tokyo.alien.tcbdb +LIBRARY: tokyocabinet + TYPEDEF: void* TCBDB CONSTANT: BDBFOPEN HDBFOPEN diff --git a/extra/tokyo/alien/tchdb/tchdb.factor b/extra/tokyo/alien/tchdb/tchdb.factor index 89ca081627..f143e9b304 100644 --- a/extra/tokyo/alien/tchdb/tchdb.factor +++ b/extra/tokyo/alien/tchdb/tchdb.factor @@ -4,6 +4,8 @@ USING: alien alien.c-types alien.libraries alien.syntax combinators kernel tokyo.alien.tcutil ; IN: tokyo.alien.tchdb +LIBRARY: tokyocabinet + TYPEDEF: void* TCHDB* CONSTANT: HDBFOPEN 1 diff --git a/extra/tokyo/alien/tcrdb/tcrdb.factor b/extra/tokyo/alien/tcrdb/tcrdb.factor index 087b303d9b..c64b12a4a1 100644 --- a/extra/tokyo/alien/tcrdb/tcrdb.factor +++ b/extra/tokyo/alien/tcrdb/tcrdb.factor @@ -1,10 +1,18 @@ ! Copyright (C) 2009 Bruno Deferrari ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.libraries alien.syntax -combinators kernel tokyo.alien.tchdb tokyo.alien.tcutil +combinators kernel system tokyo.alien.tchdb tokyo.alien.tcutil tokyo.alien.tctdb ; IN: tokyo.alien.tcrdb +<< "tokyotyrant" { + { [ os macosx? ] [ "libtokyotyrant.3.dylib" ] } + { [ os unix? ] [ "libtokyotyrant.3.so" ] } + { [ os windows? ] [ "tokyotyrant.dll" ] } +} cond "cdecl" add-library >> + +LIBRARY: tokyotyrant + TYPEDEF: void* TCRDB* ! C-STRUCT: TCRDB ! { "pthread_mutex_t" mmtx } diff --git a/extra/tokyo/alien/tctdb/tctdb.factor b/extra/tokyo/alien/tctdb/tctdb.factor index 90ede6c7b7..b3379b4455 100644 --- a/extra/tokyo/alien/tctdb/tctdb.factor +++ b/extra/tokyo/alien/tctdb/tctdb.factor @@ -5,6 +5,8 @@ combinators kernel tokyo.alien.tchdb tokyo.alien.tcutil tokyo.alien.tchdb ; IN: tokyo.alien.tctdb +LIBRARY: tokyocabinet + TYPEDEF: void* TDBIDX* TYPEDEF: void* TCTDB* diff --git a/extra/tokyo/alien/tcutil/tcutil.factor b/extra/tokyo/alien/tcutil/tcutil.factor index 328fd01d3e..ae6f6ed963 100644 --- a/extra/tokyo/alien/tcutil/tcutil.factor +++ b/extra/tokyo/alien/tcutil/tcutil.factor @@ -1,9 +1,17 @@ ! Copyright (C) 2009 Bruno Deferrari ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.libraries alien.syntax -combinators kernel ; +combinators kernel system ; IN: tokyo.alien.tcutil +<< "tokyocabinet" { + { [ os macosx? ] [ "libtokyocabinet.dylib" ] } + { [ os unix? ] [ "libtokyocabinet.so" ] } + { [ os windows? ] [ "tokyocabinet.dll" ] } +} cond "cdecl" add-library >> + +LIBRARY: tokyocabinet + C-ENUM: TCDBTHASH TCDBTBTREE