#ifndef _DB_H_
#define _DB_H_
#ifndef __NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <stdio.h>
#endif
#ifdef __MWERKS__
#pragma enumsalwaysint on
#endif
#undef __P
#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
#define __P(protos) protos
#else
#define const
#define __P(protos) ()
#endif
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
#endif
#define DB_VERSION_MAJOR 2
#define DB_VERSION_MINOR 7
#define DB_VERSION_PATCH 7
#define DB_VERSION_STRING "Sleepycat Software: Berkeley DB 2.7.7: (08/20/99)"
typedef u_int32_t db_pgno_t;
typedef u_int16_t db_indx_t;
#define DB_MAX_PAGES 0xffffffff
typedef u_int32_t db_recno_t;
#define DB_MAX_RECORDS 0xffffffff
typedef size_t DB_LOCK;
struct __db; typedef struct __db DB;
#ifdef DB_DBM_HSEARCH
typedef struct __db DBM;
#endif
struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT;
struct __db_dbt; typedef struct __db_dbt DBT;
struct __db_env; typedef struct __db_env DB_ENV;
struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK;
struct __db_info; typedef struct __db_info DB_INFO;
struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT;
struct __db_lockregion; typedef struct __db_lockregion DB_LOCKREGION;
struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ;
struct __db_locktab; typedef struct __db_locktab DB_LOCKTAB;
struct __db_log; typedef struct __db_log DB_LOG;
struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT;
struct __db_lsn; typedef struct __db_lsn DB_LSN;
struct __db_mpool; typedef struct __db_mpool DB_MPOOL;
struct __db_mpool_finfo;typedef struct __db_mpool_finfo DB_MPOOL_FINFO;
struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT;
struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT;
struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE;
struct __db_txn; typedef struct __db_txn DB_TXN;
struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE;
struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT;
struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR;
struct __db_txnregion; typedef struct __db_txnregion DB_TXNREGION;
struct __dbc; typedef struct __dbc DBC;
struct __db_dbt {
void *data;
u_int32_t size;
u_int32_t ulen;
u_int32_t dlen;
u_int32_t doff;
#define DB_DBT_INTERNAL 0x01
#define DB_DBT_MALLOC 0x02
#define DB_DBT_PARTIAL 0x04
#define DB_DBT_USERMEM 0x08
u_int32_t flags;
};
#define DB_FUNC_CLOSE 1
#define DB_FUNC_DIRFREE 2
#define DB_FUNC_DIRLIST 3
#define DB_FUNC_EXISTS 4
#define DB_FUNC_FREE 5
#define DB_FUNC_FSYNC 6
#define DB_FUNC_IOINFO 7
#define DB_FUNC_MALLOC 8
#define DB_FUNC_MAP 9
#define DB_FUNC_OPEN 10
#define DB_FUNC_READ 11
#define DB_FUNC_REALLOC 12
#define DB_FUNC_RUNLINK 13
#define DB_FUNC_SEEK 14
#define DB_FUNC_SLEEP 15
#define DB_FUNC_UNLINK 16
#define DB_FUNC_UNMAP 17
#define DB_FUNC_WRITE 18
#define DB_FUNC_YIELD 19
#define DB_MUTEXLOCKS 20
#define DB_PAGEYIELD 21
#define DB_REGION_ANON 22
#define DB_REGION_INIT 23
#define DB_REGION_NAME 24
#define DB_TSL_SPINS 25
#define DB_CREATE 0x000001
#define DB_NOMMAP 0x000002
#define DB_THREAD 0x000004
#define DB_INIT_CDB 0x000008
#define DB_INIT_LOCK 0x000010
#define DB_INIT_LOG 0x000020
#define DB_INIT_MPOOL 0x000040
#define DB_INIT_TXN 0x000080
#define DB_MPOOL_PRIVATE 0x000100
#define DB_RECOVER 0x000200
#define DB_RECOVER_FATAL 0x000400
#define DB_TXN_NOSYNC 0x000800
#define DB_USE_ENVIRON 0x001000
#define DB_USE_ENVIRON_ROOT 0x002000
#define DB_EXCL 0x002000
#define DB_RDONLY 0x004000
#define DB_SEQUENTIAL 0x008000
#define DB_TEMPORARY 0x010000
#define DB_TRUNCATE 0x020000
#define DB_FCNTL_LOCKING 0x040000
#define DB_LOCK_NORUN 0
#define DB_LOCK_DEFAULT 1
#define DB_LOCK_OLDEST 2
#define DB_LOCK_RANDOM 3
#define DB_LOCK_YOUNGEST 4
struct __db_env {
int db_lorder;
void (*db_errcall) __P((const char *, char *));
FILE *db_errfile;
const char *db_errpfx;
int db_verbose;
int db_panic;
void (*db_paniccall) __P((DB_ENV *, int));
char *db_home;
char *db_log_dir;
char *db_tmp_dir;
char **db_data_dir;
int data_cnt;
int data_next;
DB_LOCKTAB *lk_info;
const u_int8_t *lk_conflicts;
u_int32_t lk_modes;
u_int32_t lk_max;
u_int32_t lk_detect;
DB_LOG *lg_info;
u_int32_t lg_max;
DB_MPOOL *mp_info;
size_t mp_mmapsize;
size_t mp_size;
DB_TXNMGR *tx_info;
u_int32_t tx_max;
int (*tx_recover)
__P((DB_LOG *, DBT *, DB_LSN *, int, void *));
struct {
struct __db_env *tqe_next;
struct __db_env **tqe_prev;
} links;
int xa_rmid;
DB_TXN *xa_txn;
#define DB_ENV_APPINIT 0x01
#define DB_ENV_CDB 0x02
#define DB_ENV_STANDALONE 0x04
#define DB_ENV_THREAD 0x08
u_int32_t flags;
};
typedef enum {
DB_BTREE=1,
DB_HASH,
DB_RECNO,
DB_UNKNOWN
} DBTYPE;
#define DB_BTREEVERSION 6
#define DB_BTREEOLDVER 6
#define DB_BTREEMAGIC 0x053162
#define DB_HASHVERSION 5
#define DB_HASHOLDVER 4
#define DB_HASHMAGIC 0x061561
#define DB_LOGVERSION 2
#define DB_LOGOLDVER 2
#define DB_LOGMAGIC 0x040988
struct __db_info {
int db_lorder;
size_t db_cachesize;
size_t db_pagesize;
void *(*db_malloc) __P((size_t));
int (*dup_compare)
__P((const DBT *, const DBT *));
u_int32_t bt_maxkey;
u_int32_t bt_minkey;
int (*bt_compare)
__P((const DBT *, const DBT *));
size_t (*bt_prefix)
__P((const DBT *, const DBT *));
u_int32_t h_ffactor;
u_int32_t h_nelem;
u_int32_t (*h_hash)
__P((const void *, u_int32_t));
int re_pad;
int re_delim;
u_int32_t re_len;
char *re_source;
#define DB_DELIMITER 0x0001
#define DB_DUP 0x0002
#define DB_DUPSORT 0x0004
#define DB_FIXEDLEN 0x0008
#define DB_PAD 0x0010
#define DB_RECNUM 0x0020
#define DB_RENUMBER 0x0040
#define DB_SNAPSHOT 0x0080
u_int32_t flags;
};
#define DB_AFTER 1
#define DB_APPEND 2
#define DB_BEFORE 3
#define DB_CHECKPOINT 4
#define DB_CURLSN 5
#define DB_CURRENT 6
#define DB_FIRST 7
#define DB_FLUSH 8
#define DB_GET_BOTH 9
#define DB_GET_RECNO 10
#define DB_JOIN_ITEM 11
#define DB_KEYFIRST 12
#define DB_KEYLAST 13
#define DB_LAST 14
#define DB_NEXT 15
#define DB_NEXT_DUP 16
#define DB_NOOVERWRITE 17
#define DB_NOSYNC 18
#define DB_PREV 19
#define DB_RECORDCOUNT 20
#define DB_SET 21
#define DB_SET_RANGE 22
#define DB_SET_RECNO 23
#define DB_WRITELOCK 24
#define DB_OPFLAGS_MASK 0x1f
#define DB_RMW 0x80000000
#define DB_INCOMPLETE ( -1)
#define DB_KEYEMPTY ( -2)
#define DB_KEYEXIST ( -3)
#define DB_LOCK_DEADLOCK ( -4)
#define DB_LOCK_NOTGRANTED ( -5)
#define DB_LOCK_NOTHELD ( -6)
#define DB_NOTFOUND ( -7)
#define DB_RUNRECOVERY ( -8)
#define DB_DELETED ( -9)
#define DB_NEEDSPLIT (-10)
#define DB_SWAPBYTES (-11)
#define DB_TXN_CKP (-12)
#define DB_FILE_ID_LEN 20
struct __db {
void *mutexp;
DBTYPE type;
int byteswapped;
int saved_open_fd;
DB_ENV *dbenv;
DB_ENV *mp_dbenv;
void *internal;
DB_MPOOL *mp;
DB_MPOOLFILE *mpf;
struct {
struct __dbc *tqh_first;
struct __dbc **tqh_last;
} free_queue;
struct {
struct __dbc *tqh_first;
struct __dbc **tqh_last;
} active_queue;
u_int8_t fileid[DB_FILE_ID_LEN];
u_int32_t log_fileid;
size_t pgsize;
void *(*db_malloc) __P((size_t));
int (*dup_compare)
__P((const DBT *, const DBT *));
u_int32_t (*h_hash)
__P((const void *, u_int32_t));
int (*am_close) __P((DB *));
int (*close) __P((DB *, u_int32_t));
int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
int (*fd) __P((DB *, int *));
int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
int (*join) __P((DB *, DBC **, u_int32_t, DBC **));
int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
int (*stat) __P((DB *, void *, void *(*)(size_t), u_int32_t));
int (*sync) __P((DB *, u_int32_t));
#define DB_AM_CDB 0x000001
#define DB_AM_DUP 0x000002
#define DB_AM_INMEM 0x000004
#define DB_AM_LOCKING 0x000008
#define DB_AM_LOGGING 0x000010
#define DB_AM_MLOCAL 0x000020
#define DB_AM_PGDEF 0x000040
#define DB_AM_RDONLY 0x000080
#define DB_AM_SWAP 0x000100
#define DB_AM_THREAD 0x000200
#define DB_BT_RECNUM 0x000400
#define DB_DBM_ERROR 0x000800
#define DB_RE_DELIMITER 0x001000
#define DB_RE_FIXEDLEN 0x002000
#define DB_RE_PAD 0x004000
#define DB_RE_RENUMBER 0x008000
#define DB_RE_SNAPSHOT 0x010000
u_int32_t flags;
};
struct __db_ilock {
db_pgno_t pgno;
u_int8_t fileid[DB_FILE_ID_LEN];
};
struct __dbc {
DB *dbp;
DB_TXN *txn;
struct {
struct __dbc *tqe_next;
struct __dbc **tqe_prev;
} links;
u_int32_t lid;
u_int32_t locker;
DBT lock_dbt;
DB_LOCK_ILOCK lock;
DB_LOCK mylock;
DBT rkey;
DBT rdata;
int (*c_am_close) __P((DBC *));
int (*c_am_destroy) __P((DBC *));
int (*c_close) __P((DBC *));
int (*c_del) __P((DBC *, u_int32_t));
int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
void *internal;
#define DBC_CONTINUE 0x001
#define DBC_KEYSET 0x002
#define DBC_RECOVER 0x004
#define DBC_RMW 0x008
#define DBC_WRITER 0x010
u_int32_t flags;
};
struct __db_bt_stat {
u_int32_t bt_flags;
u_int32_t bt_maxkey;
u_int32_t bt_minkey;
u_int32_t bt_re_len;
u_int32_t bt_re_pad;
u_int32_t bt_pagesize;
u_int32_t bt_levels;
u_int32_t bt_nrecs;
u_int32_t bt_int_pg;
u_int32_t bt_leaf_pg;
u_int32_t bt_dup_pg;
u_int32_t bt_over_pg;
u_int32_t bt_free;
u_int32_t bt_int_pgfree;
u_int32_t bt_leaf_pgfree;
u_int32_t bt_dup_pgfree;
u_int32_t bt_over_pgfree;
u_int32_t bt_magic;
u_int32_t bt_version;
};
struct __db_h_stat {
u_int32_t hash_accesses;
u_int32_t hash_collisions;
u_int32_t hash_expansions;
u_int32_t hash_overflows;
u_int32_t hash_bigpages;
u_int32_t hash_dup;
u_int32_t hash_free;
u_int32_t hash_bfree;
u_int32_t hash_dup_free;
u_int32_t hash_big_bfree;
u_int32_t hash_buckets;
u_int32_t hash_put;
u_int32_t hash_deleted;
u_int32_t hash_get;
u_int32_t hash_magic;
u_int32_t hash_version;
u_int32_t hash_pagesize;
u_int32_t hash_nrecs;
};
#if defined(__cplusplus)
extern "C" {
#endif
int db_appinit __P((const char *, char * const *, DB_ENV *, u_int32_t));
int db_appexit __P((DB_ENV *));
int db_jump_set __P((void *, int));
int db_open __P((const char *,
DBTYPE, u_int32_t, int, DB_ENV *, DB_INFO *, DB **));
int db_value_set __P((int, int));
char *db_version __P((int *, int *, int *));
int db_xa_open __P((const char *,
DBTYPE, u_int32_t, int, DB_INFO *, DB **));
#if defined(__cplusplus)
}
#endif
#define DB_LOCKVERSION 1
#define DB_LOCKMAGIC 0x090193
#define DB_LOCK_NOWAIT 0x01
#define DB_LOCK_UPGRADE 0x02
#define DB_LOCK_CONFLICT 0x01
typedef enum {
DB_LOCK_DUMP=0,
DB_LOCK_GET,
DB_LOCK_INHERIT,
DB_LOCK_PUT,
DB_LOCK_PUT_ALL,
DB_LOCK_PUT_OBJ
} db_lockop_t;
typedef enum {
DB_LOCK_NG=0,
DB_LOCK_READ,
DB_LOCK_WRITE,
DB_LOCK_IWRITE,
DB_LOCK_IREAD,
DB_LOCK_IWR
} db_lockmode_t;
typedef enum {
DB_LSTAT_ABORTED,
DB_LSTAT_ERR,
DB_LSTAT_FREE,
DB_LSTAT_HELD,
DB_LSTAT_NOGRANT,
DB_LSTAT_PENDING,
DB_LSTAT_WAITING
} db_status_t;
struct __db_lockreq {
db_lockop_t op;
db_lockmode_t mode;
u_int32_t locker;
DBT *obj;
DB_LOCK lock;
};
#define DB_LOCK_RW_N 3
extern const u_int8_t db_rw_conflicts[];
#define DB_LOCK_RIW_N 6
extern const u_int8_t db_riw_conflicts[];
struct __db_lock_stat {
u_int32_t st_magic;
u_int32_t st_version;
u_int32_t st_maxlocks;
u_int32_t st_nmodes;
u_int32_t st_numobjs;
u_int32_t st_nlockers;
u_int32_t st_nconflicts;
u_int32_t st_nrequests;
u_int32_t st_nreleases;
u_int32_t st_ndeadlocks;
u_int32_t st_region_wait;
u_int32_t st_region_nowait;
u_int32_t st_refcnt;
u_int32_t st_regsize;
};
#if defined(__cplusplus)
extern "C" {
#endif
int lock_close __P((DB_LOCKTAB *));
int lock_detect __P((DB_LOCKTAB *, u_int32_t, u_int32_t));
int lock_get __P((DB_LOCKTAB *,
u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
int lock_id __P((DB_LOCKTAB *, u_int32_t *));
int lock_open __P((const char *,
u_int32_t, int, DB_ENV *, DB_LOCKTAB **));
int lock_put __P((DB_LOCKTAB *, DB_LOCK));
int lock_tget __P((DB_LOCKTAB *,
DB_TXN *, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
int lock_stat __P((DB_LOCKTAB *, DB_LOCK_STAT **, void *(*)(size_t)));
int lock_unlink __P((const char *, int, DB_ENV *));
int lock_vec __P((DB_LOCKTAB *,
u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
int lock_tvec __P((DB_LOCKTAB *,
DB_TXN *, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
#if defined(__cplusplus)
}
#endif
#define DB_ARCH_ABS 0x001
#define DB_ARCH_DATA 0x002
#define DB_ARCH_LOG 0x004
struct __db_lsn {
u_int32_t file;
u_int32_t offset;
};
struct __db_log_stat {
u_int32_t st_magic;
u_int32_t st_version;
int st_mode;
u_int32_t st_lg_max;
u_int32_t st_w_bytes;
u_int32_t st_w_mbytes;
u_int32_t st_wc_bytes;
u_int32_t st_wc_mbytes;
u_int32_t st_wcount;
u_int32_t st_scount;
u_int32_t st_region_wait;
u_int32_t st_region_nowait;
u_int32_t st_cur_file;
u_int32_t st_cur_offset;
u_int32_t st_refcnt;
u_int32_t st_regsize;
};
#if defined(__cplusplus)
extern "C" {
#endif
int log_archive __P((DB_LOG *, char **[], u_int32_t, void *(*)(size_t)));
int log_close __P((DB_LOG *));
int log_compare __P((const DB_LSN *, const DB_LSN *));
int log_file __P((DB_LOG *, const DB_LSN *, char *, size_t));
int log_flush __P((DB_LOG *, const DB_LSN *));
int log_get __P((DB_LOG *, DB_LSN *, DBT *, u_int32_t));
int log_open __P((const char *, u_int32_t, int, DB_ENV *, DB_LOG **));
int log_put __P((DB_LOG *, DB_LSN *, const DBT *, u_int32_t));
int log_register __P((DB_LOG *, DB *, const char *, DBTYPE, u_int32_t *));
int log_stat __P((DB_LOG *, DB_LOG_STAT **, void *(*)(size_t)));
int log_unlink __P((const char *, int, DB_ENV *));
int log_unregister __P((DB_LOG *, u_int32_t));
#if defined(__cplusplus)
}
#endif
#define DB_MPOOL_CREATE 0x001
#define DB_MPOOL_LAST 0x002
#define DB_MPOOL_NEW 0x004
#define DB_MPOOL_CLEAN 0x001
#define DB_MPOOL_DIRTY 0x002
#define DB_MPOOL_DISCARD 0x004
struct __db_mpool_stat {
size_t st_cachesize;
u_int32_t st_cache_hit;
u_int32_t st_cache_miss;
u_int32_t st_map;
u_int32_t st_page_create;
u_int32_t st_page_in;
u_int32_t st_page_out;
u_int32_t st_ro_evict;
u_int32_t st_rw_evict;
u_int32_t st_hash_buckets;
u_int32_t st_hash_searches;
u_int32_t st_hash_longest;
u_int32_t st_hash_examined;
u_int32_t st_page_clean;
u_int32_t st_page_dirty;
u_int32_t st_page_trickle;
u_int32_t st_region_wait;
u_int32_t st_region_nowait;
u_int32_t st_refcnt;
u_int32_t st_regsize;
};
struct __db_mpool_finfo {
int ftype;
DBT *pgcookie;
u_int8_t *fileid;
int32_t lsn_offset;
u_int32_t clear_len;
};
struct __db_mpool_fstat {
char *file_name;
size_t st_pagesize;
u_int32_t st_cache_hit;
u_int32_t st_cache_miss;
u_int32_t st_map;
u_int32_t st_page_create;
u_int32_t st_page_in;
u_int32_t st_page_out;
};
#if defined(__cplusplus)
extern "C" {
#endif
int memp_close __P((DB_MPOOL *));
int memp_fclose __P((DB_MPOOLFILE *));
int memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *));
int memp_fopen __P((DB_MPOOL *, const char *,
u_int32_t, int, size_t, DB_MPOOL_FINFO *, DB_MPOOLFILE **));
int memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t));
int memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t));
int memp_fsync __P((DB_MPOOLFILE *));
int memp_open __P((const char *, u_int32_t, int, DB_ENV *, DB_MPOOL **));
int memp_register __P((DB_MPOOL *, int,
int (*)(db_pgno_t, void *, DBT *),
int (*)(db_pgno_t, void *, DBT *)));
int memp_stat __P((DB_MPOOL *,
DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, void *(*)(size_t)));
int memp_sync __P((DB_MPOOL *, DB_LSN *));
int memp_trickle __P((DB_MPOOL *, int, int *));
int memp_unlink __P((const char *, int, DB_ENV *));
#if defined(__cplusplus)
}
#endif
#define DB_TXNVERSION 1
#define DB_TXNMAGIC 0x041593
#define DB_TXN_BACKWARD_ROLL 1
#define DB_TXN_FORWARD_ROLL 2
#define DB_TXN_OPENFILES 3
#define DB_TXN_REDO 4
#define DB_TXN_UNDO 5
struct __db_txn_active {
u_int32_t txnid;
DB_LSN lsn;
};
struct __db_txn_stat {
DB_LSN st_last_ckp;
DB_LSN st_pending_ckp;
time_t st_time_ckp;
u_int32_t st_last_txnid;
u_int32_t st_maxtxns;
u_int32_t st_naborts;
u_int32_t st_nbegins;
u_int32_t st_ncommits;
u_int32_t st_nactive;
DB_TXN_ACTIVE
*st_txnarray;
u_int32_t st_region_wait;
u_int32_t st_region_nowait;
u_int32_t st_refcnt;
u_int32_t st_regsize;
};
#if defined(__cplusplus)
extern "C" {
#endif
int txn_abort __P((DB_TXN *));
int txn_begin __P((DB_TXNMGR *, DB_TXN *, DB_TXN **));
int txn_checkpoint __P((const DB_TXNMGR *, u_int32_t, u_int32_t));
int txn_commit __P((DB_TXN *));
int txn_close __P((DB_TXNMGR *));
u_int32_t txn_id __P((DB_TXN *));
int txn_open __P((const char *, u_int32_t, int, DB_ENV *, DB_TXNMGR **));
int txn_prepare __P((DB_TXN *));
int txn_stat __P((DB_TXNMGR *, DB_TXN_STAT **, void *(*)(size_t)));
int txn_unlink __P((const char *, int, DB_ENV *));
#if defined(__cplusplus)
}
#endif
#ifndef DB_DBM_HSEARCH
#define DB_DBM_HSEARCH 0
#endif
#if DB_DBM_HSEARCH != 0
#define DBM_INSERT 0
#define DBM_REPLACE 1
#define DBM_SUFFIX ".db"
#if defined(_XPG4_2)
typedef struct {
char *dptr;
size_t dsize;
} datum;
#else
typedef struct {
char *dptr;
int dsize;
} datum;
#endif
#define dbminit(a) __db_dbm_init(a)
#define dbmclose __db_dbm_close
#if !defined(__cplusplus)
#define delete(a) __db_dbm_delete(a)
#endif
#define fetch(a) __db_dbm_fetch(a)
#define firstkey __db_dbm_firstkey
#define nextkey(a) __db_dbm_nextkey(a)
#define store(a, b) __db_dbm_store(a, b)
#if defined(__cplusplus)
extern "C" {
#endif
int __db_dbm_close __P((void));
int __db_dbm_dbrdonly __P((void));
int __db_dbm_delete __P((datum));
int __db_dbm_dirf __P((void));
datum __db_dbm_fetch __P((datum));
datum __db_dbm_firstkey __P((void));
int __db_dbm_init __P((char *));
datum __db_dbm_nextkey __P((datum));
int __db_dbm_pagf __P((void));
int __db_dbm_store __P((datum, datum));
#if defined(__cplusplus)
}
#endif
#define dbm_clearerr(a) __db_ndbm_clearerr(a)
#define dbm_close(a) __db_ndbm_close(a)
#define dbm_delete(a, b) __db_ndbm_delete(a, b)
#define dbm_dirfno(a) __db_ndbm_dirfno(a)
#define dbm_error(a) __db_ndbm_error(a)
#define dbm_fetch(a, b) __db_ndbm_fetch(a, b)
#define dbm_firstkey(a) __db_ndbm_firstkey(a)
#define dbm_nextkey(a) __db_ndbm_nextkey(a)
#define dbm_open(a, b, c) __db_ndbm_open(a, b, c)
#define dbm_pagfno(a) __db_ndbm_pagfno(a)
#define dbm_rdonly(a) __db_ndbm_rdonly(a)
#define dbm_store(a, b, c, d) __db_ndbm_store(a, b, c, d)
#if defined(__cplusplus)
extern "C" {
#endif
int __db_ndbm_clearerr __P((DBM *));
void __db_ndbm_close __P((DBM *));
int __db_ndbm_delete __P((DBM *, datum));
int __db_ndbm_dirfno __P((DBM *));
int __db_ndbm_error __P((DBM *));
datum __db_ndbm_fetch __P((DBM *, datum));
datum __db_ndbm_firstkey __P((DBM *));
datum __db_ndbm_nextkey __P((DBM *));
DBM *__db_ndbm_open __P((const char *, int, int));
int __db_ndbm_pagfno __P((DBM *));
int __db_ndbm_rdonly __P((DBM *));
int __db_ndbm_store __P((DBM *, datum, datum, int));
#if defined(__cplusplus)
}
#endif
typedef enum {
FIND, ENTER
} ACTION;
typedef struct entry {
char *key;
char *data;
} ENTRY;
#define hcreate(a) __db_hcreate(a)
#define hdestroy __db_hdestroy
#define hsearch(a, b) __db_hsearch(a, b)
#if defined(__cplusplus)
extern "C" {
#endif
int __db_hcreate __P((size_t));
void __db_hdestroy __P((void));
ENTRY *__db_hsearch __P((ENTRY, ACTION));
#if defined(__cplusplus)
}
#endif
#endif
#ifdef __MWERKS__
#pragma enumsalwaysint reset
#endif
#endif