back-wt.h revision 1.1 1 1.1 christos /* $NetBSD: back-wt.h,v 1.1 2021/08/14 16:05:24 christos Exp $ */
2 1.1 christos
3 1.1 christos /* OpenLDAP WiredTiger backend */
4 1.1 christos /* $OpenLDAP$ */
5 1.1 christos /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 1.1 christos *
7 1.1 christos * Copyright 2002-2021 The OpenLDAP Foundation.
8 1.1 christos * All rights reserved.
9 1.1 christos *
10 1.1 christos * Redistribution and use in source and binary forms, with or without
11 1.1 christos * modification, are permitted only as authorized by the OpenLDAP
12 1.1 christos * Public License.
13 1.1 christos *
14 1.1 christos * A copy of this license is available in the file LICENSE in the
15 1.1 christos * top-level directory of the distribution or, alternatively, at
16 1.1 christos * <http://www.OpenLDAP.org/license.html>.
17 1.1 christos */
18 1.1 christos /* ACKNOWLEDGEMENTS:
19 1.1 christos * This work was developed by HAMANO Tsukasa <hamano (at) osstech.co.jp>
20 1.1 christos * based on back-bdb for inclusion in OpenLDAP Software.
21 1.1 christos * WiredTiger is a product of MongoDB Inc.
22 1.1 christos */
23 1.1 christos
24 1.1 christos #ifndef _BACK_WT_H_
25 1.1 christos #define _BACK_WT_H_
26 1.1 christos
27 1.1 christos #include <portable.h>
28 1.1 christos
29 1.1 christos #include <ac/errno.h>
30 1.1 christos #include <sys/stat.h>
31 1.1 christos
32 1.1 christos #include "slap.h"
33 1.1 christos #include "wiredtiger.h"
34 1.1 christos
35 1.1 christos /* The default search IDL stack cache depth */
36 1.1 christos #define DEFAULT_SEARCH_STACK_DEPTH 16
37 1.1 christos
38 1.1 christos struct wt_info {
39 1.1 christos WT_CONNECTION *wi_conn;
40 1.1 christos char *wi_dbenv_home;
41 1.1 christos char *wi_dbenv_config;
42 1.1 christos ID wi_lastid;
43 1.1 christos
44 1.1 christos slap_mask_t wi_defaultmask;
45 1.1 christos int wi_nattrs;
46 1.1 christos struct wt_attrinfo **wi_attrs;
47 1.1 christos void *wi_search_stack;
48 1.1 christos int wi_search_stack_depth;
49 1.1 christos
50 1.1 christos struct re_s *wi_index_task;
51 1.1 christos
52 1.1 christos int wi_flags;
53 1.1 christos #define WT_IS_OPEN 0x01
54 1.1 christos #define WT_OPEN_INDEX 0x02
55 1.1 christos #define WT_DEL_INDEX 0x08
56 1.1 christos #define WT_RE_OPEN 0x10
57 1.1 christos #define WT_NEED_UPGRADE 0x20
58 1.1 christos };
59 1.1 christos
60 1.1 christos #define WT_TABLE_ID2ENTRY "table:id2entry"
61 1.1 christos #define WT_TABLE_DN2ID "table:dn2id"
62 1.1 christos
63 1.1 christos #define WT_INDEX_DN "index:id2entry:dn"
64 1.1 christos #define WT_INDEX_PID "index:dn2id:pid"
65 1.1 christos #define WT_INDEX_REVDN "index:dn2id:revdn"
66 1.1 christos
67 1.1 christos #define ITEMzero(item) (memset((item), 0, sizeof(WT_ITEM)))
68 1.1 christos #define ITEM2bv(item,bv) ((bv)->bv_val = (item)->data, \
69 1.1 christos (bv)->bv_len = (item)->size)
70 1.1 christos #define bv2ITEM(bv,item) ((item)->data = (bv)->bv_val, \
71 1.1 christos (item)->size = (bv)->bv_len )
72 1.1 christos
73 1.1 christos typedef struct {
74 1.1 christos WT_SESSION *session;
75 1.1 christos } wt_ctx;
76 1.1 christos
77 1.1 christos /* for the cache of attribute information (which are indexed, etc.) */
78 1.1 christos typedef struct wt_attrinfo {
79 1.1 christos AttributeDescription *ai_desc; /* attribute description cn;lang-en */
80 1.1 christos slap_mask_t ai_indexmask; /* how the attr is indexed */
81 1.1 christos slap_mask_t ai_newmask; /* new settings to replace old mask */
82 1.1 christos #ifdef LDAP_COMP_MATCH
83 1.1 christos ComponentReference* ai_cr; /*component indexing*/
84 1.1 christos #endif
85 1.1 christos } AttrInfo;
86 1.1 christos
87 1.1 christos /* These flags must not clash with SLAP_INDEX flags or ops in slap.h! */
88 1.1 christos #define WT_INDEX_DELETING 0x8000U /* index is being modified */
89 1.1 christos #define WT_INDEX_UPDATE_OP 0x03 /* performing an index update */
90 1.1 christos
91 1.1 christos #include "proto-wt.h"
92 1.1 christos
93 1.1 christos #endif /* _BACK_WT_H_ */
94 1.1 christos
95 1.1 christos /*
96 1.1 christos * Local variables:
97 1.1 christos * indent-tabs-mode: t
98 1.1 christos * tab-width: 4
99 1.1 christos * c-basic-offset: 4
100 1.1 christos * End:
101 1.1 christos */
102