chiark / gitweb /
cdb framework compiles - now just need to implement it
authorian <ian>
Sun, 15 Jan 2006 15:20:55 +0000 (15:20 +0000)
committerian <ian>
Sun, 15 Jan 2006 15:20:55 +0000 (15:20 +0000)
cdb/.cvsignore [new file with mode: 0644]
cdb/Makefile
cdb/cdb.tct
cdb/chiark_tcl_cdb.h [new file with mode: 0644]
cdb/readonly.c [new file with mode: 0644]
cdb/writeable.c [new file with mode: 0644]

diff --git a/cdb/.cvsignore b/cdb/.cvsignore
new file mode 100644 (file)
index 0000000..dec0c7f
--- /dev/null
@@ -0,0 +1,2 @@
+*+tcmdif.*
+*.d
index 9c1f665..58fa5aa 100644 (file)
@@ -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
 
index cfb93ba..a70aa15 100644 (file)
@@ -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 <statistics-info-string>
        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 (file)
index 0000000..db2d3d1
--- /dev/null
@@ -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 (file)
index 0000000..b644a1d
--- /dev/null
@@ -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 (file)
index 0000000..140c1ff
--- /dev/null
@@ -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
+};