summaryrefslogtreecommitdiffstats
path: root/cdb.3
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /cdb.3
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'cdb.3')
-rw-r--r--cdb.362
1 files changed, 62 insertions, 0 deletions
diff --git a/cdb.3 b/cdb.3
new file mode 100644
index 0000000..a85b34c
--- /dev/null
+++ b/cdb.3
@@ -0,0 +1,62 @@
1.TH cdb 3
2.SH NAME
3cdb \- read from a constant database
4.SH SYNTAX
5.B #include <cdb.h>
6
7int \fBcdb_seek(\fP\fIfd,key,len,dlen\fR\fB)\fP;
8
9int \fIfd\fR;
10.br
11char *\fIkey\fR;
12.br
13unsigned int \fIlen\fR;
14.br
15uint32 *\fIdlen\fR;
16.SH DESCRIPTION
17.B cdb_seek
18looks up
19.I key
20in a constant database.
21It returns 1 if
22.I key
23is present,
240 if
25.I key
26is not present,
27or \-1 if there was a read error.
28.I key
29is an array of
30.I len
31characters.
32
33.B cdb_seek
34needs an open file descriptor,
35.IR fd ,
36pointing to the database.
37If
38.B cdb_seek
39returns 1,
40it points
41.I fd
42at the beginning of the data portion of the first record
43indexed by
44.IR key ,
45and it stores the data length in
46.IR dlen.
47.B cdb_seek
48does not provide a way to read subsequent records with the same key.
49
50It's fine to do several
51.B cdb_seek
52lookups with the same open file descriptor.
53Beware, however, that two simultaneous
54.B cdb_seek
55lookups can fail horribly;
56separate processes should not share the same database descriptor.
57Furthermore, any updates after the database was opened
58will be invisible.
59It's rarely a good idea for a long-running program
60to hold a database open.
61.SH "SEE ALSO"
62cdbget(1)