]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
780b275b875ff656bb5bdcb4dc995e75ad11b41b
[openldap] / servers / slapd / back-bdb / proto-bdb.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #ifndef _PROTO_BDB_H
8 #define _PROTO_BDB_H
9
10 LDAP_BEGIN_DECL
11
12 /*
13  * alias.c
14  */
15 Entry *bdb_deref_internal_r LDAP_P((
16         Backend *be,
17         Entry *e,
18         const char *dn,
19         int *err,
20         Entry **matched,
21         const char **text ));
22
23 #define deref_entry_r( be, e, err, matched, text ) \
24         bdb_deref_internal_r( be, e, NULL, err, matched, text )
25 #define deref_dn_r( be, dn, err, matched, text ) \
26         bdb_deref_internal_r( be, NULL, dn, err, matched, text)
27
28 /*
29  * dn2id.c
30  */
31 int bdb_dn2id_add(
32         BackendDB *be,
33         DB_TXN *tid,
34         const char *dn,
35         ID id );
36
37 int bdb_dn2id_delete(
38         BackendDB *be,
39         DB_TXN *tid,
40         const char *dn,
41         ID id );
42
43 int bdb_dn2id_children(
44         BackendDB *be,
45         DB_TXN *tid,
46         const char *dn );
47
48 int bdb_dn2entry_rw LDAP_P(( Backend *be, DB_TXN *tid,
49         const char *dn, Entry **e, Entry **matched, int rw ));
50
51 #define dn2entry_r(be, tid, dn, p, m) bdb_dn2entry_rw((be), (tid), (dn), (p), (m), 0)
52 #define dn2entry_w(be, tid, dn, p, m) bdb_dn2entry_rw((be), (tid), (dn), (p), (m), 1)
53
54 /*
55  * entry.c
56  */
57 int bdb_entry_return( BackendDB *be, Entry *e );
58
59 /*
60  * error.c
61  */
62 void bdb_errcall( const char *pfx, char * msg );
63
64 /*
65  * id2entry
66  */
67 int bdb_id2entry_add(
68         Backend *be,
69         DB_TXN *tid,
70         Entry *e );
71
72 int bdb_id2entry_delete(
73         Backend *be,
74         DB_TXN *tid,
75         ID id );
76
77 /*
78  * idl.c
79  */
80 int bdb_idl_insert_key(
81         BackendDB *be,
82         DB *db,
83         DB_TXN *txn,
84         DBT *key,
85         ID id );
86
87 int bdb_idl_delete_key(
88         BackendDB *be,
89         DB *db,
90         DB_TXN *txn,
91         DBT *key,
92         ID id );
93
94 /*
95  * nextid.c
96  */
97 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
98
99 /*
100  * tools.c
101  */
102 int bdb_tool_entry_open( BackendDB *be, int mode );
103 int bdb_tool_entry_close( BackendDB *be );
104 ID bdb_tool_entry_next( BackendDB *be );
105 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
106 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
107
108
109 LDAP_END_DECL
110
111 #endif /* _PROTO_BDB_H */