@@ -7,59 +7,71 @@ \section{\module{bsddb} ---
77\sectionauthor {Skip Montanaro}{
[email protected] }
88
99
10- The \module {bsddb} module provides an interface to the Berkeley DB library.
11- Users can create hash, btree or record based library files using the
12- appropriate open call. Bsddb objects behave generally like dictionaries.
13- Keys and values must be strings, however, so to use other objects as keys or
14- to store other kinds of objects the user must serialize them somehow,
15- typically using marshal.dumps or pickle.dumps.
16-
17- The \module {bsddb} module is only available on \UNIX {} systems, so it is not
18- built by default in the standard Python distribution. Also, there are two
19- incompatible versions of the underlying library. Version 1.85 is widely
20- available, but has some known bugs. Version 2 is not quite as widely used,
21- but does offer some improvements. The \module {bsddb} module uses the 1.85
22- interface. Users wishing to use version 2 of the Berkeley DB library will
23- have to modify the source for the module to include db_185.h instead of
24- db.h.
10+ The \module {bsddb} module provides an interface to the Berkeley DB
11+ library. Users can create hash, btree or record based library files
12+ using the appropriate open call. Bsddb objects behave generally like
13+ dictionaries. Keys and values must be strings, however, so to use
14+ other objects as keys or to store other kinds of objects the user must
15+ serialize them somehow, typically using marshal.dumps or pickle.dumps.
16+
17+ The \module {bsddb} module is only available on \UNIX {} systems, so it
18+ is not built by default in the standard Python distribution. Also,
19+ there are two incompatible versions of the underlying library.
20+ Version 1.85 is widely available, but has some known bugs. Version 2
21+ is not quite as widely used, but does offer some improvements. The
22+ \module {bsddb} module uses the 1.85 interface. Users wishing to use
23+ version 2 of the Berkeley DB library will have to modify the source
24+ for the module to include \file {db_185.h} instead of
25+ \file {db.h} (\file {db_185.h} contains the version 1.85 compatibility
26+ interface).
2527
2628The \module {bsddb} module defines the following functions that create
27- objects that access the appropriate type of Berkeley DB file. The first two
28- arguments of each function are the same. For ease of portability, only the
29- first two arguments should be used in most instances.
29+ objects that access the appropriate type of Berkeley DB file. The
30+ first two arguments of each function are the same. For ease of
31+ portability, only the first two arguments should be used in most
32+ instances.
3033
3134\begin {funcdesc }{hashopen}{filename\optional {, flag\optional {,
32- mode\optional {, bsize\optional {, ffactor\optional {, nelem\optional {,
33- cachesize\optional {, hash\optional {, lorder}}}}}}}}}
34- Open the hash format file named \var {filename}. The optional \var {flag}
35- identifies the mode used to open the file. It may be `` r'' (read only),
36- `` w'' (read-write), `` c'' (read-write - create if necessary) or `` n''
37- (read-write - truncate to zero length). The other arguments are rarely used
38- and are just passed to the low-level dbopen function. Consult the
39- Berkeley DB documentation for their use and interpretation.
35+ mode\optional {, bsize\optional {,
36+ ffactor\optional {, nelem\optional {,
37+ cachesize\optional {, hash\optional {,
38+ lorder}}}}}}}}}
39+ Open the hash format file named \var {filename}. The optional
40+ \var {flag} identifies the mode used to open the file. It may be
41+ \character {r} (read only), \character {w} (read-write),
42+ \character {c} (read-write - create if necessary) or
43+ \character {n} (read-write - truncate to zero length). The other
44+ arguments are rarely used and are just passed to the low-level
45+ \cfunction {dbopen()} function. Consult the Berkeley DB documentation
46+ for their use and interpretation.
4047\end {funcdesc }
4148
42-
4349\begin {funcdesc }{btopen}{filename\optional {, flag\optional {,
4450mode\optional {, btflags\optional {, cachesize\optional {, maxkeypage\optional {,
4551minkeypage\optional {, psize\optional {, lorder}}}}}}}}}
46- Open the btree format file named \var {filename}. The optional \var {flag}
47- identifies the mode used to open the file. It may be `` r'' (read only),
48- `` w'' (read-write), `` c'' (read-write - create if necessary) or `` n''
49- (read-write - truncate to zero length). The other arguments are rarely used
50- and are just passed to the low-level dbopen function. Consult the
51- Berkeley DB documentation for their use and interpretation.
52+
53+ Open the btree format file named \var {filename}. The optional
54+ \var {flag} identifies the mode used to open the file. It may be
55+ \character {r} (read only), \character {w} (read-write),
56+ \character {c} (read-write - create if necessary) or
57+ \character {n} (read-write - truncate to zero length). The other
58+ arguments are rarely used and are just passed to the low-level dbopen
59+ function. Consult the Berkeley DB documentation for their use and
60+ interpretation.
5261\end {funcdesc }
5362
5463\begin {funcdesc }{rnopen}{filename\optional {, flag\optional {, mode\optional {,
5564rnflags\optional {, cachesize\optional {, psize\optional {, lorder\optional {,
5665reclen\optional {, bval\optional {, bfname}}}}}}}}}}
57- Open a DB record format file named \var {filename}. The optional \var {flag}
58- identifies the mode used to open the file. It may be `` r'' (read only),
59- `` w'' (read-write), `` c'' (read-write - create if necessary) or `` n''
60- (read-write - truncate to zero length). The other arguments are rarely used
61- and are just passed to the low-level dbopen function. Consult the
62- Berkeley DB documentation for their use and interpretation.
66+
67+ Open a DB record format file named \var {filename}. The optional
68+ \var {flag} identifies the mode used to open the file. It may be
69+ \character {r} (read only), \character {w} (read-write),
70+ \character {c} (read-write - create if necessary) or
71+ \character {n} (read-write - truncate to zero length). The other
72+ arguments are rarely used and are just passed to the low-level dbopen
73+ function. Consult the Berkeley DB documentation for their use and
74+ interpretation.
6375\end {funcdesc }
6476
6577
@@ -86,7 +98,7 @@ \subsection{Hash, BTree and Record Objects \label{bsddb-objects}}
8698\end {methoddesc }
8799
88100\begin {methoddesc }{has_key}{key}
89- Return 1 if the DB file contains the argument as a key.
101+ Return \code {1} if the DB file contains the argument as a key.
90102\end {methoddesc }
91103
92104\begin {methoddesc }{set_location}{key}
0 commit comments