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, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 Table *cdbtoplevel TopLevel_Command
22 dispatch(Cdb/_SubCommand, "cdb subcommand")
24 dispatch(Cdbwr/_SubCommand, "cdb-wr subcommand")
26 Table cdb Cdb_SubCommand
29 => iddata(&cdbtcl_databases)
31 db iddata(&cdbtcl_databases)
36 db iddata(&cdbtcl_databases)
41 db iddata(&cdbtcl_databases)
43 Table cdbwr Cdbwr_SubCommand
51 # <pathb>.tmp (might be new .main or new .cdb)
53 # .lock is an empty file
54 # which is locked with fcntl by open
55 # .main is a cdb native text file
57 # .cdb is a cdb database containing data
58 # equivalent to and at least as recent as .main
59 # (maybe not identical, because .cdb may
60 # have been updated with data from .jrn but
61 # .main not yet); if .jrn does not exist then
63 # .cdb may not exist; in which case it is to
64 # be treated as if it existed and was empty
65 # but this is maximally early (so main must
66 # exist and be empty since .main is never
68 # if .jrn exists, it is a cdb native
69 # text file _without the trailing newline_;
70 # its contents override values from .main or .cdb
71 # if .main.tmp or .cdb.tmp exists it is irrelevant
72 # zero length values mean record is deleted (in .jrn only;
73 # forbidden elsewhere)
76 # .jrn and open hash table contain same info
81 # on_lexminval present and not empty list: provides a
82 # script which returns the current lexminval. In
83 # this case, occasionally,
84 # on_lexminval will be called and then entries whose
85 # value is lexically strictly less than lexminval
86 # will be deleted automatically. The comparison
87 # is bytewise on the UTF-8 representations.
88 => iddata(&cdbtcl_rwdatabases)
89 open-okjunk RWSCF_OKJUNK
93 => iddata(&cdbtcl_rwdatabases)
94 # on_info <event> <xinfo>...:
95 # on_info open-clean <statistics-info-string>
96 # on_info open-dirty-start <statistics-info-string>
97 # on_info open-dirty-junk <problem-info-string> \
98 # <problem-error-code-list>
99 # on_info open-dirty-done <statistics-info-string>
100 # on_info compact-start <statistics-info-string>
101 # on_info compact-done <statistics-info-string>
102 # on_info close <statistics-info-string>
104 db iddata(&cdbtcl_rwdatabases)
109 db iddata(&cdbtcl_rwdatabases)
114 db iddata(&cdbtcl_rwdatabases)
117 db iddata(&cdbtcl_rwdatabases)
121 db iddata(&cdbtcl_rwdatabases)
125 db iddata(&cdbtcl_rwdatabases)
127 db iddata(&cdbtcl_rwdatabases)
129 # this is the default
130 db iddata(&cdbtcl_rwdatabases)
132 db iddata(&cdbtcl_rwdatabases)
134 db iddata(&cdbtcl_rwdatabases)
136 EntryExtra Cdbwr_SubCommand