mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-02 03:49:34 -05:00
Add bdb_bind, clean up init, s/Backend/BackendDB/
This commit is contained in:
parent
6a74325e5d
commit
c182511f91
13 changed files with 44 additions and 41 deletions
|
|
@ -1,10 +1,10 @@
|
|||
# $OpenLDAP$
|
||||
|
||||
SRCS = init.c tools.c config.c \
|
||||
add.c compare.c delete.c search.c \
|
||||
add.c bind.c compare.c delete.c search.c \
|
||||
dn2entry.lo dn2id.c error.c id2entry.c idl.c nextid.c
|
||||
OBJS = init.lo tools.lo config.lo \
|
||||
add.lo compare.lo delete.lo search.lo \
|
||||
add.lo bind.lo compare.lo delete.lo search.lo \
|
||||
dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo nextid.lo
|
||||
|
||||
LDAP_INCDIR= ../../../include
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
int
|
||||
bdb_add(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
Entry *e )
|
||||
|
|
|
|||
|
|
@ -45,12 +45,9 @@ LDAP_BEGIN_DECL
|
|||
#define BDB_TMP_SUBDIR LDAP_DIRSEP "tmp"
|
||||
#define BDB_LG_SUBDIR LDAP_DIRSEP "log"
|
||||
#define BDB_DATA_SUBDIR LDAP_DIRSEP "data"
|
||||
#else
|
||||
#define BDB_TMP_SUBDIR BDB_DBENV_HOME
|
||||
#define BDB_LG_SUBDIR BDB_DBENV_HOME
|
||||
#define BDB_DATA_SUBDIR BDB_DBENV_HOME
|
||||
#endif
|
||||
|
||||
#define BDB_SUFFIX ".bdb"
|
||||
#define BDB_NEXTID 0
|
||||
#define BDB_DN2ID 1
|
||||
#define BDB_ID2ENTRY 2
|
||||
|
|
|
|||
|
|
@ -135,6 +135,10 @@ SOURCE=".\back-bdb.h"
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bind.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\compare.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
int
|
||||
bdb_compare(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
const char *dn,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
int
|
||||
bdb_db_config(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
const char *fname,
|
||||
int lineno,
|
||||
int argc,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
int
|
||||
bdb_delete(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
const char *dn,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
int
|
||||
bdb_dn2entry(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
const char *dn,
|
||||
Entry **e,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
int
|
||||
bdb_dn2id_add(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *dn,
|
||||
ID id
|
||||
|
|
@ -92,7 +92,7 @@ done:
|
|||
|
||||
int
|
||||
bdb_dn2id_delete(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *dn,
|
||||
ID id )
|
||||
|
|
@ -164,7 +164,7 @@ done:
|
|||
|
||||
int
|
||||
bdb_dn2id(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *dn,
|
||||
ID *id )
|
||||
|
|
@ -200,7 +200,7 @@ bdb_dn2id(
|
|||
|
||||
int
|
||||
bdb_dn2id_matched(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *in,
|
||||
ID *id,
|
||||
|
|
@ -269,7 +269,7 @@ bdb_dn2id_matched(
|
|||
|
||||
int
|
||||
bdb_dn2id_children(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *dn )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "back-bdb.h"
|
||||
|
||||
int bdb_id2entry_add(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
Entry *e )
|
||||
{
|
||||
|
|
@ -42,7 +42,7 @@ int bdb_id2entry_add(
|
|||
}
|
||||
|
||||
int bdb_id2entry(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
ID id,
|
||||
Entry **e )
|
||||
|
|
@ -78,7 +78,7 @@ int bdb_id2entry(
|
|||
}
|
||||
|
||||
int bdb_id2entry_delete(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
ID id )
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ int bdb_id2entry_delete(
|
|||
}
|
||||
|
||||
int bdb_entry_return(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e )
|
||||
{
|
||||
entry_free( e );
|
||||
|
|
|
|||
|
|
@ -19,11 +19,12 @@ static struct bdbi_database {
|
|||
int type;
|
||||
int flags;
|
||||
} bdbi_databases[BDB_INDICES] = {
|
||||
{ "nextid", "nextid", DB_BTREE, 0 },
|
||||
{ "dn2entry", "dn2entry", DB_BTREE, 0 },
|
||||
{ "id2entry", "id2entry", DB_BTREE, 0 },
|
||||
{ "nextid" BDB_SUFFIX, "nextid", DB_BTREE, 0 },
|
||||
{ "dn2entry" BDB_SUFFIX, "dn2entry", DB_BTREE, 0 },
|
||||
{ "id2entry" BDB_SUFFIX, "id2entry", DB_BTREE, 0 },
|
||||
};
|
||||
|
||||
#if 0
|
||||
static int
|
||||
bdb_destroy( BackendInfo *bi )
|
||||
{
|
||||
|
|
@ -46,9 +47,10 @@ bdb_close( BackendInfo *bi )
|
|||
/* terminate the underlying database system */
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
bdb_db_init( Backend *be )
|
||||
bdb_db_init( BackendDB *be )
|
||||
{
|
||||
struct bdb_info *bdb;
|
||||
|
||||
|
|
@ -75,8 +77,8 @@ bdb_db_open( BackendDB *be )
|
|||
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
|
||||
u_int32_t flags;
|
||||
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"bdb_db_open: opening database for %s\n",
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"bdb_db_open: %s\n",
|
||||
be->be_suffix[0], 0, 0 );
|
||||
|
||||
/* we should check existance of dbenv_home and db_directory */
|
||||
|
|
@ -278,15 +280,15 @@ bdb_initialize(
|
|||
db_env_set_func_malloc( ch_malloc );
|
||||
db_env_set_func_realloc( ch_realloc );
|
||||
db_env_set_func_free( ch_free );
|
||||
db_env_set_func_yield( ldap_pvt_thread_yield );
|
||||
#endif
|
||||
db_env_set_func_yield( ldap_pvt_thread_yield );
|
||||
|
||||
bi->bi_controls = controls;
|
||||
|
||||
bi->bi_open = bdb_open;
|
||||
bi->bi_close = bdb_close;
|
||||
bi->bi_open = 0;
|
||||
bi->bi_close = 0;
|
||||
bi->bi_config = 0;
|
||||
bi->bi_destroy = bdb_destroy;
|
||||
bi->bi_destroy = 0;
|
||||
|
||||
bi->bi_db_init = bdb_db_init;
|
||||
bi->bi_db_config = bdb_db_config;
|
||||
|
|
@ -295,12 +297,12 @@ bdb_initialize(
|
|||
bi->bi_db_destroy = bdb_db_destroy;
|
||||
|
||||
bi->bi_op_add = bdb_add;
|
||||
bi->bi_op_bind = bdb_bind;
|
||||
bi->bi_op_compare = bdb_compare;
|
||||
bi->bi_op_delete = bdb_delete;
|
||||
bi->bi_op_search = bdb_search;
|
||||
|
||||
#if 0
|
||||
bi->bi_op_bind = bdb_bind;
|
||||
bi->bi_op_unbind = bdb_unbind;
|
||||
bi->bi_op_modify = bdb_modify;
|
||||
bi->bi_op_modrdn = bdb_modrdn;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ LDAP_BEGIN_DECL
|
|||
* alias.c
|
||||
*/
|
||||
Entry *bdb_deref_internal_r LDAP_P((
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e,
|
||||
const char *dn,
|
||||
int *err,
|
||||
|
|
@ -28,7 +28,7 @@ Entry *bdb_deref_internal_r LDAP_P((
|
|||
/*
|
||||
* dn2entry.c
|
||||
*/
|
||||
int bdb_dn2entry LDAP_P(( Backend *be, DB_TXN *tid,
|
||||
int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
|
||||
const char *dn, Entry **e, Entry **matched, int flags ));
|
||||
|
||||
#define dn2entry_r(be, tid, dn, p, m) \
|
||||
|
|
@ -84,17 +84,17 @@ void bdb_errcall( const char *pfx, char * msg );
|
|||
* id2entry
|
||||
*/
|
||||
int bdb_id2entry_add(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
Entry *e );
|
||||
|
||||
int bdb_id2entry_delete(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
ID id );
|
||||
|
||||
int bdb_id2entry(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
DB_TXN *tid,
|
||||
ID id,
|
||||
Entry **e );
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
#include "back-bdb.h"
|
||||
|
||||
static int base_candidate(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e,
|
||||
ID *ids );
|
||||
static int search_candidates(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e,
|
||||
Filter *filter,
|
||||
int scope,
|
||||
|
|
@ -30,7 +30,7 @@ static ID idl_next( ID *ids, ID *cursor );
|
|||
|
||||
int
|
||||
bdb_search(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
const char *base,
|
||||
|
|
@ -353,7 +353,7 @@ done:
|
|||
|
||||
|
||||
static int base_candidate(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e,
|
||||
ID *ids )
|
||||
{
|
||||
|
|
@ -366,7 +366,7 @@ static int base_candidate(
|
|||
}
|
||||
|
||||
static int search_candidates(
|
||||
Backend *be,
|
||||
BackendDB *be,
|
||||
Entry *e,
|
||||
Filter *filter,
|
||||
int scope,
|
||||
|
|
|
|||
Loading…
Reference in a new issue