Debian Codegraph @

servers/slapd/back-wt/proto-wt.h

raw
1 /* OpenLDAP WiredTiger backend */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 *
5 * Copyright 2002-2024 The OpenLDAP Foundation.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
11 *
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
15 */
16 /* ACKNOWLEDGEMENTS:
17 * This work was developed by HAMANO Tsukasa <[email protected]>
18 * based on back-bdb for inclusion in OpenLDAP Software.
19 * WiredTiger is a product of MongoDB Inc.
20 */
21
22 #ifndef _PROTO_WT_H_
23 #define _PROTO_WT_H_
24
25 LDAP_BEGIN_DECL
26
27 #define WT_UCTYPE "WT"
28
29 /*
30 * attr.c
31 */
32
33 AttrInfo *wt_attr_mask( struct wt_info *wi, AttributeDescription *desc );
34 void wt_attr_flush( struct wt_info *wi );
35 void wt_attr_index_unparse( struct wt_info *wi, BerVarray *bva );
36 int wt_attr_index_config(
37 struct wt_info *wi,
38 const char *fname,
39 int lineno,
40 int argc,
41 char **argv,
42 struct config_reply_s *c_reply);
43 void wt_attr_index_destroy( struct wt_info *wi );
44
45 /*
46 * id2entry.c
47 */
48 int wt_id2entry(BackendDB *be, wt_ctx *wc, ID id, Entry **ep );
49 int wt_id2entry_add(Operation *op, wt_ctx *wc, Entry *e );
50 int wt_id2entry_update(Operation *op, wt_ctx *wc, Entry *e );
51 int wt_id2entry_delete(Operation *op, wt_ctx *wc, Entry *e );
52
53 BI_entry_release_rw wt_entry_release;
54 BI_entry_get_rw wt_entry_get;
55
56 int wt_entry_return(Entry *e);
57 int wt_entry_release(Operation *op, Entry *e, int rw);
58
59 /*
60 * idl.c
61 */
62
63 unsigned wt_idl_search( ID *ids, ID id );
64
65 ID wt_idl_first( ID *ids, ID *cursor );
66 ID wt_idl_next( ID *ids, ID *cursor );
67 int wt_idl_append_one( ID *ids, ID id );
68 void wt_idl_sort( ID *ids, ID *tmp );
69 int wt_idl_intersection( ID *a, ID *b );
70 int wt_filter_candidates(
71 Operation *op,
72 wt_ctx *wc,
73 Filter *f,
74 ID *ids,
75 ID *tmp,
76 ID *stack );
77 int
78 wt_idl_union(
79 ID *a,
80 ID *b );
81
82 /*
83 * index.c
84 */
85
86 extern AttrInfo *
87 wt_index_mask LDAP_P((
88 Backend *be,
89 AttributeDescription *desc,
90 struct berval *atname ));
91
92 int wt_index_entry LDAP_P(( Operation *op, wt_ctx *wc, int r, Entry *e ));
93 int wt_index_values(
94 Operation *op,
95 wt_ctx *wc,
96 AttributeDescription *desc,
97 BerVarray vals,
98 ID id,
99 int opid );
100 int wt_index_param(
101 Backend *be,
102 AttributeDescription *desc,
103 int ftype,
104 slap_mask_t *maskp,
105 struct berval *prefixp );
106
107 WT_CURSOR *wt_index_open(wt_ctx *wc, struct berval *name, int create);
108
109 #define wt_index_entry_add(op,t,e) \
110 wt_index_entry((op),(t),SLAP_INDEX_ADD_OP,(e))
111 #define wt_index_entry_del(op,t,e) \
112 wt_index_entry((op),(t),SLAP_INDEX_DELETE_OP,(e))
113
114 /*
115 * key.c
116 */
117 int
118 wt_key_read( Backend *be,
119 WT_CURSOR *cursor,
120 struct berval *k,
121 ID *ids,
122 WT_CURSOR **saved_cursor,
123 int get_flag);
124
125 int
126 wt_key_change( Backend *be,
127 WT_CURSOR *cursor,
128 struct berval *k,
129 ID id,
130 int op);
131
132 /*
133 * nextid.c
134 */
135 int wt_next_id(BackendDB *be, ID *out);
136 int wt_last_id( BackendDB *be, WT_SESSION *session, ID *out );
137
138 /*
139 * modify.c
140 */
141 int wt_modify_internal(
142 Operation *op,
143 wt_ctx *wc,
144 Modifications *modlist,
145 Entry *e,
146 const char **text,
147 char *textbuf,
148 size_t textlen );
149
150 /*
151 * config.c
152 */
153 int wt_back_init_cf( BackendInfo *bi );
154
155 /*
156 * dn2id.c
157 */
158
159 int
160 wt_dn2id(
161 Operation *op,
162 wt_ctx *wc,
163 struct berval *ndn,
164 ID *id);
165
166 int
167 wt_dn2id_add(
168 Operation *op,
169 wt_ctx *wc,
170 ID pid,
171 Entry *e);
172
173 int
174 wt_dn2idl(
175 Operation *op,
176 wt_ctx *wc,
177 struct berval *ndn,
178 Entry *e,
179 ID *ids,
180 ID *stack);
181
182 int
183 wt_dn2id_delete(
184 Operation *op,
185 wt_ctx *wc,
186 struct berval *ndn);
187
188 int
189 wt_dn2id_has_children(
190 Operation *op,
191 wt_ctx *wc,
192 ID id );
193
194 /*
195 * dn2entry.c
196 */
197 int wt_dn2entry( BackendDB *be,
198 wt_ctx *wc,
199 struct berval *ndn,
200 Entry **ep );
201
202 int wt_dn2pentry( BackendDB *be,
203 wt_ctx *wc,
204 struct berval *ndn,
205 Entry **ep );
206 int wt_dn2aentry( BackendDB *be,
207 wt_ctx *wc,
208 struct berval *ndn,
209 Entry **ep );
210
211 /*
212 * former ctx.c
213 */
214 wt_ctx *wt_ctx_init(struct wt_info *wi);
215 void wt_ctx_free(void *key, void *data);
216 wt_ctx *wt_ctx_get(Operation *op, struct wt_info *wi);
217
218 /*
219 * former cache.c
220 */
221 int wt_idlcache_get(wt_ctx *wc, struct berval *ndn, int scope, ID *ids);
222 int wt_idlcache_set(wt_ctx *wc, struct berval *ndn, int scope, ID *ids);
223 int wt_idlcache_begin(wt_ctx *wc, struct berval *ndn, int scope);
224 int wt_idlcache_clear(Operation *op, wt_ctx *wc, struct berval *ndn);
225
226 /*
227 * former external.h
228 */
229
230 extern BI_init wt_back_initialize;
231 extern BI_db_config wt_db_config;
232 extern BI_op_add wt_add;
233 extern BI_op_bind wt_bind;
234 extern BI_op_compare wt_compare;
235 extern BI_op_delete wt_delete;
236 extern BI_op_modify wt_modify;
237 extern BI_op_modrdn wt_modrdn;
238 extern BI_op_search wt_search;
239 extern BI_op_extended wt_extended;
240
241 extern BI_operational wt_operational;
242 extern BI_has_subordinates wt_hasSubordinates;
243
244 /* tools.c */
245 int wt_entry_header(WT_ITEM *item, EntryHeader *eh);
246 extern BI_tool_entry_open wt_tool_entry_open;
247 extern BI_tool_entry_close wt_tool_entry_close;
248 extern BI_tool_entry_first_x wt_tool_entry_first_x;
249 extern BI_tool_entry_next wt_tool_entry_next;
250 extern BI_tool_entry_get wt_tool_entry_get;
251 extern BI_tool_entry_put wt_tool_entry_put;
252 extern BI_tool_entry_reindex wt_tool_entry_reindex;
253 extern BI_tool_dn2id_get wt_tool_dn2id_get;
254 extern BI_tool_entry_modify wt_tool_entry_modify;
255 extern BI_tool_entry_delete wt_tool_entry_delete;
256
257 LDAP_END_DECL
258
259 #endif /* _PROTO_WT_H */
260
261 /*
262 * Local variables:
263 * indent-tabs-mode: t
264 * tab-width: 4
265 * c-basic-offset: 4
266 * End:
267 */
268