1 # cdb, cdb-wr - Tcl bindings for tinycdb and a journalling write extension
2 # Copyright 2006 Ian Jackson
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 Table *cdbtoplevel TopLevel_Command
22 subcmd enum(Cdb/_SubCommand, "cdb subcommand")
25 subcmd enum(Cdbwr/_SubCommand, "cdb-wr subcommand")
28 Table cdb Cdb_SubCommand
31 => iddata(&cdbtcl_databases)
33 db iddata(&cdbtcl_databases)
38 db iddata(&cdbtcl_databases)
43 db iddata(&cdbtcl_databases)
45 Table cdbwr Cdbwr_SubCommand
53 # <pathb>.tmp (might be new .main or new .cdb)
55 # .lock is an empty file
56 # which is locked with fcntl by open
57 # .main is a cdb native text file
59 # .cdb is a cdb database containing data
60 # equivalent to and at least as recent as .main
61 # (maybe not identical, because .cdb may
62 # have been updated with data from .jrn but
63 # .main not yet); if .jrn does not exist then
65 # .cdb may not exist; in which case it is to
66 # be treated as if it existed and was empty
67 # but this is maximally early (so main must
68 # exist and be empty since .main is never
70 # if .jrn exists, it is a cdb native
71 # text file _without the trailing newline_;
72 # its contents override values from .main or .cdb
73 # if .main.tmp or .cdb.tmp exists it is irrelevant
74 # zero length values mean record is deleted (in .jrn only;
75 # forbidden elsewhere)
78 # .jrn and open hash table contain same info
83 # on_lexminval present and not empty list: provides a
84 # script which returns the current lexminval. In
85 # this case, occasionally,
86 # on_lexminval will be called and then entries whose
87 # value is lexically strictly less than lexminval
88 # will be deleted automatically. The comparison
89 # is bytewise on the UTF-8 representations.
90 => iddata(&cdbtcl_rwdatabases)
91 open-okjunk RWSCF_OKJUNK
95 => iddata(&cdbtcl_rwdatabases)
96 # on_info <event> <xinfo>...:
97 # on_info open-clean <statistics-info-string>
98 # on_info open-dirty-start <statistics-info-string>
99 # on_info open-dirty-junk <problem-info-string> \
100 # <problem-error-code-list>
101 # on_info open-dirty-done <statistics-info-string>
102 # on_info compact-start <statistics-info-string>
103 # on_info compact-done <statistics-info-string>
104 # on_info close <statistics-info-string>
106 db iddata(&cdbtcl_rwdatabases)
111 db iddata(&cdbtcl_rwdatabases)
116 db iddata(&cdbtcl_rwdatabases)
119 db iddata(&cdbtcl_rwdatabases)
123 db iddata(&cdbtcl_rwdatabases)
127 db iddata(&cdbtcl_rwdatabases)
129 db iddata(&cdbtcl_rwdatabases)
131 # this is the default
132 db iddata(&cdbtcl_rwdatabases)
134 db iddata(&cdbtcl_rwdatabases)
136 db iddata(&cdbtcl_rwdatabases)
138 EntryExtra Cdbwr_SubCommand