Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Modules/bsddb.h

    r132 r391  
    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)
    7273 *
    7374 * New datatypes:
     
    110111#endif
    111112
    112 #define PY_BSDDB_VERSION "4.8.4"
     113#define PY_BSDDB_VERSION "5.3.0"
    113114
    114115/* Python object definitions */
     
    130131struct DBTxnObject;       /* Forward declaration */
    131132struct DBSequenceObject;  /* Forward declaration */
     133#if (DBVER >= 52)
     134struct DBSiteObject;      /* Forward declaration */
     135#endif
    132136
    133137typedef struct {
     
    141145    struct DBTxnObject *children_txns;
    142146    struct DBLogCursorObject *children_logcursors;
     147#if (DBVER >= 52)
     148    struct DBSiteObject *children_sites;
     149#endif
    143150    PyObject        *private_obj;
    144151    PyObject        *rep_transport;
     
    155162    struct DBTxnObject *txn;
    156163    struct DBCursorObject *children_cursors;
    157 #if (DBVER >=43)
    158164    struct DBSequenceObject *children_sequences;
    159 #endif
    160165    struct DBObject **sibling_prev_p;
    161166    struct DBObject *sibling_next;
     
    164169    PyObject*       associateCallback;
    165170    PyObject*       btCompareCallback;
     171    PyObject*       dupCompareCallback;     
    166172    int             primaryDBType;
    167173    PyObject        *private_obj;
     
    208214} DBLogCursorObject;
    209215
     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
    210226
    211227typedef struct {
     
    217233
    218234
    219 #if (DBVER >= 43)
    220235typedef struct DBSequenceObject {
    221236    PyObject_HEAD
     
    229244    PyObject        *in_weakreflist; /* List of weak references */
    230245} DBSequenceObject;
    231 #endif
    232246
    233247
     
    237251   following (error checking missed out for clarity):
    238252
    239      // If you are using Python before 3.2:
     253     // If you are using Python before 2.7:
    240254     BSDDB_api* bsddb_api;
    241255     PyObject*  mod;
     
    250264
    251265
    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)
    253267     BSDDB_api* bsddb_api;
    254268
     
    258272
    259273
     274   Check "api_version" number before trying to use the API.
     275
    260276   The structure's members must not be changed.
    261277*/
    262278
     279#define PYBSDDB_API_VERSION 1
    263280typedef struct {
     281    unsigned int api_version;
    264282    /* Type objects */
    265283    PyTypeObject* db_type;
     
    269287    PyTypeObject* dbtxn_type;
    270288    PyTypeObject* dblock_type;
    271 #if (DBVER >= 43)
    272289    PyTypeObject* dbsequence_type;
    273 #endif
    274290
    275291    /* Functions */
     
    290306#define DBTxnObject_Check(v)    ((v)->ob_type == bsddb_api->dbtxn_type)
    291307#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))
    295311
    296312#endif /* COMPILING_BSDDB_C */
Note: See TracChangeset for help on using the changeset viewer.