Changeset 391 for python/trunk/Modules/bsddb.h
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Modules/bsddb.h
r132 r391 62 62 * http://www.python.org/peps/pep-0291.html 63 63 * 64 * This module contains 6types:64 * This module contains 7 types: 65 65 * 66 66 * DB (Database) … … 70 70 * DBLock (A lock handle) 71 71 * DBSequence (Sequence) 72 * DBSite (Site) 72 73 * 73 74 * New datatypes: … … 110 111 #endif 111 112 112 #define PY_BSDDB_VERSION " 4.8.4"113 #define PY_BSDDB_VERSION "5.3.0" 113 114 114 115 /* Python object definitions */ … … 130 131 struct DBTxnObject; /* Forward declaration */ 131 132 struct DBSequenceObject; /* Forward declaration */ 133 #if (DBVER >= 52) 134 struct DBSiteObject; /* Forward declaration */ 135 #endif 132 136 133 137 typedef struct { … … 141 145 struct DBTxnObject *children_txns; 142 146 struct DBLogCursorObject *children_logcursors; 147 #if (DBVER >= 52) 148 struct DBSiteObject *children_sites; 149 #endif 143 150 PyObject *private_obj; 144 151 PyObject *rep_transport; … … 155 162 struct DBTxnObject *txn; 156 163 struct DBCursorObject *children_cursors; 157 #if (DBVER >=43)158 164 struct DBSequenceObject *children_sequences; 159 #endif160 165 struct DBObject **sibling_prev_p; 161 166 struct DBObject *sibling_next; … … 164 169 PyObject* associateCallback; 165 170 PyObject* btCompareCallback; 171 PyObject* dupCompareCallback; 166 172 int primaryDBType; 167 173 PyObject *private_obj; … … 208 214 } DBLogCursorObject; 209 215 216 #if (DBVER >= 52) 217 typedef struct DBSiteObject { 218 PyObject_HEAD 219 DB_SITE *site; 220 DBEnvObject *env; 221 struct DBSiteObject **sibling_prev_p; 222 struct DBSiteObject *sibling_next; 223 PyObject *in_weakreflist; /* List of weak references */ 224 } DBSiteObject; 225 #endif 210 226 211 227 typedef struct { … … 217 233 218 234 219 #if (DBVER >= 43)220 235 typedef struct DBSequenceObject { 221 236 PyObject_HEAD … … 229 244 PyObject *in_weakreflist; /* List of weak references */ 230 245 } DBSequenceObject; 231 #endif232 246 233 247 … … 237 251 following (error checking missed out for clarity): 238 252 239 // If you are using Python before 3.2:253 // If you are using Python before 2.7: 240 254 BSDDB_api* bsddb_api; 241 255 PyObject* mod; … … 250 264 251 265 252 // If you are using Python 3.2 or up:266 // If you are using Python 2.7 or up: (except Python 3.0, unsupported) 253 267 BSDDB_api* bsddb_api; 254 268 … … 258 272 259 273 274 Check "api_version" number before trying to use the API. 275 260 276 The structure's members must not be changed. 261 277 */ 262 278 279 #define PYBSDDB_API_VERSION 1 263 280 typedef struct { 281 unsigned int api_version; 264 282 /* Type objects */ 265 283 PyTypeObject* db_type; … … 269 287 PyTypeObject* dbtxn_type; 270 288 PyTypeObject* dblock_type; 271 #if (DBVER >= 43)272 289 PyTypeObject* dbsequence_type; 273 #endif274 290 275 291 /* Functions */ … … 290 306 #define DBTxnObject_Check(v) ((v)->ob_type == bsddb_api->dbtxn_type) 291 307 #define DBLockObject_Check(v) ((v)->ob_type == bsddb_api->dblock_type) 292 # if (DBVER >= 43)293 #define DBSequenceObject_Check(v) ((v)->ob_type == bsddb_api->dbsequence_type) 294 #endif 308 #define DBSequenceObject_Check(v) \ 309 ((bsddb_api->dbsequence_type) && \ 310 ((v)->ob_type == bsddb_api->dbsequence_type)) 295 311 296 312 #endif /* COMPILING_BSDDB_C */
Note:
See TracChangeset
for help on using the changeset viewer.