From: ian Date: Sun, 15 Jan 2006 15:20:55 +0000 (+0000) Subject: cdb framework compiles - now just need to implement it X-Git-Tag: debian/1.1.1~91 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=commitdiff_plain;h=7795b9e72903475e48adbc986a945ef3a7fb0309;hp=8aa50feff3e82f3d217fe7ee897b7a030a72bc90;ds=sidebyside cdb framework compiles - now just need to implement it --- diff --git a/cdb/.cvsignore b/cdb/.cvsignore new file mode 100644 index 0000000..dec0c7f --- /dev/null +++ b/cdb/.cvsignore @@ -0,0 +1,2 @@ +*+tcmdif.* +*.d diff --git a/cdb/Makefile b/cdb/Makefile index 9c1f665..58fa5aa 100644 --- a/cdb/Makefile +++ b/cdb/Makefile @@ -1,9 +1,9 @@ BASE_DIR = ../base EXTBASE = cdb -CFILES = cdb +CFILES = readonly writeable OTHER_TCTS = ../hbytes/hbytes-base.tct CPPFLAGS += -I../hbytes -LDLIBS += ../hbytes/chiark_tcl_hbytes.so -ltinycdb +LDLIBS += ../hbytes/chiark_tcl_hbytes.so -lcdb include ../base/extension.make diff --git a/cdb/cdb.tct b/cdb/cdb.tct index cfb93ba..a70aa15 100644 --- a/cdb/cdb.tct +++ b/cdb/cdb.tct @@ -12,8 +12,8 @@ Table cdb Cdb_SubCommand => iddata(&cdbtcl_databases) lookup db iddata(&cdbtcl_databases) - key bytearray - => bytearray + key obj + => obj lookup-hb db iddata(&cdbtcl_databases) key hb @@ -21,7 +21,7 @@ Table cdb Cdb_SubCommand close db iddata(&cdbtcl_databases) -Table cdbwr CdbWr_SubCommand +Table cdbwr Cdbwr_SubCommand create-empty pathb string # files: @@ -50,24 +50,24 @@ Table cdbwr CdbWr_SubCommand # on_info close lookup db iddata(&cdbtcl_rwdatabases) - key bytearray - => bytearray + key obj + => obj lookup-hb db iddata(&cdbtcl_rwdatabases) key hb => hb update db iddata(&cdbtcl_rwdatabases) - key bytearray - value bytearray + key obj + value obj update-hb db iddata(&cdbtcl_rwdatabases) key hb value hb update-quick db iddata(&cdbtcl_rwdatabases) - key bytearray - value bytearray + key obj + value obj update-quick-hb db iddata(&cdbtcl_rwdatabases) key hb diff --git a/cdb/chiark_tcl_cdb.h b/cdb/chiark_tcl_cdb.h new file mode 100644 index 0000000..db2d3d1 --- /dev/null +++ b/cdb/chiark_tcl_cdb.h @@ -0,0 +1,12 @@ +/* + */ + +#ifndef CHIARK_TCL_CDB_H +#define CHIARK_TCL_CDB_H + +#include "hbytes.h" +#include "cdb+tcmdif.h" + +extern const IdDataSpec cdbtcl_databases, cdbtcl_rwdatabases; + +#endif /*CHIARK_TCL_CDB_H*/ diff --git a/cdb/readonly.c b/cdb/readonly.c new file mode 100644 index 0000000..b644a1d --- /dev/null +++ b/cdb/readonly.c @@ -0,0 +1,9 @@ +/**/ + +#include "chiark_tcl_cdb.h" + +static void destroy_cdb_idtabcb(Tcl_Interp *ip, void *val) { abort(); } + +const IdDataSpec cdbtcl_databases= { + "cdb-db", "cdb-opendatabases-table", destroy_cdb_idtabcb +}; diff --git a/cdb/writeable.c b/cdb/writeable.c new file mode 100644 index 0000000..140c1ff --- /dev/null +++ b/cdb/writeable.c @@ -0,0 +1,9 @@ +/**/ + +#include "chiark_tcl_cdb.h" + +static void destroy_cdbrw_idtabcb(Tcl_Interp *ip, void *val) { abort(); } + +const IdDataSpec cdbtcl_rwdatabases= { + "cdb-rwdb", "cdb-openrwdatabases-table", destroy_cdbrw_idtabcb +};