+/* The default search IDL stack cache depth */
+#define DEFAULT_SEARCH_STACK_DEPTH 16
+
+/* The minimum we can function with */
+#define MINIMUM_SEARCH_STACK_DEPTH 8
+
+/* for the IDL cache */
+#define SLAP_IDL_CACHE 1
+
+#ifdef SLAP_IDL_CACHE
+typedef struct bdb_idl_cache_entry_s {
+ struct berval kstr;
+ ldap_pvt_thread_rdwr_t idl_entry_rwlock;
+ ID *idl;
+ DB *db;
+ struct bdb_idl_cache_entry_s* idl_lru_prev;
+ struct bdb_idl_cache_entry_s* idl_lru_next;
+} bdb_idl_cache_entry_t;
+#endif
+
+/* BDB backend specific entry info */
+typedef struct bdb_entry_info {
+ struct bdb_entry_info *bei_parent;
+ ID bei_id;
+
+ int bei_state;
+#define CACHE_ENTRY_DELETED 1
+#define CACHE_ENTRY_NO_KIDS 2
+
+ /*
+ * remaining fields require backend cache lock to access
+ */
+ struct berval bei_nrdn;
+ struct berval bei_rdn;
+ Entry *bei_e;
+ Avlnode *bei_kids;
+ ldap_pvt_thread_mutex_t bei_kids_mutex;
+
+ struct bdb_entry_info *bei_lrunext; /* for cache lru list */
+ struct bdb_entry_info *bei_lruprev;
+} EntryInfo;
+#undef BEI
+#define BEI(e) ((EntryInfo *) ((e)->e_private))
+