1 # cdb, cdb-wr - Tcl bindings for tinycdb and a journalling write extension
2 # Copyright 2006-2012 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, see <http://www.gnu.org/licenses/>.
18 Table *cdbtoplevel TopLevel_Command
20 dispatch(Cdb/_SubCommand, "cdb subcommand")
22 dispatch(Cdbwr/_SubCommand, "cdb-wr subcommand")
24 Table cdb Cdb_SubCommand
27 => iddata(&cdbtcl_databases)
29 db iddata(&cdbtcl_databases)
34 db iddata(&cdbtcl_databases)
39 db iddata(&cdbtcl_databases)
41 Table cdbwr Cdbwr_SubCommand
49 # <pathb>.tmp (might be new .main or new .cdb)
51 # .lock is an empty file
52 # which is locked with fcntl by open
53 # .main is a cdb native text file
55 # .cdb is a cdb database containing data
56 # equivalent to and at least as recent as .main
57 # (maybe not identical, because .cdb may
58 # have been updated with data from .jrn but
59 # .main not yet); if .jrn does not exist then
61 # .cdb may not exist; in which case it is to
62 # be treated as if it existed and was empty
63 # but this is maximally early (so main must
64 # exist and be empty since .main is never
66 # if .jrn exists, it is a cdb native
67 # text file _without the trailing newline_;
68 # its contents override values from .main or .cdb
69 # if .main.tmp or .cdb.tmp exists it is irrelevant
70 # zero length values mean record is deleted (in .jrn only;
71 # forbidden elsewhere)
74 # .jrn and open hash table contain same info
79 # on_lexminval present and not empty list: provides a
80 # script which returns the current lexminval. In
81 # this case, occasionally,
82 # on_lexminval will be called and then entries whose
83 # value is lexically strictly less than lexminval
84 # will be deleted automatically. The comparison
85 # is bytewise on the UTF-8 representations.
86 => iddata(&cdbtcl_rwdatabases)
87 open-okjunk RWSCF_OKJUNK
91 => iddata(&cdbtcl_rwdatabases)
92 # on_info <event> <xinfo>...:
93 # on_info open-clean <statistics-info-string>
94 # on_info open-dirty-start <statistics-info-string>
95 # on_info open-dirty-junk <problem-info-string> \
96 # <problem-error-code-list>
97 # on_info open-dirty-done <statistics-info-string>
98 # on_info compact-start <statistics-info-string>
99 # on_info compact-done <statistics-info-string>
100 # on_info close <statistics-info-string>
102 db iddata(&cdbtcl_rwdatabases)
107 db iddata(&cdbtcl_rwdatabases)
112 db iddata(&cdbtcl_rwdatabases)
115 db iddata(&cdbtcl_rwdatabases)
119 db iddata(&cdbtcl_rwdatabases)
123 db iddata(&cdbtcl_rwdatabases)
125 db iddata(&cdbtcl_rwdatabases)
127 # this is the default
128 db iddata(&cdbtcl_rwdatabases)
130 db iddata(&cdbtcl_rwdatabases)
132 db iddata(&cdbtcl_rwdatabases)
134 EntryExtra Cdbwr_SubCommand