Ignore:
Timestamp:
Jan 4, 2011, 10:35:57 AM (15 years ago)
Author:
Yuri Dario
Message:

python: backported bdb 4.8.x code from Python 2.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Modules/bsddb.h

    r2 r132  
    7171 * DBSequence   (Sequence)
    7272 *
     73 * New datatypes:
     74 *
     75 * DBLogCursor  (Log Cursor)
     76 *
    7377 */
    7478
     
    106110#endif
    107111
    108 #define PY_BSDDB_VERSION "4.7.3"
     112#define PY_BSDDB_VERSION "4.8.4"
    109113
    110114/* Python object definitions */
     
    123127struct DBObject;          /* Forward declaration */
    124128struct DBCursorObject;    /* Forward declaration */
     129struct DBLogCursorObject; /* Forward declaration */
    125130struct DBTxnObject;       /* Forward declaration */
    126131struct DBSequenceObject;  /* Forward declaration */
     
    135140    struct DBObject *children_dbs;
    136141    struct DBTxnObject *children_txns;
     142    struct DBLogCursorObject *children_logcursors;
    137143    PyObject        *private_obj;
    138144    PyObject        *rep_transport;
     
    146152    u_int32_t       flags;     /* saved flags from open() */
    147153    u_int32_t       setflags;  /* saved flags from set_flags() */
    148     int             haveStat;
    149154    struct behaviourFlags moduleFlags;
    150155    struct DBTxnObject *txn;
     
    194199
    195200
     201typedef struct DBLogCursorObject {
     202    PyObject_HEAD
     203    DB_LOGC*        logc;
     204    DBEnvObject*    env;
     205    struct DBLogCursorObject **sibling_prev_p;
     206    struct DBLogCursorObject *sibling_next;
     207    PyObject        *in_weakreflist; /* List of weak references */
     208} DBLogCursorObject;
     209
     210
    196211typedef struct {
    197212    PyObject_HEAD
    198213    DB_LOCK         lock;
     214    int             lock_initialized;  /* Signal if we actually have a lock */
    199215    PyObject        *in_weakreflist; /* List of weak references */
    200216} DBLockObject;
     
    221237   following (error checking missed out for clarity):
    222238
     239     // If you are using Python before 3.2:
    223240     BSDDB_api* bsddb_api;
    224241     PyObject*  mod;
     
    232249     Py_DECREF(mod);
    233250
     251
     252     // If you are using Python 3.2 or up:
     253     BSDDB_api* bsddb_api;
     254
     255     // Use "bsddb3._pybsddb.api" if you're using
     256     // the standalone pybsddb add-on.
     257     bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
     258
     259
    234260   The structure's members must not be changed.
    235261*/
     
    239265    PyTypeObject* db_type;
    240266    PyTypeObject* dbcursor_type;
     267    PyTypeObject* dblogcursor_type;
    241268    PyTypeObject* dbenv_type;
    242269    PyTypeObject* dbtxn_type;
     
    248275    /* Functions */
    249276    int (*makeDBError)(int err);
    250 
    251277} BSDDB_api;
    252278
Note: See TracChangeset for help on using the changeset viewer.