Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Modules/bsddb.h

    r2 r388  
    6262 * http://www.python.org/peps/pep-0291.html
    6363 *
    64  * This module contains 6 types:
     64 * This module contains 7 types:
    6565 *
    6666 * DB           (Database)
     
    7070 * DBLock       (A lock handle)
    7171 * DBSequence   (Sequence)
     72 * DBSite       (Site)
     73 *
     74 * New datatypes:
     75 *
     76 * DBLogCursor  (Log Cursor)
    7277 *
    7378 */
     
    106111#endif
    107112
    108 #define PY_BSDDB_VERSION "4.7.3"
     113#define PY_BSDDB_VERSION "5.3.0"
    109114
    110115/* Python object definitions */
     
    123128struct DBObject;          /* Forward declaration */
    124129struct DBCursorObject;    /* Forward declaration */
     130struct DBLogCursorObject; /* Forward declaration */
    125131struct DBTxnObject;       /* Forward declaration */
    126132struct DBSequenceObject;  /* Forward declaration */
     133#if (DBVER >= 52)
     134struct DBSiteObject;      /* Forward declaration */
     135#endif
    127136
    128137typedef struct {
     
    135144    struct DBObject *children_dbs;
    136145    struct DBTxnObject *children_txns;
     146    struct DBLogCursorObject *children_logcursors;
     147#if (DBVER >= 52)
     148    struct DBSiteObject *children_sites;
     149#endif
    137150    PyObject        *private_obj;
    138151    PyObject        *rep_transport;
     
    146159    u_int32_t       flags;     /* saved flags from open() */
    147160    u_int32_t       setflags;  /* saved flags from set_flags() */
    148     int             haveStat;
    149161    struct behaviourFlags moduleFlags;
    150162    struct DBTxnObject *txn;
    151163    struct DBCursorObject *children_cursors;
    152 #if (DBVER >=43)
    153164    struct DBSequenceObject *children_sequences;
    154 #endif
    155165    struct DBObject **sibling_prev_p;
    156166    struct DBObject *sibling_next;
     
    159169    PyObject*       associateCallback;
    160170    PyObject*       btCompareCallback;
     171    PyObject*       dupCompareCallback;     
    161172    int             primaryDBType;
    162173    PyObject        *private_obj;
     
    194205
    195206
     207typedef struct DBLogCursorObject {
     208    PyObject_HEAD
     209    DB_LOGC*        logc;
     210    DBEnvObject*    env;
     211    struct DBLogCursorObject **sibling_prev_p;
     212    struct DBLogCursorObject *sibling_next;
     213    PyObject        *in_weakreflist; /* List of weak references */
     214} DBLogCursorObject;
     215
     216#if (DBVER >= 52)
     217typedef 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
     226
    196227typedef struct {
    197228    PyObject_HEAD
    198229    DB_LOCK         lock;
     230    int             lock_initialized;  /* Signal if we actually have a lock */
    199231    PyObject        *in_weakreflist; /* List of weak references */
    200232} DBLockObject;
    201233
    202234
    203 #if (DBVER >= 43)
    204235typedef struct DBSequenceObject {
    205236    PyObject_HEAD
     
    213244    PyObject        *in_weakreflist; /* List of weak references */
    214245} DBSequenceObject;
    215 #endif
    216246
    217247
     
    221251   following (error checking missed out for clarity):
    222252
     253     // If you are using Python before 2.7:
    223254     BSDDB_api* bsddb_api;
    224255     PyObject*  mod;
     
    232263     Py_DECREF(mod);
    233264
     265
     266     // If you are using Python 2.7 or up: (except Python 3.0, unsupported)
     267     BSDDB_api* bsddb_api;
     268
     269     // Use "bsddb3._pybsddb.api" if you're using
     270     // the standalone pybsddb add-on.
     271     bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
     272
     273
     274   Check "api_version" number before trying to use the API.
     275
    234276   The structure's members must not be changed.
    235277*/
    236278
     279#define PYBSDDB_API_VERSION 1
    237280typedef struct {
     281    unsigned int api_version;
    238282    /* Type objects */
    239283    PyTypeObject* db_type;
    240284    PyTypeObject* dbcursor_type;
     285    PyTypeObject* dblogcursor_type;
    241286    PyTypeObject* dbenv_type;
    242287    PyTypeObject* dbtxn_type;
    243288    PyTypeObject* dblock_type;
    244 #if (DBVER >= 43)
    245289    PyTypeObject* dbsequence_type;
    246 #endif
    247290
    248291    /* Functions */
    249292    int (*makeDBError)(int err);
    250 
    251293} BSDDB_api;
    252294
     
    264306#define DBTxnObject_Check(v)    ((v)->ob_type == bsddb_api->dbtxn_type)
    265307#define DBLockObject_Check(v)   ((v)->ob_type == bsddb_api->dblock_type)
    266 #if (DBVER >= 43)
    267 #define DBSequenceObject_Check(v)  ((v)->ob_type == bsddb_api->dbsequence_type)
    268 #endif
     308#define DBSequenceObject_Check(v)  \
     309    ((bsddb_api->dbsequence_type) && \
     310        ((v)->ob_type == bsddb_api->dbsequence_type))
    269311
    270312#endif /* COMPILING_BSDDB_C */
Note: See TracChangeset for help on using the changeset viewer.