📄 db.in
字号:
* !!! * Explicit representations of structures from queue.h. * TAILQ_ENTRY(__dbc) links; */ struct { DBC *tqe_next; DBC **tqe_prev; } links; /* * The DBT *'s below are used by the cursor routines to return * data to the user when DBT flags indicate that DB should manage * the returned memory. They point at a DBT containing the buffer * and length that will be used, and "belonging" to the handle that * should "own" this memory. This may be a "my_*" field of this * cursor--the default--or it may be the corresponding field of * another cursor, a DB handle, a join cursor, etc. In general, it * will be whatever handle the user originally used for the current * DB interface call. */ DBT *rskey; /* Returned secondary key. */ DBT *rkey; /* Returned [primary] key. */ DBT *rdata; /* Returned data. */ DBT my_rskey; /* Space for returned secondary key. */ DBT my_rkey; /* Space for returned [primary] key. */ DBT my_rdata; /* Space for returned data. */ u_int32_t lid; /* Default process' locker id. */ u_int32_t locker; /* Locker for this operation. */ DBT lock_dbt; /* DBT referencing lock. */ DB_LOCK_ILOCK lock; /* Object to be locked. */ DB_LOCK mylock; /* Lock held on this cursor. */ long cl_id; /* Remote client id. */ DBTYPE dbtype; /* Cursor type. */ DBC_INTERNAL *internal; /* Access method private. */ int (*c_close) __P((DBC *)); /* Methods: public. */ int (*c_count) __P((DBC *, db_recno_t *, u_int32_t)); int (*c_del) __P((DBC *, u_int32_t)); int (*c_dup) __P((DBC *, DBC **, u_int32_t)); int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); /* Methods: private. */ int (*c_am_bulk) __P((DBC *, DBT *, u_int32_t)); int (*c_am_close) __P((DBC *, db_pgno_t, int *)); int (*c_am_del) __P((DBC *)); int (*c_am_destroy) __P((DBC *)); int (*c_am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*c_am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*c_am_writelock) __P((DBC *)); /* Private: for secondary indices. */ int (*c_real_get) __P((DBC *, DBT *, DBT *, u_int32_t));#define DBC_ACTIVE 0x0001 /* Cursor in use. */#define DBC_COMPENSATE 0x0002 /* Cursor compensating, don't lock. */#define DBC_DIRTY_READ 0x0004 /* Cursor supports dirty reads. */#define DBC_OPD 0x0008 /* Cursor references off-page dups. */#define DBC_RECOVER 0x0010 /* Recovery cursor; don't log/lock. */#define DBC_RMW 0x0020 /* Acquire write flag in read op. */#define DBC_TRANSIENT 0x0040 /* Cursor is transient. */#define DBC_WRITECURSOR 0x0080 /* Cursor may be used to write (CDB). */#define DBC_WRITEDUP 0x0100 /* idup'ed DBC_WRITECURSOR (CDB). */#define DBC_WRITER 0x0200 /* Cursor immediately writing (CDB). */#define DBC_MULTIPLE 0x0400 /* Return Multiple data. */#define DBC_MULTIPLE_KEY 0x0800 /* Return Multiple keys and data. */#define DBC_OWN_LID 0x1000 /* Free lock id on destroy. */ u_int32_t flags;};/* Key range statistics structure */struct __key_range { double less; double equal; double greater;};/* Btree/Recno statistics structure. */struct __db_bt_stat { u_int32_t bt_magic; /* Magic number. */ u_int32_t bt_version; /* Version number. */ u_int32_t bt_metaflags; /* Metadata flags. */ u_int32_t bt_nkeys; /* Number of unique keys. */ u_int32_t bt_ndata; /* Number of data items. */ u_int32_t bt_pagesize; /* Page size. */ u_int32_t bt_maxkey; /* Maxkey value. */ u_int32_t bt_minkey; /* Minkey value. */ u_int32_t bt_re_len; /* Fixed-length record length. */ u_int32_t bt_re_pad; /* Fixed-length record pad. */ u_int32_t bt_levels; /* Tree levels. */ u_int32_t bt_int_pg; /* Internal pages. */ u_int32_t bt_leaf_pg; /* Leaf pages. */ u_int32_t bt_dup_pg; /* Duplicate pages. */ u_int32_t bt_over_pg; /* Overflow pages. */ u_int32_t bt_free; /* Pages on the free list. */ u_int32_t bt_int_pgfree; /* Bytes free in internal pages. */ u_int32_t bt_leaf_pgfree; /* Bytes free in leaf pages. */ u_int32_t bt_dup_pgfree; /* Bytes free in duplicate pages. */ u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */};/* Hash statistics structure. */struct __db_h_stat { u_int32_t hash_magic; /* Magic number. */ u_int32_t hash_version; /* Version number. */ u_int32_t hash_metaflags; /* Metadata flags. */ u_int32_t hash_nkeys; /* Number of unique keys. */ u_int32_t hash_ndata; /* Number of data items. */ u_int32_t hash_pagesize; /* Page size. */ u_int32_t hash_ffactor; /* Fill factor specified at create. */ u_int32_t hash_buckets; /* Number of hash buckets. */ u_int32_t hash_free; /* Pages on the free list. */ u_int32_t hash_bfree; /* Bytes free on bucket pages. */ u_int32_t hash_bigpages; /* Number of big key/data pages. */ u_int32_t hash_big_bfree; /* Bytes free on big item pages. */ u_int32_t hash_overflows; /* Number of overflow pages. */ u_int32_t hash_ovfl_free; /* Bytes free on ovfl pages. */ u_int32_t hash_dup; /* Number of dup pages. */ u_int32_t hash_dup_free; /* Bytes free on duplicate pages. */};/* Queue statistics structure. */struct __db_qam_stat { u_int32_t qs_magic; /* Magic number. */ u_int32_t qs_version; /* Version number. */ u_int32_t qs_metaflags; /* Metadata flags. */ u_int32_t qs_nkeys; /* Number of unique keys. */ u_int32_t qs_ndata; /* Number of data items. */ u_int32_t qs_pagesize; /* Page size. */ u_int32_t qs_extentsize; /* Pages per extent. */ u_int32_t qs_pages; /* Data pages. */ u_int32_t qs_re_len; /* Fixed-length record length. */ u_int32_t qs_re_pad; /* Fixed-length record pad. */ u_int32_t qs_pgfree; /* Bytes free in data pages. */ u_int32_t qs_first_recno; /* First not deleted record. */ u_int32_t qs_cur_recno; /* Next available record number. */};/******************************************************* * Environment. *******************************************************/#define DB_REGION_MAGIC 0x120897 /* Environment magic number. */typedef enum { DB_NOTICE_LOGFILE_CHANGED} db_notices;/* Database Environment handle. */struct __db_env { /******************************************************* * Public: owned by the application. *******************************************************/ FILE *db_errfile; /* Error message file stream. */ const char *db_errpfx; /* Error message prefix. */ /* Callbacks. */ void (*db_errcall) __P((const char *, char *)); void (*db_feedback) __P((DB_ENV *, int, int)); void (*db_paniccall) __P((DB_ENV *, int)); void (*db_noticecall) __P((DB_ENV *, db_notices)); /* App-specified alloc functions. */ void *(*db_malloc) __P((size_t)); void *(*db_realloc) __P((void *, size_t)); void (*db_free) __P((void *)); /* * Currently, the verbose list is a bit field with room for 32 * entries. There's no reason that it needs to be limited, if * there are ever more than 32 entries, convert to a bit array. */#define DB_VERB_CHKPOINT 0x0001 /* List checkpoints. */#define DB_VERB_DEADLOCK 0x0002 /* Deadlock detection information. */#define DB_VERB_RECOVERY 0x0004 /* Recovery information. */#define DB_VERB_REPLICATION 0x0008 /* Replication information. */#define DB_VERB_WAITSFOR 0x0010 /* Dump waits-for table. */ u_int32_t verbose; /* Verbose output. */ void *app_private; /* Application-private handle. */ int (*app_dispatch) /* User-specified recovery dispatch. */ __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); /* Locking. */ u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ u_int32_t lk_modes; /* Number of lock modes in table. */ u_int32_t lk_max; /* Maximum number of locks. */ u_int32_t lk_max_lockers;/* Maximum number of lockers. */ u_int32_t lk_max_objects;/* Maximum number of locked objects. */ u_int32_t lk_detect; /* Deadlock detect on all conflicts. */ db_timeout_t lk_timeout; /* Lock timeout period. */ /* Logging. */ u_int32_t lg_bsize; /* Buffer size. */ u_int32_t lg_size; /* Log file size. */ u_int32_t lg_regionmax; /* Region size. */ /* Memory pool. */ u_int32_t mp_gbytes; /* Cachesize: GB. */ u_int32_t mp_bytes; /* Cachesize: Bytes. */ size_t mp_size; /* DEPRECATED: Cachesize: bytes. */ int mp_ncache; /* Number of cache regions. */ size_t mp_mmapsize; /* Maximum file size for mmap. */ int rep_eid; /* environment id. */ /* Transactions. */ u_int32_t tx_max; /* Maximum number of transactions. */ time_t tx_timestamp; /* Recover to specific timestamp. */ db_timeout_t tx_timeout; /* Timeout for transactions. */ /******************************************************* * Private: owned by DB. *******************************************************/ int panic_errval; /* Panic causing errno. */ /* User files, paths. */ char *db_home; /* Database home. */ char *db_log_dir; /* Database log file directory. */ char *db_tmp_dir; /* Database tmp file directory. */ char **db_data_dir; /* Database data file directories. */ int data_cnt; /* Database data file slots. */ int data_next; /* Next Database data file slot. */ int db_mode; /* Default open permissions. */ void *reginfo; /* REGINFO structure reference. */ DB_FH *lockfhp; /* fcntl(2) locking file handle. */ int (**recover_dtab) /* Dispatch table for recover funcs. */ __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); size_t recover_dtab_size; /* Slots in the dispatch table. */ void *cl_handle; /* RPC: remote client handle. */ long cl_id; /* RPC: remote client env id. */ int db_ref; /* DB reference count. */ long shm_key; /* shmget(2) key. */ u_int32_t tas_spins; /* test-and-set spins. */ /* * List of open DB handles for this DB_ENV, used for cursor * adjustment. Must be protected for multi-threaded support. * * !!! * As this structure is allocated in per-process memory, the * mutex may need to be stored elsewhere on architectures unable * to support mutexes in heap memory, e.g. HP/UX 9. * * !!! * Explicit representation of structure in queue.h. * LIST_HEAD(dblist, __db); */ DB_MUTEX *dblist_mutexp; /* Mutex. */ struct { struct __db *lh_first; } dblist; /* * XA support. * * !!! * Explicit representations of structures from queue.h. * TAILQ_ENTRY(__db_env) links; */ struct { struct __db_env *tqe_next; struct __db_env **tqe_prev; } links; int xa_rmid; /* XA Resource Manager ID. */ DB_TXN *xa_txn; /* XA Current transaction. */ /* API-private structure. */ void *api1_internal; /* C++, Perl API private */ void *api2_internal; /* Java API private */ char *passwd; /* Cryptography support. */ size_t passwd_len; void *crypto_handle; /* Primary handle. */ DB_MUTEX *mt_mutexp; /* Mersenne Twister mutex. */ int mti; /* Mersenne Twister index. */ u_long *mt; /* Mersenne Twister state vector. */ /* DB_ENV Methods. */ int (*close) __P((DB_ENV *, u_int32_t)); int (*dbremove) __P((DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)); int (*dbrename) __P((DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)); void (*err) __P((const DB_ENV *, int, const char *, ...)); void (*errx) __P((const DB_ENV *, const char *, ...)); int (*open) __P((DB_ENV *, const char *, u_int32_t, int)); int (*remove) __P((DB_ENV *, const char *, u_int32_t)); int (*set_data_dir) __P((DB_ENV *, const char *)); int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), void *(*)(void *, size_t), void (*)(void *))); int (*set_app_dispatch) __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops))); int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t)); void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *))); void (*set_errfile) __P((DB_ENV *, FILE *)); void (*set_errpfx) __P((DB_ENV *, const char *)); int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*set_flags) __P((DB_ENV *, u_int32_t, int)); void (*set_noticecall) __P((DB_ENV *, void (*)(DB_ENV *, db_notices))); int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); int (*set_rpc_server) __P((DB_ENV *, void *, const char *, long, long, u_int32_t)); int (*set_shm_key) __P((DB_ENV *, long)); int (*set_tas_spins) __P((DB_ENV *, u_int32_t)); int (*set_tmp_dir) __P((DB_ENV *, const char *)); int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); void *lg_handle; /* Log handle and methods. */ int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); int (*set_lg_dir) __P((DB_ENV *, const char *)); int (*set_lg_max) __P((DB_ENV *, u_int32_t)); int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t)); int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t)); int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t)); int (*log_flush) __P((DB_ENV *, const DB_LSN *)); int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); void *lk_handle; /* Lock handle and methods. */ int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); int (*set_lk_detect) __P((DB_ENV *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -