Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/include
File: db.h
/*
[1500] Fix | Delete
* Cursor queues.
[1501] Fix | Delete
*
[1502] Fix | Delete
* !!!
[1503] Fix | Delete
* Explicit representations of structures from queue.h.
[1504] Fix | Delete
* TAILQ_HEAD(__cq_fq, __dbc) free_queue;
[1505] Fix | Delete
* TAILQ_HEAD(__cq_aq, __dbc) active_queue;
[1506] Fix | Delete
* TAILQ_HEAD(__cq_jq, __dbc) join_queue;
[1507] Fix | Delete
*/
[1508] Fix | Delete
struct __cq_fq {
[1509] Fix | Delete
struct __dbc *tqh_first;
[1510] Fix | Delete
struct __dbc **tqh_last;
[1511] Fix | Delete
} free_queue;
[1512] Fix | Delete
struct __cq_aq {
[1513] Fix | Delete
struct __dbc *tqh_first;
[1514] Fix | Delete
struct __dbc **tqh_last;
[1515] Fix | Delete
} active_queue;
[1516] Fix | Delete
struct __cq_jq {
[1517] Fix | Delete
struct __dbc *tqh_first;
[1518] Fix | Delete
struct __dbc **tqh_last;
[1519] Fix | Delete
} join_queue;
[1520] Fix | Delete
[1521] Fix | Delete
/*
[1522] Fix | Delete
* Secondary index support.
[1523] Fix | Delete
*
[1524] Fix | Delete
* Linked list of secondary indices -- set in the primary.
[1525] Fix | Delete
*
[1526] Fix | Delete
* !!!
[1527] Fix | Delete
* Explicit representations of structures from queue.h.
[1528] Fix | Delete
* LIST_HEAD(s_secondaries, __db);
[1529] Fix | Delete
*/
[1530] Fix | Delete
struct {
[1531] Fix | Delete
struct __db *lh_first;
[1532] Fix | Delete
} s_secondaries;
[1533] Fix | Delete
[1534] Fix | Delete
/*
[1535] Fix | Delete
* List entries for secondaries, and reference count of how many
[1536] Fix | Delete
* threads are updating this secondary (see Dbc.put).
[1537] Fix | Delete
*
[1538] Fix | Delete
* !!!
[1539] Fix | Delete
* Note that these are synchronized by the primary's mutex, but
[1540] Fix | Delete
* filled in in the secondaries.
[1541] Fix | Delete
*
[1542] Fix | Delete
* !!!
[1543] Fix | Delete
* Explicit representations of structures from queue.h.
[1544] Fix | Delete
* LIST_ENTRY(__db) s_links;
[1545] Fix | Delete
*/
[1546] Fix | Delete
struct {
[1547] Fix | Delete
struct __db *le_next;
[1548] Fix | Delete
struct __db **le_prev;
[1549] Fix | Delete
} s_links;
[1550] Fix | Delete
u_int32_t s_refcnt;
[1551] Fix | Delete
[1552] Fix | Delete
/* Secondary callback and free functions -- set in the secondary. */
[1553] Fix | Delete
int (*s_callback) __P((DB *, const DBT *, const DBT *, DBT *));
[1554] Fix | Delete
[1555] Fix | Delete
/* Reference to primary -- set in the secondary. */
[1556] Fix | Delete
DB *s_primary;
[1557] Fix | Delete
[1558] Fix | Delete
#define DB_ASSOC_IMMUTABLE_KEY 0x00000001 /* Secondary key is immutable. */
[1559] Fix | Delete
#define DB_ASSOC_CREATE 0x00000002 /* Secondary db populated on open. */
[1560] Fix | Delete
[1561] Fix | Delete
/* Flags passed to associate -- set in the secondary. */
[1562] Fix | Delete
u_int32_t s_assoc_flags;
[1563] Fix | Delete
[1564] Fix | Delete
/*
[1565] Fix | Delete
* Foreign key support.
[1566] Fix | Delete
*
[1567] Fix | Delete
* Linked list of primary dbs -- set in the foreign db
[1568] Fix | Delete
*
[1569] Fix | Delete
* !!!
[1570] Fix | Delete
* Explicit representations of structures from queue.h.
[1571] Fix | Delete
* LIST_HEAD(f_primaries, __db);
[1572] Fix | Delete
*/
[1573] Fix | Delete
struct {
[1574] Fix | Delete
struct __db_foreign_info *lh_first;
[1575] Fix | Delete
} f_primaries;
[1576] Fix | Delete
[1577] Fix | Delete
/*
[1578] Fix | Delete
* !!!
[1579] Fix | Delete
* Explicit representations of structures from queue.h.
[1580] Fix | Delete
* TAILQ_ENTRY(__db) felink;
[1581] Fix | Delete
*
[1582] Fix | Delete
* Links in a list of DBs involved in file extension
[1583] Fix | Delete
* during a transaction. These are to be used only while the
[1584] Fix | Delete
* metadata is locked.
[1585] Fix | Delete
*/
[1586] Fix | Delete
struct {
[1587] Fix | Delete
struct __db *tqe_next;
[1588] Fix | Delete
struct __db **tqe_prev;
[1589] Fix | Delete
} felink;
[1590] Fix | Delete
[1591] Fix | Delete
/* Reference to foreign -- set in the secondary. */
[1592] Fix | Delete
DB *s_foreign;
[1593] Fix | Delete
[1594] Fix | Delete
/* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */
[1595] Fix | Delete
void *api_internal;
[1596] Fix | Delete
[1597] Fix | Delete
/* Subsystem-private structure. */
[1598] Fix | Delete
void *bt_internal; /* Btree/Recno access method. */
[1599] Fix | Delete
void *h_internal; /* Hash access method. */
[1600] Fix | Delete
void *heap_internal; /* Heap access method. */
[1601] Fix | Delete
void *p_internal; /* Partition informaiton. */
[1602] Fix | Delete
void *q_internal; /* Queue access method. */
[1603] Fix | Delete
[1604] Fix | Delete
/* DB PUBLIC HANDLE LIST BEGIN */
[1605] Fix | Delete
int (*associate) __P((DB *, DB_TXN *, DB *,
[1606] Fix | Delete
int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
[1607] Fix | Delete
int (*associate_foreign) __P((DB *, DB *,
[1608] Fix | Delete
int (*)(DB *, const DBT *, DBT *, const DBT *, int *),
[1609] Fix | Delete
u_int32_t));
[1610] Fix | Delete
int (*close) __P((DB *, u_int32_t));
[1611] Fix | Delete
int (*compact) __P((DB *,
[1612] Fix | Delete
DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
[1613] Fix | Delete
int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
[1614] Fix | Delete
int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
[1615] Fix | Delete
void (*err) __P((DB *, int, const char *, ...));
[1616] Fix | Delete
void (*errx) __P((DB *, const char *, ...));
[1617] Fix | Delete
int (*exists) __P((DB *, DB_TXN *, DBT *, u_int32_t));
[1618] Fix | Delete
int (*fd) __P((DB *, int *));
[1619] Fix | Delete
int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
[1620] Fix | Delete
int (*get_alloc) __P((DB *, void *(**)(size_t),
[1621] Fix | Delete
void *(**)(void *, size_t), void (**)(void *)));
[1622] Fix | Delete
int (*get_append_recno) __P((DB *, int (**)(DB *, DBT *, db_recno_t)));
[1623] Fix | Delete
int (*get_assoc_flags) __P((DB *, u_int32_t *));
[1624] Fix | Delete
int (*get_bt_compare)
[1625] Fix | Delete
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
[1626] Fix | Delete
int (*get_bt_compress) __P((DB *,
[1627] Fix | Delete
int (**)(DB *,
[1628] Fix | Delete
const DBT *, const DBT *, const DBT *, const DBT *, DBT *),
[1629] Fix | Delete
int (**)(DB *, const DBT *, const DBT *, DBT *, DBT *, DBT *)));
[1630] Fix | Delete
int (*get_bt_minkey) __P((DB *, u_int32_t *));
[1631] Fix | Delete
int (*get_bt_prefix)
[1632] Fix | Delete
__P((DB *, size_t (**)(DB *, const DBT *, const DBT *)));
[1633] Fix | Delete
int (*get_byteswapped) __P((DB *, int *));
[1634] Fix | Delete
int (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *));
[1635] Fix | Delete
int (*get_create_dir) __P((DB *, const char **));
[1636] Fix | Delete
int (*get_dbname) __P((DB *, const char **, const char **));
[1637] Fix | Delete
int (*get_dup_compare)
[1638] Fix | Delete
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
[1639] Fix | Delete
int (*get_encrypt_flags) __P((DB *, u_int32_t *));
[1640] Fix | Delete
DB_ENV *(*get_env) __P((DB *));
[1641] Fix | Delete
void (*get_errcall) __P((DB *,
[1642] Fix | Delete
void (**)(const DB_ENV *, const char *, const char *)));
[1643] Fix | Delete
void (*get_errfile) __P((DB *, FILE **));
[1644] Fix | Delete
void (*get_errpfx) __P((DB *, const char **));
[1645] Fix | Delete
int (*get_feedback) __P((DB *, void (**)(DB *, int, int)));
[1646] Fix | Delete
int (*get_flags) __P((DB *, u_int32_t *));
[1647] Fix | Delete
int (*get_h_compare)
[1648] Fix | Delete
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
[1649] Fix | Delete
int (*get_h_ffactor) __P((DB *, u_int32_t *));
[1650] Fix | Delete
int (*get_h_hash)
[1651] Fix | Delete
__P((DB *, u_int32_t (**)(DB *, const void *, u_int32_t)));
[1652] Fix | Delete
int (*get_h_nelem) __P((DB *, u_int32_t *));
[1653] Fix | Delete
int (*get_heapsize) __P((DB *, u_int32_t *, u_int32_t *));
[1654] Fix | Delete
int (*get_heap_regionsize) __P((DB *, u_int32_t *));
[1655] Fix | Delete
int (*get_lk_exclusive) __P((DB *, int *, int *));
[1656] Fix | Delete
int (*get_lorder) __P((DB *, int *));
[1657] Fix | Delete
DB_MPOOLFILE *(*get_mpf) __P((DB *));
[1658] Fix | Delete
void (*get_msgcall) __P((DB *,
[1659] Fix | Delete
void (**)(const DB_ENV *, const char *)));
[1660] Fix | Delete
void (*get_msgfile) __P((DB *, FILE **));
[1661] Fix | Delete
int (*get_multiple) __P((DB *));
[1662] Fix | Delete
int (*get_open_flags) __P((DB *, u_int32_t *));
[1663] Fix | Delete
int (*get_pagesize) __P((DB *, u_int32_t *));
[1664] Fix | Delete
int (*get_partition_callback) __P((DB *,
[1665] Fix | Delete
u_int32_t *, u_int32_t (**)(DB *, DBT *key)));
[1666] Fix | Delete
int (*get_partition_dirs) __P((DB *, const char ***));
[1667] Fix | Delete
int (*get_partition_keys) __P((DB *, u_int32_t *, DBT **));
[1668] Fix | Delete
int (*get_priority) __P((DB *, DB_CACHE_PRIORITY *));
[1669] Fix | Delete
int (*get_q_extentsize) __P((DB *, u_int32_t *));
[1670] Fix | Delete
int (*get_re_delim) __P((DB *, int *));
[1671] Fix | Delete
int (*get_re_len) __P((DB *, u_int32_t *));
[1672] Fix | Delete
int (*get_re_pad) __P((DB *, int *));
[1673] Fix | Delete
int (*get_re_source) __P((DB *, const char **));
[1674] Fix | Delete
int (*get_transactional) __P((DB *));
[1675] Fix | Delete
int (*get_type) __P((DB *, DBTYPE *));
[1676] Fix | Delete
int (*join) __P((DB *, DBC **, DBC **, u_int32_t));
[1677] Fix | Delete
int (*key_range)
[1678] Fix | Delete
__P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
[1679] Fix | Delete
int (*open) __P((DB *,
[1680] Fix | Delete
DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
[1681] Fix | Delete
int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
[1682] Fix | Delete
int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
[1683] Fix | Delete
int (*remove) __P((DB *, const char *, const char *, u_int32_t));
[1684] Fix | Delete
int (*rename) __P((DB *,
[1685] Fix | Delete
const char *, const char *, const char *, u_int32_t));
[1686] Fix | Delete
int (*set_alloc) __P((DB *, void *(*)(size_t),
[1687] Fix | Delete
void *(*)(void *, size_t), void (*)(void *)));
[1688] Fix | Delete
int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
[1689] Fix | Delete
int (*set_bt_compare)
[1690] Fix | Delete
__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
[1691] Fix | Delete
int (*set_bt_compress) __P((DB *,
[1692] Fix | Delete
int (*)(DB *, const DBT *, const DBT *, const DBT *, const DBT *, DBT *),
[1693] Fix | Delete
int (*)(DB *, const DBT *, const DBT *, DBT *, DBT *, DBT *)));
[1694] Fix | Delete
int (*set_bt_minkey) __P((DB *, u_int32_t));
[1695] Fix | Delete
int (*set_bt_prefix)
[1696] Fix | Delete
__P((DB *, size_t (*)(DB *, const DBT *, const DBT *)));
[1697] Fix | Delete
int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
[1698] Fix | Delete
int (*set_create_dir) __P((DB *, const char *));
[1699] Fix | Delete
int (*set_dup_compare)
[1700] Fix | Delete
__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
[1701] Fix | Delete
int (*set_encrypt) __P((DB *, const char *, u_int32_t));
[1702] Fix | Delete
void (*set_errcall) __P((DB *,
[1703] Fix | Delete
void (*)(const DB_ENV *, const char *, const char *)));
[1704] Fix | Delete
void (*set_errfile) __P((DB *, FILE *));
[1705] Fix | Delete
void (*set_errpfx) __P((DB *, const char *));
[1706] Fix | Delete
int (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
[1707] Fix | Delete
int (*set_flags) __P((DB *, u_int32_t));
[1708] Fix | Delete
int (*set_h_compare)
[1709] Fix | Delete
__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
[1710] Fix | Delete
int (*set_h_ffactor) __P((DB *, u_int32_t));
[1711] Fix | Delete
int (*set_h_hash)
[1712] Fix | Delete
__P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t)));
[1713] Fix | Delete
int (*set_h_nelem) __P((DB *, u_int32_t));
[1714] Fix | Delete
int (*set_heapsize) __P((DB *, u_int32_t, u_int32_t, u_int32_t));
[1715] Fix | Delete
int (*set_heap_regionsize) __P((DB *, u_int32_t));
[1716] Fix | Delete
int (*set_lk_exclusive) __P((DB *, int));
[1717] Fix | Delete
int (*set_lorder) __P((DB *, int));
[1718] Fix | Delete
void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char *)));
[1719] Fix | Delete
void (*set_msgfile) __P((DB *, FILE *));
[1720] Fix | Delete
int (*set_pagesize) __P((DB *, u_int32_t));
[1721] Fix | Delete
int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
[1722] Fix | Delete
int (*set_partition) __P((DB *,
[1723] Fix | Delete
u_int32_t, DBT *, u_int32_t (*)(DB *, DBT *key)));
[1724] Fix | Delete
int (*set_partition_dirs) __P((DB *, const char **));
[1725] Fix | Delete
int (*set_priority) __P((DB *, DB_CACHE_PRIORITY));
[1726] Fix | Delete
int (*set_q_extentsize) __P((DB *, u_int32_t));
[1727] Fix | Delete
int (*set_re_delim) __P((DB *, int));
[1728] Fix | Delete
int (*set_re_len) __P((DB *, u_int32_t));
[1729] Fix | Delete
int (*set_re_pad) __P((DB *, int));
[1730] Fix | Delete
int (*set_re_source) __P((DB *, const char *));
[1731] Fix | Delete
int (*sort_multiple) __P((DB *, DBT *, DBT *, u_int32_t));
[1732] Fix | Delete
int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
[1733] Fix | Delete
int (*stat_print) __P((DB *, u_int32_t));
[1734] Fix | Delete
int (*sync) __P((DB *, u_int32_t));
[1735] Fix | Delete
int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
[1736] Fix | Delete
int (*upgrade) __P((DB *, const char *, u_int32_t));
[1737] Fix | Delete
int (*verify)
[1738] Fix | Delete
__P((DB *, const char *, const char *, FILE *, u_int32_t));
[1739] Fix | Delete
/* DB PUBLIC HANDLE LIST END */
[1740] Fix | Delete
[1741] Fix | Delete
/* DB PRIVATE HANDLE LIST BEGIN */
[1742] Fix | Delete
int (*dump) __P((DB *, const char *,
[1743] Fix | Delete
int (*)(void *, const void *), void *, int, int));
[1744] Fix | Delete
int (*db_am_remove) __P((DB *, DB_THREAD_INFO *,
[1745] Fix | Delete
DB_TXN *, const char *, const char *, u_int32_t));
[1746] Fix | Delete
int (*db_am_rename) __P((DB *, DB_THREAD_INFO *,
[1747] Fix | Delete
DB_TXN *, const char *, const char *, const char *));
[1748] Fix | Delete
/* DB PRIVATE HANDLE LIST END */
[1749] Fix | Delete
[1750] Fix | Delete
/*
[1751] Fix | Delete
* Never called; these are a place to save function pointers
[1752] Fix | Delete
* so that we can undo an associate.
[1753] Fix | Delete
*/
[1754] Fix | Delete
int (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
[1755] Fix | Delete
int (*stored_close) __P((DB *, u_int32_t));
[1756] Fix | Delete
[1757] Fix | Delete
/* Alternative handle close function, used by C++ API. */
[1758] Fix | Delete
int (*alt_close) __P((DB *, u_int32_t));
[1759] Fix | Delete
[1760] Fix | Delete
#define DB_OK_BTREE 0x01
[1761] Fix | Delete
#define DB_OK_HASH 0x02
[1762] Fix | Delete
#define DB_OK_HEAP 0x04
[1763] Fix | Delete
#define DB_OK_QUEUE 0x08
[1764] Fix | Delete
#define DB_OK_RECNO 0x10
[1765] Fix | Delete
u_int32_t am_ok; /* Legal AM choices. */
[1766] Fix | Delete
[1767] Fix | Delete
/*
[1768] Fix | Delete
* This field really ought to be an AM_FLAG, but we have
[1769] Fix | Delete
* have run out of bits. If/when we decide to split up
[1770] Fix | Delete
* the flags, we can incorporate it.
[1771] Fix | Delete
*/
[1772] Fix | Delete
int preserve_fid; /* Do not free fileid on close. */
[1773] Fix | Delete
[1774] Fix | Delete
#define DB_AM_CHKSUM 0x00000001 /* Checksumming */
[1775] Fix | Delete
#define DB_AM_COMPENSATE 0x00000002 /* Created by compensating txn */
[1776] Fix | Delete
#define DB_AM_COMPRESS 0x00000004 /* Compressed BTree */
[1777] Fix | Delete
#define DB_AM_CREATED 0x00000008 /* Database was created upon open */
[1778] Fix | Delete
#define DB_AM_CREATED_MSTR 0x00000010 /* Encompassing file was created */
[1779] Fix | Delete
#define DB_AM_DBM_ERROR 0x00000020 /* Error in DBM/NDBM database */
[1780] Fix | Delete
#define DB_AM_DELIMITER 0x00000040 /* Variable length delimiter set */
[1781] Fix | Delete
#define DB_AM_DISCARD 0x00000080 /* Discard any cached pages */
[1782] Fix | Delete
#define DB_AM_DUP 0x00000100 /* DB_DUP */
[1783] Fix | Delete
#define DB_AM_DUPSORT 0x00000200 /* DB_DUPSORT */
[1784] Fix | Delete
#define DB_AM_ENCRYPT 0x00000400 /* Encryption */
[1785] Fix | Delete
#define DB_AM_FIXEDLEN 0x00000800 /* Fixed-length records */
[1786] Fix | Delete
#define DB_AM_INMEM 0x00001000 /* In-memory; no sync on close */
[1787] Fix | Delete
#define DB_AM_INORDER 0x00002000 /* DB_INORDER */
[1788] Fix | Delete
#define DB_AM_IN_RENAME 0x00004000 /* File is being renamed */
[1789] Fix | Delete
#define DB_AM_NOT_DURABLE 0x00008000 /* Do not log changes */
[1790] Fix | Delete
#define DB_AM_OPEN_CALLED 0x00010000 /* DB->open called */
[1791] Fix | Delete
#define DB_AM_PAD 0x00020000 /* Fixed-length record pad */
[1792] Fix | Delete
#define DB_AM_PARTDB 0x00040000 /* Handle for a database partition */
[1793] Fix | Delete
#define DB_AM_PGDEF 0x00080000 /* Page size was defaulted */
[1794] Fix | Delete
#define DB_AM_RDONLY 0x00100000 /* Database is readonly */
[1795] Fix | Delete
#define DB_AM_READ_UNCOMMITTED 0x00200000 /* Support degree 1 isolation */
[1796] Fix | Delete
#define DB_AM_RECNUM 0x00400000 /* DB_RECNUM */
[1797] Fix | Delete
#define DB_AM_RECOVER 0x00800000 /* DB opened by recovery routine */
[1798] Fix | Delete
#define DB_AM_RENUMBER 0x01000000 /* DB_RENUMBER */
[1799] Fix | Delete
#define DB_AM_REVSPLITOFF 0x02000000 /* DB_REVSPLITOFF */
[1800] Fix | Delete
#define DB_AM_SECONDARY 0x04000000 /* Database is a secondary index */
[1801] Fix | Delete
#define DB_AM_SNAPSHOT 0x08000000 /* DB_SNAPSHOT */
[1802] Fix | Delete
#define DB_AM_SUBDB 0x10000000 /* Subdatabases supported */
[1803] Fix | Delete
#define DB_AM_SWAP 0x20000000 /* Pages need to be byte-swapped */
[1804] Fix | Delete
#define DB_AM_TXN 0x40000000 /* Opened in a transaction */
[1805] Fix | Delete
#define DB_AM_VERIFYING 0x80000000 /* DB handle is in the verifier */
[1806] Fix | Delete
u_int32_t orig_flags; /* Flags at open, for refresh */
[1807] Fix | Delete
u_int32_t flags;
[1808] Fix | Delete
[1809] Fix | Delete
#define DB2_AM_EXCL 0x00000001 /* Exclusively lock the handle */
[1810] Fix | Delete
#define DB2_AM_INTEXCL 0x00000002 /* Internal exclusive lock. */
[1811] Fix | Delete
#define DB2_AM_NOWAIT 0x00000004 /* Do not wait for handle lock */
[1812] Fix | Delete
u_int32_t orig_flags2; /* Second flags word; for refresh */
[1813] Fix | Delete
u_int32_t flags2; /* Second flags word */
[1814] Fix | Delete
};
[1815] Fix | Delete
[1816] Fix | Delete
/*
[1817] Fix | Delete
* Macros for bulk operations. These are only intended for the C API.
[1818] Fix | Delete
* For C++, use DbMultiple*Iterator or DbMultiple*Builder.
[1819] Fix | Delete
*
[1820] Fix | Delete
* Bulk operations store multiple entries into a single DBT structure. The
[1821] Fix | Delete
* following macros assist with creating and reading these Multiple DBTs.
[1822] Fix | Delete
*
[1823] Fix | Delete
* The basic layout for single data items is:
[1824] Fix | Delete
*
[1825] Fix | Delete
* -------------------------------------------------------------------------
[1826] Fix | Delete
* | data1 | ... | dataN | ..... |-1 | dNLen | dNOff | ... | d1Len | d1Off |
[1827] Fix | Delete
* -------------------------------------------------------------------------
[1828] Fix | Delete
*
[1829] Fix | Delete
* For the DB_MULTIPLE_KEY* macros, the items are in key/data pairs, so data1
[1830] Fix | Delete
* would be a key, and data2 its corresponding value (N is always even).
[1831] Fix | Delete
*
[1832] Fix | Delete
* For the DB_MULTIPLE_RECNO* macros, the record number is stored along with
[1833] Fix | Delete
* the len/off pair in the "header" section, and the list is zero terminated
[1834] Fix | Delete
* (since -1 is a valid record number):
[1835] Fix | Delete
*
[1836] Fix | Delete
* --------------------------------------------------------------------------
[1837] Fix | Delete
* | d1 |..| dN |..| 0 | dNLen | dNOff | recnoN |..| d1Len | d1Off | recno1 |
[1838] Fix | Delete
* --------------------------------------------------------------------------
[1839] Fix | Delete
*/
[1840] Fix | Delete
#define DB_MULTIPLE_INIT(pointer, dbt) \
[1841] Fix | Delete
(pointer = (u_int8_t *)(dbt)->data + \
[1842] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t))
[1843] Fix | Delete
[1844] Fix | Delete
#define DB_MULTIPLE_NEXT(pointer, dbt, retdata, retdlen) \
[1845] Fix | Delete
do { \
[1846] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1847] Fix | Delete
if (*__p == (u_int32_t)-1) { \
[1848] Fix | Delete
retdata = NULL; \
[1849] Fix | Delete
pointer = NULL; \
[1850] Fix | Delete
break; \
[1851] Fix | Delete
} \
[1852] Fix | Delete
retdata = (u_int8_t *)(dbt)->data + *__p--; \
[1853] Fix | Delete
retdlen = *__p--; \
[1854] Fix | Delete
pointer = __p; \
[1855] Fix | Delete
if (retdlen == 0 && retdata == (u_int8_t *)(dbt)->data) \
[1856] Fix | Delete
retdata = NULL; \
[1857] Fix | Delete
} while (0)
[1858] Fix | Delete
[1859] Fix | Delete
#define DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey, retklen, retdata, retdlen) \
[1860] Fix | Delete
do { \
[1861] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1862] Fix | Delete
if (*__p == (u_int32_t)-1) { \
[1863] Fix | Delete
retdata = NULL; \
[1864] Fix | Delete
retkey = NULL; \
[1865] Fix | Delete
pointer = NULL; \
[1866] Fix | Delete
break; \
[1867] Fix | Delete
} \
[1868] Fix | Delete
retkey = (u_int8_t *)(dbt)->data + *__p--; \
[1869] Fix | Delete
retklen = *__p--; \
[1870] Fix | Delete
retdata = (u_int8_t *)(dbt)->data + *__p--; \
[1871] Fix | Delete
retdlen = *__p--; \
[1872] Fix | Delete
pointer = __p; \
[1873] Fix | Delete
} while (0)
[1874] Fix | Delete
[1875] Fix | Delete
#define DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno, retdata, retdlen) \
[1876] Fix | Delete
do { \
[1877] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1878] Fix | Delete
if (*__p == (u_int32_t)0) { \
[1879] Fix | Delete
recno = 0; \
[1880] Fix | Delete
retdata = NULL; \
[1881] Fix | Delete
pointer = NULL; \
[1882] Fix | Delete
break; \
[1883] Fix | Delete
} \
[1884] Fix | Delete
recno = *__p--; \
[1885] Fix | Delete
retdata = (u_int8_t *)(dbt)->data + *__p--; \
[1886] Fix | Delete
retdlen = *__p--; \
[1887] Fix | Delete
pointer = __p; \
[1888] Fix | Delete
} while (0)
[1889] Fix | Delete
[1890] Fix | Delete
#define DB_MULTIPLE_WRITE_INIT(pointer, dbt) \
[1891] Fix | Delete
do { \
[1892] Fix | Delete
(dbt)->flags |= DB_DBT_BULK; \
[1893] Fix | Delete
pointer = (u_int8_t *)(dbt)->data + \
[1894] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t); \
[1895] Fix | Delete
*(u_int32_t *)(pointer) = (u_int32_t)-1; \
[1896] Fix | Delete
} while (0)
[1897] Fix | Delete
[1898] Fix | Delete
#define DB_MULTIPLE_RESERVE_NEXT(pointer, dbt, writedata, writedlen) \
[1899] Fix | Delete
do { \
[1900] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1901] Fix | Delete
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
[1902] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2];\
[1903] Fix | Delete
if ((u_int8_t *)(dbt)->data + __off + (writedlen) > \
[1904] Fix | Delete
(u_int8_t *)(__p - 2)) \
[1905] Fix | Delete
writedata = NULL; \
[1906] Fix | Delete
else { \
[1907] Fix | Delete
writedata = (u_int8_t *)(dbt)->data + __off; \
[1908] Fix | Delete
__p[0] = __off; \
[1909] Fix | Delete
__p[-1] = (u_int32_t)(writedlen); \
[1910] Fix | Delete
__p[-2] = (u_int32_t)-1; \
[1911] Fix | Delete
pointer = __p - 2; \
[1912] Fix | Delete
} \
[1913] Fix | Delete
} while (0)
[1914] Fix | Delete
[1915] Fix | Delete
#define DB_MULTIPLE_WRITE_NEXT(pointer, dbt, writedata, writedlen) \
[1916] Fix | Delete
do { \
[1917] Fix | Delete
void *__destd; \
[1918] Fix | Delete
DB_MULTIPLE_RESERVE_NEXT((pointer), (dbt), \
[1919] Fix | Delete
__destd, (writedlen)); \
[1920] Fix | Delete
if (__destd == NULL) \
[1921] Fix | Delete
pointer = NULL; \
[1922] Fix | Delete
else \
[1923] Fix | Delete
memcpy(__destd, (writedata), (writedlen)); \
[1924] Fix | Delete
} while (0)
[1925] Fix | Delete
[1926] Fix | Delete
#define DB_MULTIPLE_KEY_RESERVE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
[1927] Fix | Delete
do { \
[1928] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1929] Fix | Delete
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
[1930] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2];\
[1931] Fix | Delete
if ((u_int8_t *)(dbt)->data + __off + (writeklen) + \
[1932] Fix | Delete
(writedlen) > (u_int8_t *)(__p - 4)) { \
[1933] Fix | Delete
writekey = NULL; \
[1934] Fix | Delete
writedata = NULL; \
[1935] Fix | Delete
} else { \
[1936] Fix | Delete
writekey = (u_int8_t *)(dbt)->data + __off; \
[1937] Fix | Delete
__p[0] = __off; \
[1938] Fix | Delete
__p[-1] = (u_int32_t)(writeklen); \
[1939] Fix | Delete
__p -= 2; \
[1940] Fix | Delete
__off += (u_int32_t)(writeklen); \
[1941] Fix | Delete
writedata = (u_int8_t *)(dbt)->data + __off; \
[1942] Fix | Delete
__p[0] = __off; \
[1943] Fix | Delete
__p[-1] = (u_int32_t)(writedlen); \
[1944] Fix | Delete
__p[-2] = (u_int32_t)-1; \
[1945] Fix | Delete
pointer = __p - 2; \
[1946] Fix | Delete
} \
[1947] Fix | Delete
} while (0)
[1948] Fix | Delete
[1949] Fix | Delete
#define DB_MULTIPLE_KEY_WRITE_NEXT(pointer, dbt, writekey, writeklen, writedata, writedlen) \
[1950] Fix | Delete
do { \
[1951] Fix | Delete
void *__destk, *__destd; \
[1952] Fix | Delete
DB_MULTIPLE_KEY_RESERVE_NEXT((pointer), (dbt), \
[1953] Fix | Delete
__destk, (writeklen), __destd, (writedlen)); \
[1954] Fix | Delete
if (__destk == NULL) \
[1955] Fix | Delete
pointer = NULL; \
[1956] Fix | Delete
else { \
[1957] Fix | Delete
memcpy(__destk, (writekey), (writeklen)); \
[1958] Fix | Delete
if (__destd != NULL) \
[1959] Fix | Delete
memcpy(__destd, (writedata), (writedlen));\
[1960] Fix | Delete
} \
[1961] Fix | Delete
} while (0)
[1962] Fix | Delete
[1963] Fix | Delete
#define DB_MULTIPLE_RECNO_WRITE_INIT(pointer, dbt) \
[1964] Fix | Delete
do { \
[1965] Fix | Delete
(dbt)->flags |= DB_DBT_BULK; \
[1966] Fix | Delete
pointer = (u_int8_t *)(dbt)->data + \
[1967] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t); \
[1968] Fix | Delete
*(u_int32_t *)(pointer) = 0; \
[1969] Fix | Delete
} while (0)
[1970] Fix | Delete
[1971] Fix | Delete
#define DB_MULTIPLE_RECNO_RESERVE_NEXT(pointer, dbt, recno, writedata, writedlen) \
[1972] Fix | Delete
do { \
[1973] Fix | Delete
u_int32_t *__p = (u_int32_t *)(pointer); \
[1974] Fix | Delete
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
[1975] Fix | Delete
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2]; \
[1976] Fix | Delete
if (((u_int8_t *)(dbt)->data + __off) + (writedlen) > \
[1977] Fix | Delete
(u_int8_t *)(__p - 3)) \
[1978] Fix | Delete
writedata = NULL; \
[1979] Fix | Delete
else { \
[1980] Fix | Delete
writedata = (u_int8_t *)(dbt)->data + __off; \
[1981] Fix | Delete
__p[0] = (u_int32_t)(recno); \
[1982] Fix | Delete
__p[-1] = __off; \
[1983] Fix | Delete
__p[-2] = (u_int32_t)(writedlen); \
[1984] Fix | Delete
__p[-3] = 0; \
[1985] Fix | Delete
pointer = __p - 3; \
[1986] Fix | Delete
} \
[1987] Fix | Delete
} while (0)
[1988] Fix | Delete
[1989] Fix | Delete
#define DB_MULTIPLE_RECNO_WRITE_NEXT(pointer, dbt, recno, writedata, writedlen)\
[1990] Fix | Delete
do { \
[1991] Fix | Delete
void *__destd; \
[1992] Fix | Delete
DB_MULTIPLE_RECNO_RESERVE_NEXT((pointer), (dbt), \
[1993] Fix | Delete
(recno), __destd, (writedlen)); \
[1994] Fix | Delete
if (__destd == NULL) \
[1995] Fix | Delete
pointer = NULL; \
[1996] Fix | Delete
else if ((writedlen) != 0) \
[1997] Fix | Delete
memcpy(__destd, (writedata), (writedlen)); \
[1998] Fix | Delete
} while (0)
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function