1 /* back-bdb.h - ldap ldbm back-end header file */
4 * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
18 #define BDB_IDL_DB_SIZE (1<<16) /* 64K IDL on disk */
19 #define BDB_IDL_DB_MAX (BDB_IDL_DB_SIZE-32)
20 /* #define BDB_IDL_DB_ALLOC (BDB_IDL_DB_SIZE * sizeof(ID)) */
22 #define BDB_IDL_SIZE (1<<17) /* 128K IDL in memory */
23 #define BDB_IDL_MAX (BDB_IDL_DB_SIZE-32)
24 /* #define BDB_IDL_DB_ALLOC (BDB_IDL_DB_SIZE * sizeof(ID)) */
26 #define BDB_IS_ALLIDS(ids) ((ids)[0] == NOID)
28 #define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX
29 #define DN_ONE_PREFIX '%'
30 #define DN_SUBTREE_PREFIX '@'
32 #define DBTzero(t) (memset((t), 0, sizeof(DBT)))
33 #define DBT2bv(t,bv) ((bv)->bv_val = (t)->data, \
34 (bv)->bv_len = (t)->size)
35 #define bv2DBT(bv,t) ((t)->data = (bv)->bv_val, \
36 (t)->size = (bv)->bv_len )
38 #define DEFAULT_MODE 0600
40 #define BDB_TXN_RETRIES 16
42 #define BDB_DBENV_HOME LDAP_RUNDIR LDAP_DIRSEP "openldap-bdb"
44 #define BDB_TMP_SUBDIR LDAP_DIRSEP "tmp"
45 #define BDB_LG_SUBDIR LDAP_DIRSEP "log"
46 #define BDB_DATA_SUBDIR LDAP_DIRSEP "data"
50 #define BDB_ID2ENTRY 2
60 /* DB_ENV parameters */
61 /* The DB_ENV can be tuned via DB_CONFIG */
63 u_int32_t bi_dbenv_xflags; /* extra flags */
67 struct bdb_db_info **bi_databases;
69 #define bi_nextid bi_databases[BDB_NEXTID]
70 #define bi_id2entry bi_databases[BDB_ID2ENTRY]
71 #define bi_dn2id bi_databases[BDB_DN2ID]
75 #include "proto-bdb.h"
77 #endif /* _BACK_BDB_H_ */