annotate Modules/bsddb.h @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents b103cc65e53d
children 83fd64c97296
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
1 /*----------------------------------------------------------------------
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
2 Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
3 and Andrew Kuchling. All rights reserved.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
4
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
5 Redistribution and use in source and binary forms, with or without
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
6 modification, are permitted provided that the following conditions are
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
7 met:
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
8
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
9 o Redistributions of source code must retain the above copyright
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
10 notice, this list of conditions, and the disclaimer that follows.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
11
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
12 o Redistributions in binary form must reproduce the above copyright
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
13 notice, this list of conditions, and the following disclaimer in
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
14 the documentation and/or other materials provided with the
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
15 distribution.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
16
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
17 o Neither the name of Digital Creations nor the names of its
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
18 contributors may be used to endorse or promote products derived
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
19 from this software without specific prior written permission.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
20
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
21 THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
22 IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
23 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
24 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
25 CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
27 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
28 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
29 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
30 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
31 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
32 DAMAGE.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
33 ------------------------------------------------------------------------*/
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
34
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
35
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
36 /*
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
37 * Handwritten code to wrap version 3.x of the Berkeley DB library,
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
38 * written to replace a SWIG-generated file. It has since been updated
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
39 * to compile with Berkeley DB versions 3.2 through 4.2.
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
40 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
41 * This module was started by Andrew Kuchling to remove the dependency
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
42 * on SWIG in a package by Gregory P. Smith who based his work on a
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
43 * similar package by Robin Dunn <robin@alldunn.com> which wrapped
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
44 * Berkeley DB 2.7.x.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
45 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
46 * Development of this module then returned full circle back to Robin Dunn
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
47 * who worked on behalf of Digital Creations to complete the wrapping of
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
48 * the DB 3.x API and to build a solid unit test suite. Robin has
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
49 * since gone onto other projects (wxPython).
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
50 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
51 * Gregory P. Smith <greg@krypto.org> is once again the maintainer.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
52 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
53 * Use the pybsddb-users@lists.sf.net mailing list for all questions.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
54 * Things can change faster than the header of this file is updated. This
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
55 * file is shared with the PyBSDDB project at SourceForge:
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
56 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
57 * http://pybsddb.sf.net
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
58 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
59 * This file should remain backward compatible with Python 2.1, but see PEP
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
60 * 291 for the most current backward compatibility requirements:
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
61 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
62 * http://www.python.org/peps/pep-0291.html
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
63 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
64 * This module contains 6 types:
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
65 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
66 * DB (Database)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
67 * DBCursor (Database Cursor)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
68 * DBEnv (database environment)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
69 * DBTxn (An explicit database transaction)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
70 * DBLock (A lock handle)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
71 * DBSequence (Sequence)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
72 *
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
73 * New datatypes:
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
74 *
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
75 * DBLogCursor (Log Cursor)
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
76 *
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
77 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
78
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
79 /* --------------------------------------------------------------------- */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
80
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
81 /*
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
82 * Portions of this module, associated unit tests and build scripts are the
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
83 * result of a contract with The Written Word (http://thewrittenword.com/)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
84 * Many thanks go out to them for causing me to raise the bar on quality and
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
85 * functionality, resulting in a better bsddb3 package for all of us to use.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
86 *
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
87 * --Robin
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
88 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
89
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
90 /* --------------------------------------------------------------------- */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
91
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
92 /*
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
93 * Work to split it up into a separate header and to add a C API was
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
94 * contributed by Duncan Grisby <duncan@tideway.com>. See here:
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
95 * http://sourceforge.net/tracker/index.php?func=detail&aid=1551895&group_id=13900&atid=313900
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
96 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
97
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
98 /* --------------------------------------------------------------------- */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
99
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
100 #ifndef _BSDDB_H_
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
101 #define _BSDDB_H_
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
102
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
103 #include <db.h>
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
104
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
105
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
106 /* 40 = 4.0, 33 = 3.3; this will break if the minor revision is > 9 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
107 #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
108 #if DB_VERSION_MINOR > 9
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
109 #error "eek! DBVER can't handle minor versions > 9"
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
110 #endif
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
111
74461
b103cc65e53d Berkeley DB: Erratic behaviour of "DBEnv->rep_elect()" because a typo
Jesus Cea <jcea@jcea.es>
parents: 65951
diff changeset
112 #define PY_BSDDB_VERSION "4.8.4.2"
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
113
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
114 /* Python object definitions */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
115
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
116 struct behaviourFlags {
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
117 /* What is the default behaviour when DB->get or DBCursor->get returns a
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
118 DB_NOTFOUND || DB_KEYEMPTY error? Return None or raise an exception? */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
119 unsigned int getReturnsNone : 1;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
120 /* What is the default behaviour for DBCursor.set* methods when DBCursor->get
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
121 * returns a DB_NOTFOUND || DB_KEYEMPTY error? Return None or raise? */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
122 unsigned int cursorSetReturnsNone : 1;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
123 };
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
124
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
125
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
126
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
127 struct DBObject; /* Forward declaration */
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
128 struct DBCursorObject; /* Forward declaration */
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
129 struct DBLogCursorObject; /* Forward declaration */
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
130 struct DBTxnObject; /* Forward declaration */
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
131 struct DBSequenceObject; /* Forward declaration */
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
132
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
133 typedef struct {
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
134 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
135 DB_ENV* db_env;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
136 u_int32_t flags; /* saved flags from open() */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
137 int closed;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
138 struct behaviourFlags moduleFlags;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
139 PyObject* event_notifyCallback;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
140 struct DBObject *children_dbs;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
141 struct DBTxnObject *children_txns;
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
142 struct DBLogCursorObject *children_logcursors;
48910
81a1a1545172 Update bsddb code to version 4.7.3pre2. This code should
Jesus Cea <jcea@jcea.es>
parents: 48054
diff changeset
143 PyObject *private_obj;
48054
10f41adc0d24 bsddb module updated to version 4.7.2devel9.
Jesus Cea <jcea@jcea.es>
parents: 47213
diff changeset
144 PyObject *rep_transport;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
145 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
146 } DBEnvObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
147
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
148 typedef struct DBObject {
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
149 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
150 DB* db;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
151 DBEnvObject* myenvobj; /* PyObject containing the DB_ENV */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
152 u_int32_t flags; /* saved flags from open() */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
153 u_int32_t setflags; /* saved flags from set_flags() */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
154 struct behaviourFlags moduleFlags;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
155 struct DBTxnObject *txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
156 struct DBCursorObject *children_cursors;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
157 #if (DBVER >=43)
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
158 struct DBSequenceObject *children_sequences;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
159 #endif
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
160 struct DBObject **sibling_prev_p;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
161 struct DBObject *sibling_next;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
162 struct DBObject **sibling_prev_p_txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
163 struct DBObject *sibling_next_txn;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
164 PyObject* associateCallback;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
165 PyObject* btCompareCallback;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
166 int primaryDBType;
48910
81a1a1545172 Update bsddb code to version 4.7.3pre2. This code should
Jesus Cea <jcea@jcea.es>
parents: 48054
diff changeset
167 PyObject *private_obj;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
168 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
169 } DBObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
170
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
171
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
172 typedef struct DBCursorObject {
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
173 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
174 DBC* dbc;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
175 struct DBCursorObject **sibling_prev_p;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
176 struct DBCursorObject *sibling_next;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
177 struct DBCursorObject **sibling_prev_p_txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
178 struct DBCursorObject *sibling_next_txn;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
179 DBObject* mydb;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
180 struct DBTxnObject *txn;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
181 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
182 } DBCursorObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
183
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
184
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
185 typedef struct DBTxnObject {
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
186 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
187 DB_TXN* txn;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
188 DBEnvObject* env;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
189 int flag_prepare;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
190 struct DBTxnObject *parent_txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
191 struct DBTxnObject **sibling_prev_p;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
192 struct DBTxnObject *sibling_next;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
193 struct DBTxnObject *children_txns;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
194 struct DBObject *children_dbs;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
195 struct DBSequenceObject *children_sequences;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
196 struct DBCursorObject *children_cursors;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
197 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
198 } DBTxnObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
199
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
200
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
201 typedef struct DBLogCursorObject {
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
202 PyObject_HEAD
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
203 DB_LOGC* logc;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
204 DBEnvObject* env;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
205 struct DBLogCursorObject **sibling_prev_p;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
206 struct DBLogCursorObject *sibling_next;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
207 PyObject *in_weakreflist; /* List of weak references */
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
208 } DBLogCursorObject;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
209
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
210
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
211 typedef struct {
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
212 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
213 DB_LOCK lock;
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
214 int lock_initialized; /* Signal if we actually have a lock */
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
215 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
216 } DBLockObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
217
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
218
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
219 #if (DBVER >= 43)
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
220 typedef struct DBSequenceObject {
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
221 PyObject_HEAD
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
222 DB_SEQUENCE* sequence;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
223 DBObject* mydb;
46981
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
224 struct DBTxnObject *txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
225 struct DBSequenceObject **sibling_prev_p;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
226 struct DBSequenceObject *sibling_next;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
227 struct DBSequenceObject **sibling_prev_p_txn;
69da7a4f2f8e bsddb module updated to version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 44295
diff changeset
228 struct DBSequenceObject *sibling_next_txn;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
229 PyObject *in_weakreflist; /* List of weak references */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
230 } DBSequenceObject;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
231 #endif
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
232
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
233
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
234 /* API structure for use by C code */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
235
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
236 /* To access the structure from an external module, use code like the
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
237 following (error checking missed out for clarity):
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
238
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
239 // If you are using Python before 3.2:
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
240 BSDDB_api* bsddb_api;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
241 PyObject* mod;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
242 PyObject* cobj;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
243
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
244 mod = PyImport_ImportModule("bsddb._bsddb");
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
245 // Use "bsddb3._pybsddb" if you're using the standalone pybsddb add-on.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
246 cobj = PyObject_GetAttrString(mod, "api");
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
247 api = (BSDDB_api*)PyCObject_AsVoidPtr(cobj);
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
248 Py_DECREF(cobj);
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
249 Py_DECREF(mod);
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
250
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
251
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
252 // If you are using Python 3.2 or up:
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
253 BSDDB_api* bsddb_api;
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
254
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
255 // Use "bsddb3._pybsddb.api" if you're using
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
256 // the standalone pybsddb add-on.
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
257 bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
258
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
259
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
260 The structure's members must not be changed.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
261 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
262
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
263 typedef struct {
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
264 /* Type objects */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
265 PyTypeObject* db_type;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
266 PyTypeObject* dbcursor_type;
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 49334
diff changeset
267 PyTypeObject* dblogcursor_type;
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
268 PyTypeObject* dbenv_type;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
269 PyTypeObject* dbtxn_type;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
270 PyTypeObject* dblock_type;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
271 #if (DBVER >= 43)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
272 PyTypeObject* dbsequence_type;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
273 #endif
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
274
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
275 /* Functions */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
276 int (*makeDBError)(int err);
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
277 } BSDDB_api;
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
278
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
279
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
280 #ifndef COMPILING_BSDDB_C
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
281
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
282 /* If not inside _bsddb.c, define type check macros that use the api
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
283 structure. The calling code must have a value named bsddb_api
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
284 pointing to the api structure.
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
285 */
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
286
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
287 #define DBObject_Check(v) ((v)->ob_type == bsddb_api->db_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
288 #define DBCursorObject_Check(v) ((v)->ob_type == bsddb_api->dbcursor_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
289 #define DBEnvObject_Check(v) ((v)->ob_type == bsddb_api->dbenv_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
290 #define DBTxnObject_Check(v) ((v)->ob_type == bsddb_api->dbtxn_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
291 #define DBLockObject_Check(v) ((v)->ob_type == bsddb_api->dblock_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
292 #if (DBVER >= 43)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
293 #define DBSequenceObject_Check(v) ((v)->ob_type == bsddb_api->dbsequence_type)
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
294 #endif
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
295
44295
635a23280112 Fixed a warning in _codecs_iso2022.c and some non C89 conform // comments.
Christian Heimes <christian@cheimes.de>
parents: 43504
diff changeset
296 #endif /* COMPILING_BSDDB_C */
43504
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
297
33021e403f3c Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
298
44295
635a23280112 Fixed a warning in _codecs_iso2022.c and some non C89 conform // comments.
Christian Heimes <christian@cheimes.de>
parents: 43504
diff changeset
299 #endif /* _BSDDB_H_ */