]> git.sur5r.net Git - openldap/blob - servers/slapd/back-wt/proto-wt.h
Happy New Year
[openldap] / servers / slapd / back-wt / proto-wt.h
1 /* OpenLDAP WiredTiger backend */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2002-2018 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 <hamano@osstech.co.jp>
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 AttrInfo *wt_attr_mask( struct wt_info *wi, AttributeDescription *desc );
30 void wt_attr_flush( struct wt_info *wi );
31
32 /*
33  * id2entry.c
34  */
35 int wt_id2entry_add(Operation *op, WT_SESSION *session, Entry *e );
36 int wt_id2entry_update(Operation *op, WT_SESSION *session, Entry *e );
37 int wt_id2entry_delete(Operation *op, WT_SESSION *session, Entry *e );
38
39 BI_entry_release_rw wt_entry_release;
40 BI_entry_get_rw wt_entry_get;
41
42 int wt_entry_return(Entry *e);
43 int wt_entry_release(Operation *op, Entry *e, int rw);
44
45 /*
46  * idl.c
47  */
48
49 unsigned wt_idl_search( ID *ids, ID id );
50
51 ID wt_idl_first( ID *ids, ID *cursor );
52 ID wt_idl_next( ID *ids, ID *cursor );
53
54
55 /*
56  * index.c
57  */
58 int wt_index_entry LDAP_P(( Operation *op, wt_ctx *wc, int r, Entry *e ));
59
60 #define wt_index_entry_add(op,t,e) \
61         wt_index_entry((op),(t),SLAP_INDEX_ADD_OP,(e))
62 #define wt_index_entry_del(op,t,e) \
63         wt_index_entry((op),(t),SLAP_INDEX_DELETE_OP,(e))
64
65 /*
66  * key.c
67  */
68 int
69 wt_key_read( Backend *be,
70                          WT_CURSOR *cursor,
71                          struct berval *k,
72                          ID *ids,
73                          WT_CURSOR **saved_cursor,
74                          int get_flag);
75
76 int
77 wt_key_change( Backend *be,
78                            WT_CURSOR *cursor,
79                            struct berval *k,
80                            ID id,
81                            int op);
82
83 /*
84  * nextid.c
85  */
86 int wt_next_id(BackendDB *be, ID *out);
87 int wt_last_id( BackendDB *be, WT_SESSION *session, ID *out );
88
89 /*
90  * modify.c
91  */
92 int wt_modify_internal(
93         Operation *op,
94         wt_ctx *wc,
95         Modifications *modlist,
96         Entry *e,
97         const char **text,
98         char *textbuf,
99         size_t textlen );
100
101 /*
102  * config.c
103  */
104 int wt_back_init_cf( BackendInfo *bi );
105
106 /*
107  * dn2id.c
108  */
109
110 int
111 wt_dn2id(
112         Operation *op,
113         WT_SESSION *session,
114     struct berval *ndn,
115     ID *id);
116
117 int
118 wt_dn2id_add(
119         Operation *op,
120         WT_SESSION *session,
121         ID pid,
122         Entry *e);
123
124 int
125 wt_dn2id_delete(
126         Operation *op,
127         WT_SESSION *session,
128         struct berval *ndn);
129
130 /*
131  * dn2entry.c
132  */
133 int wt_dn2entry( BackendDB *be,
134                                  wt_ctx *wc,
135                                  struct berval *ndn,
136                                  Entry **ep );
137
138 int wt_dn2pentry( BackendDB *be,
139                                   wt_ctx *wc,
140                                   struct berval *ndn,
141                                   Entry **ep );
142
143 /*
144  * former ctx.c
145  */
146 wt_ctx *wt_ctx_init(struct wt_info *wi);
147 void wt_ctx_free(void *key, void *data);
148 wt_ctx *wt_ctx_get(Operation *op, struct wt_info *wi);
149 WT_CURSOR *wt_ctx_index_cursor(wt_ctx *wc, struct berval *name, int create);
150
151
152 /*
153  * former external.h
154  */
155
156 extern BI_init              wt_back_initialize;
157 extern BI_db_config         wt_db_config;
158 extern BI_op_add            wt_add;
159 extern BI_op_bind           wt_bind;
160 extern BI_op_compare        wt_compare;
161 extern BI_op_delete         wt_delete;
162 extern BI_op_delete         wt_modify;
163
164 extern BI_op_search         wt_search;
165
166 extern BI_operational       wt_operational;
167
168 /* tools.c */
169 extern BI_tool_entry_open    wt_tool_entry_open;
170 extern BI_tool_entry_close   wt_tool_entry_close;
171 extern BI_tool_entry_first_x wt_tool_entry_first_x;
172 extern BI_tool_entry_next    wt_tool_entry_next;
173 extern BI_tool_entry_get     wt_tool_entry_get;
174 extern BI_tool_entry_put     wt_tool_entry_put;
175 extern BI_tool_entry_reindex wt_tool_entry_reindex;
176 extern BI_tool_dn2id_get     wt_tool_dn2id_get;
177 extern BI_tool_entry_modify  wt_tool_entry_modify;
178
179 LDAP_END_DECL
180
181 #endif /* _PROTO_WT_H */
182
183 /*
184  * Local variables:
185  * indent-tabs-mode: t
186  * tab-width: 4
187  * c-basic-offset: 4
188  * End:
189  */
190