From: Bruno Deferrari Date: Sat, 13 Jun 2009 01:58:53 +0000 (-0300) Subject: tokyo.alien: Fixes, add tchdb, loads now. X-Git-Tag: 0.97~6105^2^2~17 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=6ebdd525229be064a231748880bc6ee1dd7d15cd tokyo.alien: Fixes, add tchdb, loads now. --- diff --git a/extra/tokyo/alien/tchdb/authors.txt b/extra/tokyo/alien/tchdb/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/tokyo/alien/tchdb/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/tokyo/alien/tchdb/tchdb.factor b/extra/tokyo/alien/tchdb/tchdb.factor new file mode 100644 index 0000000000..89ca081627 --- /dev/null +++ b/extra/tokyo/alien/tchdb/tchdb.factor @@ -0,0 +1,98 @@ +! 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.tcutil ; +IN: tokyo.alien.tchdb + +TYPEDEF: void* TCHDB* + +CONSTANT: HDBFOPEN 1 +CONSTANT: HDBFFATAL 2 + +CONSTANT: HDBTLARGE 1 +CONSTANT: HDBTDEFLATE 2 +CONSTANT: HDBTBZIP 4 +CONSTANT: HDBTTCBS 8 +CONSTANT: HDBTEXCODEC 16 + +CONSTANT: HDBOREADER 1 +CONSTANT: HDBOWRITER 2 +CONSTANT: HDBOCREAT 4 +CONSTANT: HDBOTRUNC 8 +CONSTANT: HDBONOLCK 16 +CONSTANT: HDBOLCKNB 32 +CONSTANT: HDBOTSYNC 64 + +FUNCTION: char* tchdberrmsg ( int ecode ) ; +FUNCTION: TCHDB* tchdbnew ( ) ; +FUNCTION: void tchdbdel ( TCHDB* hdb ) ; +FUNCTION: int tchdbecode ( TCHDB* hdb ) ; +FUNCTION: bool tchdbsetmutex ( TCHDB* hdb ) ; +FUNCTION: bool tchdbtune ( TCHDB* hdb, longlong bnum, char apow, char fpow, uchar opts ) ; +FUNCTION: bool tchdbsetcache ( TCHDB* hdb, int rcnum ) ; +FUNCTION: bool tchdbsetxmsiz ( TCHDB* hdb, longlong xmsiz ) ; +FUNCTION: bool tchdbopen ( TCHDB* hdb, char* path, int omode ) ; +FUNCTION: bool tchdbclose ( TCHDB* hdb ) ; +FUNCTION: bool tchdbput ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ; +FUNCTION: bool tchdbput2 ( TCHDB* hdb, char* kstr, char* vstr ) ; +FUNCTION: bool tchdbputkeep ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ; +FUNCTION: bool tchdbputkeep2 ( TCHDB* hdb, char* kstr, char* vstr ) ; +FUNCTION: bool tchdbputcat ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ; +FUNCTION: bool tchdbputcat2 ( TCHDB* hdb, char* kstr, char* vstr ) ; +FUNCTION: bool tchdbputasync ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz ) ; +FUNCTION: bool tchdbputasync2 ( TCHDB* hdb, char* kstr, char* vstr ) ; +FUNCTION: bool tchdbout ( TCHDB* hdb, void* kbuf, int ksiz ) ; +FUNCTION: bool tchdbout2 ( TCHDB* hdb, char* kstr ) ; +FUNCTION: void* tchdbget ( TCHDB* hdb, void* kbuf, int ksiz, int* sp ) ; +FUNCTION: char* tchdbget2 ( TCHDB* hdb, char* kstr ) ; +FUNCTION: int tchdbget3 ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int max ) ; +FUNCTION: int tchdbvsiz ( TCHDB* hdb, void* kbuf, int ksiz ) ; +FUNCTION: int tchdbvsiz2 ( TCHDB* hdb, char* kstr ) ; +FUNCTION: bool tchdbiterinit ( TCHDB* hdb ) ; +FUNCTION: void* tchdbiternext ( TCHDB* hdb, int* sp ) ; +FUNCTION: char* tchdbiternext2 ( TCHDB* hdb ) ; +FUNCTION: bool tchdbiternext3 ( TCHDB* hdb, TCXSTR* kxstr, TCXSTR* vxstr ) ; +FUNCTION: TCLIST* tchdbfwmkeys ( TCHDB* hdb, void* pbuf, int psiz, int max ) ; +FUNCTION: TCLIST* tchdbfwmkeys2 ( TCHDB* hdb, char* pstr, int max ) ; +FUNCTION: int tchdbaddint ( TCHDB* hdb, void* kbuf, int ksiz, int num ) ; +FUNCTION: double tchdbadddouble ( TCHDB* hdb, void* kbuf, int ksiz, double num ) ; +FUNCTION: bool tchdbsync ( TCHDB* hdb ) ; +FUNCTION: bool tchdboptimize ( TCHDB* hdb, longlong bnum, char apow, char fpow, uchar opts ) ; +FUNCTION: bool tchdbvanish ( TCHDB* hdb ) ; +FUNCTION: bool tchdbcopy ( TCHDB* hdb, char* path ) ; +FUNCTION: bool tchdbtranbegin ( TCHDB* hdb ) ; +FUNCTION: bool tchdbtrancommit ( TCHDB* hdb ) ; +FUNCTION: bool tchdbtranabort ( TCHDB* hdb ) ; +FUNCTION: char* tchdbpath ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbrnum ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbfsiz ( TCHDB* hdb ) ; + +! -------- + +FUNCTION: void tchdbsetecode ( TCHDB* hdb, int ecode, char* filename, int line, char* func ) ; +FUNCTION: void tchdbsettype ( TCHDB* hdb, uchar type ) ; +FUNCTION: void tchdbsetdbgfd ( TCHDB* hdb, int fd ) ; +FUNCTION: int tchdbdbgfd ( TCHDB* hdb ) ; +FUNCTION: bool tchdbhasmutex ( TCHDB* hdb ) ; +FUNCTION: bool tchdbmemsync ( TCHDB* hdb, bool phys ) ; +FUNCTION: bool tchdbcacheclear ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbbnum ( TCHDB* hdb ) ; +FUNCTION: uint tchdbalign ( TCHDB* hdb ) ; +FUNCTION: uint tchdbfbpmax ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbxmsiz ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbinode ( TCHDB* hdb ) ; +FUNCTION: time_t tchdbmtime ( TCHDB* hdb ) ; +FUNCTION: int tchdbomode ( TCHDB* hdb ) ; +FUNCTION: uchar tchdbtype ( TCHDB* hdb ) ; +FUNCTION: uchar tchdbflags ( TCHDB* hdb ) ; +FUNCTION: uchar tchdbopts ( TCHDB* hdb ) ; +FUNCTION: char* tchdbopaque ( TCHDB* hdb ) ; +FUNCTION: ulonglong tchdbbnumused ( TCHDB* hdb ) ; +FUNCTION: bool tchdbsetcodecfunc ( TCHDB* hdb, TCCODEC enc, void* encop, TCCODEC dec, void* decop ) ; +FUNCTION: void tchdbcodecfunc ( TCHDB* hdb, TCCODEC* ep, void* *eop, TCCODEC* dp, void* *dop ) ; +FUNCTION: bool tchdbputproc ( TCHDB* hdb, void* kbuf, int ksiz, void* vbuf, int vsiz, TCPDPROC proc, void* op ) ; +FUNCTION: void* tchdbgetnext ( TCHDB* hdb, void* kbuf, int ksiz, int* sp ) ; +FUNCTION: char* tchdbgetnext2 ( TCHDB* hdb, char* kstr ) ; +FUNCTION: char* tchdbgetnext3 ( TCHDB* hdb, char* kbuf, int ksiz, int* sp, char* *vbp, int* vsp ) ; +FUNCTION: bool tchdbforeach ( TCHDB* hdb, TCITER iter, void* op ) ; +FUNCTION: bool tchdbtranvoid ( TCHDB* hdb ) ; diff --git a/extra/tokyo/alien/tcrdb/authors.txt b/extra/tokyo/alien/tcrdb/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/tokyo/alien/tcrdb/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/tokyo/alien/tcrdb/tcrdb.factor b/extra/tokyo/alien/tcrdb/tcrdb.factor index 7919c92698..087b303d9b 100644 --- a/extra/tokyo/alien/tcrdb/tcrdb.factor +++ b/extra/tokyo/alien/tcrdb/tcrdb.factor @@ -1,7 +1,9 @@ -USING: kernel alien combinators alien.syntax - alien.c-types - alien.libraries tokyo.alien.tcutil tokyo.alien.tctdb ; -IN: tokyo.alient.tcrdb +! 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 +tokyo.alien.tctdb ; +IN: tokyo.alien.tcrdb TYPEDEF: void* TCRDB* ! C-STRUCT: TCRDB @@ -115,17 +117,17 @@ CONSTANT: RDBQOSTRDESC TDBQOSTRDESC CONSTANT: RDBQONUMASC TDBQONUMASC CONSTANT: RDBQONUMDESC TDBQONUMDESC -FUNCTION: bool tcrdbtblput ( TCRDB* rdb, const void* pkbuf, int pksiz, TCMAP* cols ) ; -FUNCTION: bool tcrdbtblputkeep ( TCRDB* rdb, const void* pkbuf, int pksiz, TCMAP* cols ) ; -FUNCTION: bool tcrdbtblputcat ( TCRDB* rdb, const void* pkbuf, int pksiz, TCMAP* cols ) ; -FUNCTION: bool tcrdbtblout ( TCRDB* rdb, const void* pkbuf, int pksiz ) ; -FUNCTION: TCMAP* tcrdbtblget ( TCRDB* rdb, const void* pkbuf, int pksiz ) ; -FUNCTION: bool tcrdbtblsetindex ( TCRDB* rdb, const char* name, int type ) ; +FUNCTION: bool tcrdbtblput ( TCRDB* rdb, void* pkbuf, int pksiz, TCMAP* cols ) ; +FUNCTION: bool tcrdbtblputkeep ( TCRDB* rdb, void* pkbuf, int pksiz, TCMAP* cols ) ; +FUNCTION: bool tcrdbtblputcat ( TCRDB* rdb, void* pkbuf, int pksiz, TCMAP* cols ) ; +FUNCTION: bool tcrdbtblout ( TCRDB* rdb, void* pkbuf, int pksiz ) ; +FUNCTION: TCMAP* tcrdbtblget ( TCRDB* rdb, void* pkbuf, int pksiz ) ; +FUNCTION: bool tcrdbtblsetindex ( TCRDB* rdb, char* name, int type ) ; FUNCTION: longlong tcrdbtblgenuid ( TCRDB* rdb ) ; FUNCTION: RDBQRY* tcrdbqrynew ( TCRDB* rdb ) ; FUNCTION: void tcrdbqrydel ( RDBQRY* qry ) ; -FUNCTION: void tcrdbqryaddcond ( RDBQRY* qry, const char* name, int op, const char* expr ) ; -FUNCTION: void tcrdbqrysetorder ( RDBQRY* qry, const char* name, int type ) ; +FUNCTION: void tcrdbqryaddcond ( RDBQRY* qry, char* name, int op, char* expr ) ; +FUNCTION: void tcrdbqrysetorder ( RDBQRY* qry, char* name, int type ) ; FUNCTION: void tcrdbqrysetlimit ( RDBQRY* qry, int max, int skip ) ; FUNCTION: TCLIST* tcrdbqrysearch ( RDBQRY* qry ) ; FUNCTION: bool tcrdbqrysearchout ( RDBQRY* qry ) ; diff --git a/extra/tokyo/alien/tctdb/authors.txt b/extra/tokyo/alien/tctdb/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/tokyo/alien/tctdb/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/tokyo/alien/tctdb/tctdb.factor b/extra/tokyo/alien/tctdb/tctdb.factor index 35bc16e003..90ede6c7b7 100644 --- a/extra/tokyo/alien/tctdb/tctdb.factor +++ b/extra/tokyo/alien/tctdb/tctdb.factor @@ -1,7 +1,9 @@ -USING: kernel alien combinators alien.syntax - alien.c-types - alien.libraries tokyo.alien.tcutil ; -IN: tokyo.alient.tctdb +! 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 +tokyo.alien.tchdb ; +IN: tokyo.alien.tctdb TYPEDEF: void* TDBIDX* TYPEDEF: void* TCTDB* @@ -68,7 +70,7 @@ CONSTANT: TDBQPSTOP 16777216 TYPEDEF: void* TDBQRYPROC FUNCTION: char* tctdberrmsg ( int ecode ) ; -FUNCTION: TCTDB* tctdbnew ( void ) ; +FUNCTION: TCTDB* tctdbnew ( ) ; FUNCTION: void tctdbdel ( TCTDB* tdb ) ; FUNCTION: int tctdbecode ( TCTDB* tdb ) ; FUNCTION: bool tctdbsetmutex ( TCTDB* tdb ) ; diff --git a/extra/tokyo/alien/tcutil/authors.txt b/extra/tokyo/alien/tcutil/authors.txt new file mode 100644 index 0000000000..f4a8cb1dc2 --- /dev/null +++ b/extra/tokyo/alien/tcutil/authors.txt @@ -0,0 +1 @@ +Bruno Deferrari diff --git a/extra/tokyo/alien/tcutil/tcutil.factor b/extra/tokyo/alien/tcutil/tcutil.factor index 41de2c9407..328fd01d3e 100644 --- a/extra/tokyo/alien/tcutil/tcutil.factor +++ b/extra/tokyo/alien/tcutil/tcutil.factor @@ -1,7 +1,8 @@ -USING: kernel alien combinators alien.syntax - alien.c-types - alien.libraries ; -IN: tokyo.alient.tcutil +! 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 ; +IN: tokyo.alien.tcutil C-ENUM: TCDBTHASH @@ -22,3 +23,8 @@ FUNCTION: void* tclistval ( TCLIST* list, int index, int* sp ) ; FUNCTION: char* tclistval2 ( TCLIST* list, int index ) ; FUNCTION: void tclistpush ( TCLIST* list, void* ptr, int size ) ; FUNCTION: void tclistpush2 ( TCLIST* list, char* str ) ; + +TYPEDEF: void* TCCMP +TYPEDEF: void* TCCODEC +TYPEDEF: void* TCPDPROC +TYPEDEF: voud* TCITER