Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: db.h
/*
[0] Fix | Delete
* See the file LICENSE for redistribution information.
[1] Fix | Delete
*
[2] Fix | Delete
* Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.
[3] Fix | Delete
*
[4] Fix | Delete
* $Id$
[5] Fix | Delete
*
[6] Fix | Delete
* db.h include file layout:
[7] Fix | Delete
* General.
[8] Fix | Delete
* Database Environment.
[9] Fix | Delete
* Locking subsystem.
[10] Fix | Delete
* Logging subsystem.
[11] Fix | Delete
* Shared buffer cache (mpool) subsystem.
[12] Fix | Delete
* Transaction subsystem.
[13] Fix | Delete
* Access methods.
[14] Fix | Delete
* Access method cursors.
[15] Fix | Delete
* Dbm/Ndbm, Hsearch historic interfaces.
[16] Fix | Delete
*/
[17] Fix | Delete
[18] Fix | Delete
#ifndef _DB_H_
[19] Fix | Delete
#define _DB_H_
[20] Fix | Delete
[21] Fix | Delete
#ifndef __NO_SYSTEM_INCLUDES
[22] Fix | Delete
#include <sys/types.h>
[23] Fix | Delete
#include <inttypes.h>
[24] Fix | Delete
#include <stdint.h>
[25] Fix | Delete
#include <stddef.h>
[26] Fix | Delete
#include <stdio.h>
[27] Fix | Delete
#include <unistd.h>
[28] Fix | Delete
#include <pthread.h>
[29] Fix | Delete
#endif
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
#if defined(__cplusplus)
[33] Fix | Delete
extern "C" {
[34] Fix | Delete
#endif
[35] Fix | Delete
[36] Fix | Delete
[37] Fix | Delete
#undef __P
[38] Fix | Delete
#define __P(protos) protos
[39] Fix | Delete
[40] Fix | Delete
/*
[41] Fix | Delete
* Berkeley DB version information.
[42] Fix | Delete
*/
[43] Fix | Delete
#define DB_VERSION_FAMILY 11
[44] Fix | Delete
#define DB_VERSION_RELEASE 2
[45] Fix | Delete
#define DB_VERSION_MAJOR 5
[46] Fix | Delete
#define DB_VERSION_MINOR 3
[47] Fix | Delete
#define DB_VERSION_PATCH 28
[48] Fix | Delete
#define DB_VERSION_STRING "Berkeley DB 5.3.28: (September 9, 2013)"
[49] Fix | Delete
#define DB_VERSION_FULL_STRING "Berkeley DB 11g Release 2, library version 11.2.5.3.28: (September 9, 2013)"
[50] Fix | Delete
[51] Fix | Delete
/*
[52] Fix | Delete
* !!!
[53] Fix | Delete
* Berkeley DB uses specifically sized types. If they're not provided by
[54] Fix | Delete
* the system, typedef them here.
[55] Fix | Delete
*
[56] Fix | Delete
* We protect them against multiple inclusion using __BIT_TYPES_DEFINED__,
[57] Fix | Delete
* as does BIND and Kerberos, since we don't know for sure what #include
[58] Fix | Delete
* files the user is using.
[59] Fix | Delete
*
[60] Fix | Delete
* !!!
[61] Fix | Delete
* We also provide the standard u_int, u_long etc., if they're not provided
[62] Fix | Delete
* by the system.
[63] Fix | Delete
*/
[64] Fix | Delete
#ifndef __BIT_TYPES_DEFINED__
[65] Fix | Delete
#define __BIT_TYPES_DEFINED__
[66] Fix | Delete
[67] Fix | Delete
[68] Fix | Delete
[69] Fix | Delete
[70] Fix | Delete
[71] Fix | Delete
[72] Fix | Delete
[73] Fix | Delete
#endif
[74] Fix | Delete
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
[78] Fix | Delete
[79] Fix | Delete
[80] Fix | Delete
/*
[81] Fix | Delete
* Missing ANSI types.
[82] Fix | Delete
*
[83] Fix | Delete
* uintmax_t --
[84] Fix | Delete
* Largest unsigned type, used to align structures in memory. We don't store
[85] Fix | Delete
* floating point types in structures, so integral types should be sufficient
[86] Fix | Delete
* (and we don't have to worry about systems that store floats in other than
[87] Fix | Delete
* power-of-2 numbers of bytes). Additionally this fixes compilers that rewrite
[88] Fix | Delete
* structure assignments and ANSI C memcpy calls to be in-line instructions
[89] Fix | Delete
* that happen to require alignment.
[90] Fix | Delete
*
[91] Fix | Delete
* uintptr_t --
[92] Fix | Delete
* Unsigned type that's the same size as a pointer. There are places where
[93] Fix | Delete
* DB modifies pointers by discarding the bottom bits to guarantee alignment.
[94] Fix | Delete
* We can't use uintmax_t, it may be larger than the pointer, and compilers
[95] Fix | Delete
* get upset about that. So far we haven't run on any machine where there's
[96] Fix | Delete
* no unsigned type the same size as a pointer -- here's hoping.
[97] Fix | Delete
*/
[98] Fix | Delete
[99] Fix | Delete
[100] Fix | Delete
[101] Fix | Delete
[102] Fix | Delete
[103] Fix | Delete
[104] Fix | Delete
[105] Fix | Delete
#ifdef HAVE_MIXED_SIZE_ADDRESSING
[106] Fix | Delete
typedef u_int32_t db_size_t;
[107] Fix | Delete
#else
[108] Fix | Delete
typedef size_t db_size_t;
[109] Fix | Delete
#endif
[110] Fix | Delete
[111] Fix | Delete
#ifdef HAVE_MIXED_SIZE_ADDRESSING
[112] Fix | Delete
typedef int32_t db_ssize_t;
[113] Fix | Delete
#else
[114] Fix | Delete
typedef ssize_t db_ssize_t;
[115] Fix | Delete
#endif
[116] Fix | Delete
[117] Fix | Delete
[118] Fix | Delete
/*
[119] Fix | Delete
* Sequences are only available on machines with 64-bit integral types.
[120] Fix | Delete
*/
[121] Fix | Delete
typedef int64_t db_seq_t;
[122] Fix | Delete
[123] Fix | Delete
/* Thread and process identification. */
[124] Fix | Delete
typedef pthread_t db_threadid_t;
[125] Fix | Delete
[126] Fix | Delete
/* Basic types that are exported or quasi-exported. */
[127] Fix | Delete
typedef u_int32_t db_pgno_t; /* Page number type. */
[128] Fix | Delete
typedef u_int16_t db_indx_t; /* Page offset type. */
[129] Fix | Delete
#define DB_MAX_PAGES 0xffffffff /* >= # of pages in a file */
[130] Fix | Delete
[131] Fix | Delete
typedef u_int32_t db_recno_t; /* Record number type. */
[132] Fix | Delete
#define DB_MAX_RECORDS 0xffffffff /* >= # of records in a tree */
[133] Fix | Delete
[134] Fix | Delete
typedef u_int32_t db_timeout_t; /* Type of a timeout. */
[135] Fix | Delete
[136] Fix | Delete
/*
[137] Fix | Delete
* Region offsets are the difference between a pointer in a region and the
[138] Fix | Delete
* region's base address. With private environments, both addresses are the
[139] Fix | Delete
* result of calling malloc, and we can't assume anything about what malloc
[140] Fix | Delete
* will return, so region offsets have to be able to hold differences between
[141] Fix | Delete
* arbitrary pointers.
[142] Fix | Delete
*/
[143] Fix | Delete
typedef db_size_t roff_t;
[144] Fix | Delete
[145] Fix | Delete
/*
[146] Fix | Delete
* Forward structure declarations, so we can declare pointers and
[147] Fix | Delete
* applications can get type checking.
[148] Fix | Delete
*/
[149] Fix | Delete
struct __channel; typedef struct __channel CHANNEL;
[150] Fix | Delete
struct __db; typedef struct __db DB;
[151] Fix | Delete
struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT;
[152] Fix | Delete
struct __db_channel; typedef struct __db_channel DB_CHANNEL;
[153] Fix | Delete
struct __db_cipher; typedef struct __db_cipher DB_CIPHER;
[154] Fix | Delete
struct __db_compact; typedef struct __db_compact DB_COMPACT;
[155] Fix | Delete
struct __db_dbt; typedef struct __db_dbt DBT;
[156] Fix | Delete
struct __db_distab; typedef struct __db_distab DB_DISTAB;
[157] Fix | Delete
struct __db_env; typedef struct __db_env DB_ENV;
[158] Fix | Delete
struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT;
[159] Fix | Delete
struct __db_heap_rid; typedef struct __db_heap_rid DB_HEAP_RID;
[160] Fix | Delete
struct __db_heap_stat; typedef struct __db_heap_stat DB_HEAP_STAT;
[161] Fix | Delete
struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK;
[162] Fix | Delete
struct __db_lock_hstat; typedef struct __db_lock_hstat DB_LOCK_HSTAT;
[163] Fix | Delete
struct __db_lock_pstat; typedef struct __db_lock_pstat DB_LOCK_PSTAT;
[164] Fix | Delete
struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT;
[165] Fix | Delete
struct __db_lock_u; typedef struct __db_lock_u DB_LOCK;
[166] Fix | Delete
struct __db_locker; typedef struct __db_locker DB_LOCKER;
[167] Fix | Delete
struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ;
[168] Fix | Delete
struct __db_locktab; typedef struct __db_locktab DB_LOCKTAB;
[169] Fix | Delete
struct __db_log; typedef struct __db_log DB_LOG;
[170] Fix | Delete
struct __db_log_cursor; typedef struct __db_log_cursor DB_LOGC;
[171] Fix | Delete
struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT;
[172] Fix | Delete
struct __db_lsn; typedef struct __db_lsn DB_LSN;
[173] Fix | Delete
struct __db_mpool; typedef struct __db_mpool DB_MPOOL;
[174] Fix | Delete
struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT;
[175] Fix | Delete
struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT;
[176] Fix | Delete
struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE;
[177] Fix | Delete
struct __db_mutex_stat; typedef struct __db_mutex_stat DB_MUTEX_STAT;
[178] Fix | Delete
struct __db_mutex_t; typedef struct __db_mutex_t DB_MUTEX;
[179] Fix | Delete
struct __db_mutexmgr; typedef struct __db_mutexmgr DB_MUTEXMGR;
[180] Fix | Delete
struct __db_preplist; typedef struct __db_preplist DB_PREPLIST;
[181] Fix | Delete
struct __db_qam_stat; typedef struct __db_qam_stat DB_QUEUE_STAT;
[182] Fix | Delete
struct __db_rep; typedef struct __db_rep DB_REP;
[183] Fix | Delete
struct __db_rep_stat; typedef struct __db_rep_stat DB_REP_STAT;
[184] Fix | Delete
struct __db_repmgr_conn_err;
[185] Fix | Delete
typedef struct __db_repmgr_conn_err DB_REPMGR_CONN_ERR;
[186] Fix | Delete
struct __db_repmgr_site;typedef struct __db_repmgr_site DB_REPMGR_SITE;
[187] Fix | Delete
struct __db_repmgr_stat;typedef struct __db_repmgr_stat DB_REPMGR_STAT;
[188] Fix | Delete
struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD;
[189] Fix | Delete
struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT;
[190] Fix | Delete
struct __db_site; typedef struct __db_site DB_SITE;
[191] Fix | Delete
struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE;
[192] Fix | Delete
struct __db_thread_info;typedef struct __db_thread_info DB_THREAD_INFO;
[193] Fix | Delete
struct __db_txn; typedef struct __db_txn DB_TXN;
[194] Fix | Delete
struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE;
[195] Fix | Delete
struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT;
[196] Fix | Delete
struct __db_txn_token; typedef struct __db_txn_token DB_TXN_TOKEN;
[197] Fix | Delete
struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR;
[198] Fix | Delete
struct __dbc; typedef struct __dbc DBC;
[199] Fix | Delete
struct __dbc_internal; typedef struct __dbc_internal DBC_INTERNAL;
[200] Fix | Delete
struct __env; typedef struct __env ENV;
[201] Fix | Delete
struct __fh_t; typedef struct __fh_t DB_FH;
[202] Fix | Delete
struct __fname; typedef struct __fname FNAME;
[203] Fix | Delete
struct __key_range; typedef struct __key_range DB_KEY_RANGE;
[204] Fix | Delete
struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE;
[205] Fix | Delete
struct __db_logvrfy_config;
[206] Fix | Delete
typedef struct __db_logvrfy_config DB_LOG_VERIFY_CONFIG;
[207] Fix | Delete
[208] Fix | Delete
/*
[209] Fix | Delete
* The Berkeley DB API flags are automatically-generated -- the following flag
[210] Fix | Delete
* names are no longer used, but remain for compatibility reasons.
[211] Fix | Delete
*/
[212] Fix | Delete
#define DB_DEGREE_2 DB_READ_COMMITTED
[213] Fix | Delete
#define DB_DIRTY_READ DB_READ_UNCOMMITTED
[214] Fix | Delete
#define DB_JOINENV 0x0
[215] Fix | Delete
[216] Fix | Delete
/* Key/data structure -- a Data-Base Thang. */
[217] Fix | Delete
struct __db_dbt {
[218] Fix | Delete
void *data; /* Key/data */
[219] Fix | Delete
u_int32_t size; /* key/data length */
[220] Fix | Delete
[221] Fix | Delete
u_int32_t ulen; /* RO: length of user buffer. */
[222] Fix | Delete
u_int32_t dlen; /* RO: get/put record length. */
[223] Fix | Delete
u_int32_t doff; /* RO: get/put record offset. */
[224] Fix | Delete
[225] Fix | Delete
void *app_data;
[226] Fix | Delete
[227] Fix | Delete
#define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory. */
[228] Fix | Delete
#define DB_DBT_BULK 0x002 /* Internal: Insert if duplicate. */
[229] Fix | Delete
#define DB_DBT_DUPOK 0x004 /* Internal: Insert if duplicate. */
[230] Fix | Delete
#define DB_DBT_ISSET 0x008 /* Lower level calls set value. */
[231] Fix | Delete
#define DB_DBT_MALLOC 0x010 /* Return in malloc'd memory. */
[232] Fix | Delete
#define DB_DBT_MULTIPLE 0x020 /* References multiple records. */
[233] Fix | Delete
#define DB_DBT_PARTIAL 0x040 /* Partial put/get. */
[234] Fix | Delete
#define DB_DBT_REALLOC 0x080 /* Return in realloc'd memory. */
[235] Fix | Delete
#define DB_DBT_READONLY 0x100 /* Readonly, don't update. */
[236] Fix | Delete
#define DB_DBT_STREAMING 0x200 /* Internal: DBT is being streamed. */
[237] Fix | Delete
#define DB_DBT_USERCOPY 0x400 /* Use the user-supplied callback. */
[238] Fix | Delete
#define DB_DBT_USERMEM 0x800 /* Return in user's memory. */
[239] Fix | Delete
u_int32_t flags;
[240] Fix | Delete
};
[241] Fix | Delete
[242] Fix | Delete
/*******************************************************
[243] Fix | Delete
* Mutexes.
[244] Fix | Delete
*******************************************************/
[245] Fix | Delete
/*
[246] Fix | Delete
* When mixed size addressing is supported mutexes need to be the same size
[247] Fix | Delete
* independent of the process address size is.
[248] Fix | Delete
*/
[249] Fix | Delete
#ifdef HAVE_MIXED_SIZE_ADDRESSING
[250] Fix | Delete
typedef db_size_t db_mutex_t;
[251] Fix | Delete
#else
[252] Fix | Delete
typedef uintptr_t db_mutex_t;
[253] Fix | Delete
#endif
[254] Fix | Delete
[255] Fix | Delete
struct __db_mutex_stat { /* SHARED */
[256] Fix | Delete
/* The following fields are maintained in the region's copy. */
[257] Fix | Delete
u_int32_t st_mutex_align; /* Mutex alignment */
[258] Fix | Delete
u_int32_t st_mutex_tas_spins; /* Mutex test-and-set spins */
[259] Fix | Delete
u_int32_t st_mutex_init; /* Initial mutex count */
[260] Fix | Delete
u_int32_t st_mutex_cnt; /* Mutex count */
[261] Fix | Delete
u_int32_t st_mutex_max; /* Mutex max */
[262] Fix | Delete
u_int32_t st_mutex_free; /* Available mutexes */
[263] Fix | Delete
u_int32_t st_mutex_inuse; /* Mutexes in use */
[264] Fix | Delete
u_int32_t st_mutex_inuse_max; /* Maximum mutexes ever in use */
[265] Fix | Delete
[266] Fix | Delete
/* The following fields are filled-in from other places. */
[267] Fix | Delete
#ifndef __TEST_DB_NO_STATISTICS
[268] Fix | Delete
uintmax_t st_region_wait; /* Region lock granted after wait. */
[269] Fix | Delete
uintmax_t st_region_nowait; /* Region lock granted without wait. */
[270] Fix | Delete
roff_t st_regsize; /* Region size. */
[271] Fix | Delete
roff_t st_regmax; /* Region max. */
[272] Fix | Delete
#endif
[273] Fix | Delete
};
[274] Fix | Delete
[275] Fix | Delete
/* This is the length of the buffer passed to DB_ENV->thread_id_string() */
[276] Fix | Delete
#define DB_THREADID_STRLEN 128
[277] Fix | Delete
[278] Fix | Delete
/*******************************************************
[279] Fix | Delete
* Locking.
[280] Fix | Delete
*******************************************************/
[281] Fix | Delete
#define DB_LOCKVERSION 1
[282] Fix | Delete
[283] Fix | Delete
#define DB_FILE_ID_LEN 20 /* Unique file ID length. */
[284] Fix | Delete
[285] Fix | Delete
/*
[286] Fix | Delete
* Deadlock detector modes; used in the DB_ENV structure to configure the
[287] Fix | Delete
* locking subsystem.
[288] Fix | Delete
*/
[289] Fix | Delete
#define DB_LOCK_NORUN 0
[290] Fix | Delete
#define DB_LOCK_DEFAULT 1 /* Default policy. */
[291] Fix | Delete
#define DB_LOCK_EXPIRE 2 /* Only expire locks, no detection. */
[292] Fix | Delete
#define DB_LOCK_MAXLOCKS 3 /* Select locker with max locks. */
[293] Fix | Delete
#define DB_LOCK_MAXWRITE 4 /* Select locker with max writelocks. */
[294] Fix | Delete
#define DB_LOCK_MINLOCKS 5 /* Select locker with min locks. */
[295] Fix | Delete
#define DB_LOCK_MINWRITE 6 /* Select locker with min writelocks. */
[296] Fix | Delete
#define DB_LOCK_OLDEST 7 /* Select oldest locker. */
[297] Fix | Delete
#define DB_LOCK_RANDOM 8 /* Select random locker. */
[298] Fix | Delete
#define DB_LOCK_YOUNGEST 9 /* Select youngest locker. */
[299] Fix | Delete
[300] Fix | Delete
/*
[301] Fix | Delete
* Simple R/W lock modes and for multi-granularity intention locking.
[302] Fix | Delete
*
[303] Fix | Delete
* !!!
[304] Fix | Delete
* These values are NOT random, as they are used as an index into the lock
[305] Fix | Delete
* conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD
[306] Fix | Delete
* must be == 4.
[307] Fix | Delete
*/
[308] Fix | Delete
typedef enum {
[309] Fix | Delete
DB_LOCK_NG=0, /* Not granted. */
[310] Fix | Delete
DB_LOCK_READ=1, /* Shared/read. */
[311] Fix | Delete
DB_LOCK_WRITE=2, /* Exclusive/write. */
[312] Fix | Delete
DB_LOCK_WAIT=3, /* Wait for event */
[313] Fix | Delete
DB_LOCK_IWRITE=4, /* Intent exclusive/write. */
[314] Fix | Delete
DB_LOCK_IREAD=5, /* Intent to share/read. */
[315] Fix | Delete
DB_LOCK_IWR=6, /* Intent to read and write. */
[316] Fix | Delete
DB_LOCK_READ_UNCOMMITTED=7, /* Degree 1 isolation. */
[317] Fix | Delete
DB_LOCK_WWRITE=8 /* Was Written. */
[318] Fix | Delete
} db_lockmode_t;
[319] Fix | Delete
[320] Fix | Delete
/*
[321] Fix | Delete
* Request types.
[322] Fix | Delete
*/
[323] Fix | Delete
typedef enum {
[324] Fix | Delete
DB_LOCK_DUMP=0, /* Display held locks. */
[325] Fix | Delete
DB_LOCK_GET=1, /* Get the lock. */
[326] Fix | Delete
DB_LOCK_GET_TIMEOUT=2, /* Get lock with a timeout. */
[327] Fix | Delete
DB_LOCK_INHERIT=3, /* Pass locks to parent. */
[328] Fix | Delete
DB_LOCK_PUT=4, /* Release the lock. */
[329] Fix | Delete
DB_LOCK_PUT_ALL=5, /* Release locker's locks. */
[330] Fix | Delete
DB_LOCK_PUT_OBJ=6, /* Release locker's locks on obj. */
[331] Fix | Delete
DB_LOCK_PUT_READ=7, /* Release locker's read locks. */
[332] Fix | Delete
DB_LOCK_TIMEOUT=8, /* Force a txn to timeout. */
[333] Fix | Delete
DB_LOCK_TRADE=9, /* Trade locker ids on a lock. */
[334] Fix | Delete
DB_LOCK_UPGRADE_WRITE=10 /* Upgrade writes for dirty reads. */
[335] Fix | Delete
} db_lockop_t;
[336] Fix | Delete
[337] Fix | Delete
/*
[338] Fix | Delete
* Status of a lock.
[339] Fix | Delete
*/
[340] Fix | Delete
typedef enum {
[341] Fix | Delete
DB_LSTAT_ABORTED=1, /* Lock belongs to an aborted txn. */
[342] Fix | Delete
DB_LSTAT_EXPIRED=2, /* Lock has expired. */
[343] Fix | Delete
DB_LSTAT_FREE=3, /* Lock is unallocated. */
[344] Fix | Delete
DB_LSTAT_HELD=4, /* Lock is currently held. */
[345] Fix | Delete
DB_LSTAT_PENDING=5, /* Lock was waiting and has been
[346] Fix | Delete
* promoted; waiting for the owner
[347] Fix | Delete
* to run and upgrade it to held. */
[348] Fix | Delete
DB_LSTAT_WAITING=6 /* Lock is on the wait queue. */
[349] Fix | Delete
}db_status_t;
[350] Fix | Delete
[351] Fix | Delete
/* Lock statistics structure. */
[352] Fix | Delete
struct __db_lock_stat { /* SHARED */
[353] Fix | Delete
u_int32_t st_id; /* Last allocated locker ID. */
[354] Fix | Delete
u_int32_t st_cur_maxid; /* Current maximum unused ID. */
[355] Fix | Delete
u_int32_t st_initlocks; /* Initial number of locks in table. */
[356] Fix | Delete
u_int32_t st_initlockers; /* Initial num of lockers in table. */
[357] Fix | Delete
u_int32_t st_initobjects; /* Initial num of objects in table. */
[358] Fix | Delete
u_int32_t st_locks; /* Current number of locks in table. */
[359] Fix | Delete
u_int32_t st_lockers; /* Current num of lockers in table. */
[360] Fix | Delete
u_int32_t st_objects; /* Current num of objects in table. */
[361] Fix | Delete
u_int32_t st_maxlocks; /* Maximum number of locks in table. */
[362] Fix | Delete
u_int32_t st_maxlockers; /* Maximum num of lockers in table. */
[363] Fix | Delete
u_int32_t st_maxobjects; /* Maximum num of objects in table. */
[364] Fix | Delete
u_int32_t st_partitions; /* number of partitions. */
[365] Fix | Delete
u_int32_t st_tablesize; /* Size of object hash table. */
[366] Fix | Delete
int32_t st_nmodes; /* Number of lock modes. */
[367] Fix | Delete
u_int32_t st_nlockers; /* Current number of lockers. */
[368] Fix | Delete
#ifndef __TEST_DB_NO_STATISTICS
[369] Fix | Delete
u_int32_t st_nlocks; /* Current number of locks. */
[370] Fix | Delete
u_int32_t st_maxnlocks; /* Maximum number of locks so far. */
[371] Fix | Delete
u_int32_t st_maxhlocks; /* Maximum number of locks in any bucket. */
[372] Fix | Delete
uintmax_t st_locksteals; /* Number of lock steals so far. */
[373] Fix | Delete
uintmax_t st_maxlsteals; /* Maximum number steals in any partition. */
[374] Fix | Delete
u_int32_t st_maxnlockers; /* Maximum number of lockers so far. */
[375] Fix | Delete
u_int32_t st_nobjects; /* Current number of objects. */
[376] Fix | Delete
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
[377] Fix | Delete
u_int32_t st_maxhobjects; /* Maximum number of objectsin any bucket. */
[378] Fix | Delete
uintmax_t st_objectsteals; /* Number of objects steals so far. */
[379] Fix | Delete
uintmax_t st_maxosteals; /* Maximum number of steals in any partition. */
[380] Fix | Delete
uintmax_t st_nrequests; /* Number of lock gets. */
[381] Fix | Delete
uintmax_t st_nreleases; /* Number of lock puts. */
[382] Fix | Delete
uintmax_t st_nupgrade; /* Number of lock upgrades. */
[383] Fix | Delete
uintmax_t st_ndowngrade; /* Number of lock downgrades. */
[384] Fix | Delete
uintmax_t st_lock_wait; /* Lock conflicts w/ subsequent wait */
[385] Fix | Delete
uintmax_t st_lock_nowait; /* Lock conflicts w/o subsequent wait */
[386] Fix | Delete
uintmax_t st_ndeadlocks; /* Number of lock deadlocks. */
[387] Fix | Delete
db_timeout_t st_locktimeout; /* Lock timeout. */
[388] Fix | Delete
uintmax_t st_nlocktimeouts; /* Number of lock timeouts. */
[389] Fix | Delete
db_timeout_t st_txntimeout; /* Transaction timeout. */
[390] Fix | Delete
uintmax_t st_ntxntimeouts; /* Number of transaction timeouts. */
[391] Fix | Delete
uintmax_t st_part_wait; /* Partition lock granted after wait. */
[392] Fix | Delete
uintmax_t st_part_nowait; /* Partition lock granted without wait. */
[393] Fix | Delete
uintmax_t st_part_max_wait; /* Max partition lock granted after wait. */
[394] Fix | Delete
uintmax_t st_part_max_nowait; /* Max partition lock granted without wait. */
[395] Fix | Delete
uintmax_t st_objs_wait; /* Object lock granted after wait. */
[396] Fix | Delete
uintmax_t st_objs_nowait; /* Object lock granted without wait. */
[397] Fix | Delete
uintmax_t st_lockers_wait; /* Locker lock granted after wait. */
[398] Fix | Delete
uintmax_t st_lockers_nowait; /* Locker lock granted without wait. */
[399] Fix | Delete
uintmax_t st_region_wait; /* Region lock granted after wait. */
[400] Fix | Delete
uintmax_t st_region_nowait; /* Region lock granted without wait. */
[401] Fix | Delete
u_int32_t st_hash_len; /* Max length of bucket. */
[402] Fix | Delete
roff_t st_regsize; /* Region size. */
[403] Fix | Delete
#endif
[404] Fix | Delete
};
[405] Fix | Delete
[406] Fix | Delete
struct __db_lock_hstat { /* SHARED */
[407] Fix | Delete
uintmax_t st_nrequests; /* Number of lock gets. */
[408] Fix | Delete
uintmax_t st_nreleases; /* Number of lock puts. */
[409] Fix | Delete
uintmax_t st_nupgrade; /* Number of lock upgrades. */
[410] Fix | Delete
uintmax_t st_ndowngrade; /* Number of lock downgrades. */
[411] Fix | Delete
u_int32_t st_nlocks; /* Current number of locks. */
[412] Fix | Delete
u_int32_t st_maxnlocks; /* Maximum number of locks so far. */
[413] Fix | Delete
u_int32_t st_nobjects; /* Current number of objects. */
[414] Fix | Delete
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
[415] Fix | Delete
uintmax_t st_lock_wait; /* Lock conflicts w/ subsequent wait */
[416] Fix | Delete
uintmax_t st_lock_nowait; /* Lock conflicts w/o subsequent wait */
[417] Fix | Delete
uintmax_t st_nlocktimeouts; /* Number of lock timeouts. */
[418] Fix | Delete
uintmax_t st_ntxntimeouts; /* Number of transaction timeouts. */
[419] Fix | Delete
u_int32_t st_hash_len; /* Max length of bucket. */
[420] Fix | Delete
};
[421] Fix | Delete
[422] Fix | Delete
struct __db_lock_pstat { /* SHARED */
[423] Fix | Delete
u_int32_t st_nlocks; /* Current number of locks. */
[424] Fix | Delete
u_int32_t st_maxnlocks; /* Maximum number of locks so far. */
[425] Fix | Delete
u_int32_t st_nobjects; /* Current number of objects. */
[426] Fix | Delete
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
[427] Fix | Delete
uintmax_t st_locksteals; /* Number of lock steals so far. */
[428] Fix | Delete
uintmax_t st_objectsteals; /* Number of objects steals so far. */
[429] Fix | Delete
};
[430] Fix | Delete
[431] Fix | Delete
/*
[432] Fix | Delete
* DB_LOCK_ILOCK --
[433] Fix | Delete
* Internal DB access method lock.
[434] Fix | Delete
*/
[435] Fix | Delete
struct __db_ilock { /* SHARED */
[436] Fix | Delete
db_pgno_t pgno; /* Page being locked. */
[437] Fix | Delete
u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */
[438] Fix | Delete
#define DB_HANDLE_LOCK 1
[439] Fix | Delete
#define DB_RECORD_LOCK 2
[440] Fix | Delete
#define DB_PAGE_LOCK 3
[441] Fix | Delete
#define DB_DATABASE_LOCK 4
[442] Fix | Delete
u_int32_t type; /* Type of lock. */
[443] Fix | Delete
};
[444] Fix | Delete
[445] Fix | Delete
/*
[446] Fix | Delete
* DB_LOCK --
[447] Fix | Delete
* The structure is allocated by the caller and filled in during a
[448] Fix | Delete
* lock_get request (or a lock_vec/DB_LOCK_GET).
[449] Fix | Delete
*/
[450] Fix | Delete
struct __db_lock_u { /* SHARED */
[451] Fix | Delete
roff_t off; /* Offset of the lock in the region */
[452] Fix | Delete
u_int32_t ndx; /* Index of the object referenced by
[453] Fix | Delete
* this lock; used for locking. */
[454] Fix | Delete
u_int32_t gen; /* Generation number of this lock. */
[455] Fix | Delete
db_lockmode_t mode; /* mode of this lock. */
[456] Fix | Delete
};
[457] Fix | Delete
[458] Fix | Delete
/* Lock request structure. */
[459] Fix | Delete
struct __db_lockreq {
[460] Fix | Delete
db_lockop_t op; /* Operation. */
[461] Fix | Delete
db_lockmode_t mode; /* Requested mode. */
[462] Fix | Delete
db_timeout_t timeout; /* Time to expire lock. */
[463] Fix | Delete
DBT *obj; /* Object being locked. */
[464] Fix | Delete
DB_LOCK lock; /* Lock returned. */
[465] Fix | Delete
};
[466] Fix | Delete
[467] Fix | Delete
/*******************************************************
[468] Fix | Delete
* Logging.
[469] Fix | Delete
*******************************************************/
[470] Fix | Delete
#define DB_LOGVERSION 19 /* Current log version. */
[471] Fix | Delete
#define DB_LOGVERSION_LATCHING 15 /* Log version using latching: db-4.8 */
[472] Fix | Delete
#define DB_LOGCHKSUM 12 /* Check sum headers: db-4.5 */
[473] Fix | Delete
#define DB_LOGOLDVER 8 /* Oldest version supported: db-4.2 */
[474] Fix | Delete
#define DB_LOGMAGIC 0x040988
[475] Fix | Delete
[476] Fix | Delete
/*
[477] Fix | Delete
* A DB_LSN has two parts, a fileid which identifies a specific file, and an
[478] Fix | Delete
* offset within that file. The fileid is an unsigned 4-byte quantity that
[479] Fix | Delete
* uniquely identifies a file within the log directory -- currently a simple
[480] Fix | Delete
* counter inside the log. The offset is also an unsigned 4-byte value. The
[481] Fix | Delete
* log manager guarantees the offset is never more than 4 bytes by switching
[482] Fix | Delete
* to a new log file before the maximum length imposed by an unsigned 4-byte
[483] Fix | Delete
* offset is reached.
[484] Fix | Delete
*/
[485] Fix | Delete
struct __db_lsn { /* SHARED */
[486] Fix | Delete
u_int32_t file; /* File ID. */
[487] Fix | Delete
u_int32_t offset; /* File offset. */
[488] Fix | Delete
};
[489] Fix | Delete
[490] Fix | Delete
/*
[491] Fix | Delete
* Application-specified log record types start at DB_user_BEGIN, and must not
[492] Fix | Delete
* equal or exceed DB_debug_FLAG.
[493] Fix | Delete
*
[494] Fix | Delete
* DB_debug_FLAG is the high-bit of the u_int32_t that specifies a log record
[495] Fix | Delete
* type. If the flag is set, it's a log record that was logged for debugging
[496] Fix | Delete
* purposes only, even if it reflects a database change -- the change was part
[497] Fix | Delete
* of a non-durable transaction.
[498] Fix | Delete
*/
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function