blob: 6fe8f0ed295c9df91d422abcfc61d40ab0f2f3c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
.TH CBT 1
.SH NAME
cbt
\- programs for b-trees
.SH SYNOPSIS
.B cbt
.I command
arguments ...
.SH DESCRIPTION
.PP
B-trees support lookup of values by key.
A b-tree
.I file
corresponds to two files,
.I file.T
and
.IR file.F .
.I file.T
contains the keys and pointers to values.
.I file.F
contains the values.
If the b-tree is an
.I index
there is no
.I .F
file.
.PP
.B cbt creat
.I arguments
creates empty b-trees.
Each argument may be a file name or the flag
.BR -i .
The b-trees created for all the names following a flag argument
will be indexes.
.PP
.B cbt report
.I file-names
reports on the sizes of the files.
If the amount of useful data is much less than the file sizes,
.B cbt squash
.I file
will make the b-tree much smaller by reconstructing it in nearly
minimal form.
.PP
.B cbt cat
.I file
prints out the contents of the b-tree in the form
.RS
.I key tab value new-line
.RE
.PP
.B cbt build [-r]
.I file
fills an empty b-tree with key-value pairs read from the standard
input.
The keys must be sorted and without duplicates.
If the optional argument is not present, then the part of each line
up to the first tab is the key, and the part after the first tab,
not including the new-line, is the value.
If the optional argument is present, then the input is assumed to
be a sequence of
.RS
.RI short klen; char key[klen]; short vlen; char value[vlen]
.RE
quadruples.
The smallest possible value for
.I klen
is 1,
so the shortest quadruple consists of 2 short integers and one character.
.SH SEE ALSO
memo by pjw, cbt(3)
|