1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1996, 1997, 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A * @(#)db.h 10.174 (Sleepycat) 1/3/99 1N/A * MacOS: ensure that Metrowerks C makes enumeration types int sized. 1N/A * Handle function prototypes and the keyword "const". This steps on name 1N/A * space that DB doesn't control, but all of the other solutions are worse. 1N/A * While Microsoft's compiler is ANSI C compliant, it doesn't have _STDC_ 1N/A * defined by default, you specify a command line flag or #pragma to turn 1N/A * it on. Don't do that, however, because some of Microsoft's own header 1N/A * files won't compile. 1N/A * DB needs basic information about specifically sized types. If they're 1N/A * not provided by the system, typedef them here. 1N/A * We protect them against multiple inclusion using __BIT_TYPES_DEFINED__, 1N/A * as does BIND and Kerberos, since we don't know for sure what #include 1N/A * files the user is using. 1N/A * We also provide the standard u_int, u_long etc., if they're not provided 1N/A/* Forward structure declarations, so applications get type checking. */ 1N/A * DB run-time interface configuration. 1N/A * There are a set of functions that the application can replace with its 1N/A * own versions, and some other knobs which can be turned at run-time. 1N/A * Database configuration and initialization. 1N/A * Flags understood by both db_open(3) and db_appinit(3). 1N/A#
define DB_CREATE 0x000001 /* O_CREAT: create file as necessary. */ 1N/A#
define DB_THREAD 0x000004 /* Free-thread DB package handles. */ 1N/A * Flags understood by db_appinit(3). 1N/A/* 0x000007 COMMON MASK. */ 1N/A * Flags understood by db_open(3). 1N/A * DB_EXCL and DB_TEMPORARY are internal only, and are not documented. 1N/A * DB_SEQUENTIAL is currently internal, but may be exported some day. 1N/A/* 0x000007 COMMON MASK. */ 1N/A/* 0x001fff ALREADY USED. */ 1N/A#
define DB_EXCL 0x002000 /* O_EXCL: exclusive open (internal). */ 1N/A * Deadlock detector modes; used in the DBENV structure to configure the 1N/A * locking subsystem. 1N/A /* Error message callback. */ 1N/A * Explicit representations of structures in queue.h. 1N/A * TAILQ_ENTRY(__db_env); 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A /* Local heap allocation. */ 1N/A /* Btree access method. */ 1N/A /* Hash access method. */ 1N/A /* Recno access method. */ 1N/A#
define DB_DUP 0x0002 /* Btree, Hash: duplicate keys. */ 1N/A#
define DB_PAD 0x0010 /* Recno: re_pad set. */ 1N/A * DB access method and cursor operation values. Each value is an operation 1N/A * code to which additional bit flags are added. 1N/A#
define DB_RMW 0x80000000 /* Acquire write flag immediately. */ 1N/A * DB (user visible) error return codes. 1N/A * Changes to any of the user visible error return codes must be reflected 1N/A was never created by the user. */ 1N/A/* DB (private) error return codes. */ 1N/A/* DB access method description structure. */ 1N/A void *
mutexp;
/* Synchronization for free threading */ 1N/A /* Documented, returned information. */ 1N/A * Explicit representations of structures in queue.h. 1N/A * TAILQ_HEAD(free_queue, __dbc); 1N/A * TAILQ_HEAD(active_queue, __dbc); 1N/A /* Local heap allocation. */ 1N/A/* Cursor description structure. */ 1N/A DB *
dbp;
/* Related DB access method. */ 1N/A * Explicit representations of structures in queue.h. 1N/A * TAILQ_ENTRY(__dbc); 1N/A#
define DBC_RMW 0x008 /* Acquire write flag in read op. */ 1N/A/* Hash statistics structure. */ 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A/* Flag values for lock_vec(), lock_get(). */ 1N/A of granting a new one (internal). */ 1N/A/* Flag values for lock_detect(). */ 1N/A * Simple R/W lock modes and for multi-granularity intention locking. 1N/A * These values are NOT random, as they are used as an index into the lock 1N/A * conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD 1N/A * promoted; waiting for the owner 1N/A * to run and upgrade it to held. */ 1N/A/* Lock request structure. */ 1N/A * Commonly used conflict matrices. 1N/A/* Multi-granularity locking. */ 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A/* Flag values for log_archive(). */ 1N/A * A DB_LSN has two parts, a fileid which identifies a specific file, and an 1N/A * offset within that file. The fileid is an unsigned 4-byte quantity that 1N/A * uniquely identifies a file within the log directory -- currently a simple 1N/A * counter inside the log. The offset is also an unsigned 4-byte value. The 1N/A * log manager guarantees the offset is never more than 4 bytes by switching 1N/A * to a new log file before the maximum length imposed by an unsigned 4-byte 1N/A * offset is reached. 1N/A/* Log statistics structure. */ 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A/* Flag values for memp_fget(). */ 1N/A/* Flag values for memp_fput(), memp_fset(). */ 1N/A/* Mpool statistics structure. */ 1N/A/* Mpool file open information structure. */ 1N/A/* Mpool file statistics structure. */ 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A/* Operations values to the tx_recover() function. */ 1N/A/* Internal transaction status values. */ 1N/A/* Transaction statistics structure. */ 1N/A/******************************************************* 1N/A *******************************************************/ 1N/A * The db(3) support for ndbm(3) always appends this suffix to the 1N/A * file name to avoid overwriting the user's original database. 1N/A * Translate DBM calls into DB calls so that DB doesn't step on the 1N/A * application's name space. 1N/A * The global variables dbrdonly, dirf and pagf were not retained when 1N/A * 4BSD replaced the dbm interface with ndbm, and are not support here. 1N/A/* Prototype the DB calls. */ 1N/A * Translate NDBM calls into DB calls so that DB doesn't step on the 1N/A * application's name space. 1N/A/* Prototype the DB calls. */ 1N/A/******************************************************* 1N/A * Hsearch historic interface. 1N/A *******************************************************/ 1N/A * Translate HSEARCH calls into DB calls so that DB doesn't step on the 1N/A * application's name space. 1N/A/* Prototype the DB calls. */ 1N/A#
endif /* DB_DBM_HSEARCH */ 1N/A * MacOS: Reset Metrowerks C enum sizes.