1 /* OpenLDAP WiredTiger backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2002-2015 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
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>.
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.
31 #include "wiredtiger.h"
33 /* The default search IDL stack cache depth */
34 #define DEFAULT_SEARCH_STACK_DEPTH 16
37 WT_CONNECTION *wi_conn;
39 char *wi_dbenv_config;
42 slap_mask_t wi_defaultmask;
44 struct wt_attrinfo **wi_attrs;
45 void *wi_search_stack;
46 int wi_search_stack_depth;
48 struct re_s *wi_index_task;
51 #define WT_IS_OPEN 0x01
52 #define WT_OPEN_INDEX 0x02
53 #define WT_DEL_INDEX 0x08
54 #define WT_RE_OPEN 0x10
55 #define WT_NEED_UPGRADE 0x20
58 #define WT_TABLE_ID2ENTRY "table:id2entry"
59 #define WT_TABLE_DN2ID "table:dn2id"
61 #define WT_INDEX_DN "index:id2entry:dn"
62 #define WT_INDEX_PID "index:dn2id:pid"
63 #define WT_INDEX_REVDN "index:dn2id:revdn"
65 #define ITEMzero(item) (memset((item), 0, sizeof(WT_ITEM)))
66 #define ITEM2bv(item,bv) ((bv)->bv_val = (item)->data, \
67 (bv)->bv_len = (item)->size)
68 #define bv2ITEM(bv,item) ((item)->data = (bv)->bv_val, \
69 (item)->size = (bv)->bv_len )
75 /* for the cache of attribute information (which are indexed, etc.) */
76 typedef struct wt_attrinfo {
77 AttributeDescription *ai_desc; /* attribute description cn;lang-en */
78 slap_mask_t ai_indexmask; /* how the attr is indexed */
79 slap_mask_t ai_newmask; /* new settings to replace old mask */
80 #ifdef LDAP_COMP_MATCH
81 ComponentReference* ai_cr; /*component indexing*/
85 /* These flags must not clash with SLAP_INDEX flags or ops in slap.h! */
86 #define WT_INDEX_DELETING 0x8000U /* index is being modified */
87 #define WT_INDEX_UPDATE_OP 0x03 /* performing an index update */
91 #endif /* _BACK_WT_H_ */