chiark / gitweb /
a70aa1524c522d661300d6c6ac83b600ef24bd5d
[chiark-tcl.git] / cdb / cdb.tct
1 Table cdbtoplevel TopLevel_Command
2         cdb
3                 subcmd  enum(Cdb/_SubCommand, "cdb subcommand")
4                 ...     obj
5         cdb-wr
6                 subcmd  enum(Cdbwr/_SubCommand, "cdb-wr subcommand")
7                 ...     obj
8
9 Table cdb Cdb_SubCommand
10         open
11                 path    string
12                 =>      iddata(&cdbtcl_databases)
13         lookup
14                 db      iddata(&cdbtcl_databases)
15                 key     obj
16                 =>      obj
17         lookup-hb
18                 db      iddata(&cdbtcl_databases)
19                 key     hb
20                 =>      hb
21         close
22                 db      iddata(&cdbtcl_databases)
23
24 Table cdbwr Cdbwr_SubCommand
25         create-empty
26                 pathb   string
27                 # files:
28                 #       <pathb>.main
29                 #       <pathb>.cdb
30                 #       <pathb>.log
31                 #       <pathb>.tmp (might be new .main or new .cdb)
32                 # invariants:
33                 #       .main is a cdb native text file
34                 #         and always exists
35                 #       if .tmp exists it is irrelevant
36                 #       if .cdb exists it is a cdb database
37                 #         containing exactly the same as .main
38                 #       if .log exists, it is a cdb native
39                 #         text file _without the trailing newline_;
40                 #         its contents override values from .main or .cdb
41         open
42                 pathb   string
43                 on_info obj
44                 =>      iddata(&cdbtcl_rwdatabases)
45                 # on_info <event> <xinfo>...:
46                 # on_info open-clean <statistics-info-string>
47                 # on_info open-dirty <statistics-info-string>
48                 # on_info compact-start <statistics-info-string>
49                 # on_info compact-end <statistics-info-string>
50                 # on_info close <statistics-info-string>
51         lookup
52                 db      iddata(&cdbtcl_rwdatabases)
53                 key     obj
54                 =>      obj
55         lookup-hb
56                 db      iddata(&cdbtcl_rwdatabases)
57                 key     hb
58                 =>      hb
59         update
60                 db      iddata(&cdbtcl_rwdatabases)
61                 key     obj
62                 value   obj
63         update-hb
64                 db      iddata(&cdbtcl_rwdatabases)
65                 key     hb
66                 value   hb
67         update-quick
68                 db      iddata(&cdbtcl_rwdatabases)
69                 key     obj
70                 value   obj
71         update-quick-hb
72                 db      iddata(&cdbtcl_rwdatabases)
73                 key     hb
74                 value   hb
75         close
76                 db      iddata(&cdbtcl_rwdatabases)
77         close-quick
78                 db      iddata(&cdbtcl_rwdatabases)