#include "ldb_module.h"
struct ltdb_private;
+typedef int (*ldb_kv_traverse_fn)(struct ltdb_private *ltdb,
+ struct ldb_val key, struct ldb_val data,
+ void *ctx);
+
struct kv_db_ops {
- int (*store)(struct ltdb_private *ltdb, TDB_DATA key, TDB_DATA data, int flags);
- int (*delete)(struct ltdb_private *ltdb, TDB_DATA key);
+ int (*store)(struct ltdb_private *ltdb, struct ldb_val key, struct ldb_val data, int flags);
+ int (*delete)(struct ltdb_private *ltdb, struct ldb_val key);
+ int (*iterate)(struct ltdb_private *ltdb, ldb_kv_traverse_fn fn, void *ctx);
+ int (*update_in_iterate)(struct ltdb_private *ltdb, struct ldb_val key,
+ struct ldb_val key2, struct ldb_val data, void *ctx);
+ int (*fetch_and_parse)(struct ltdb_private *ltdb, struct ldb_val key,
+ int (*parser)(struct ldb_val key, struct ldb_val data,
+ void *private_data),
+ void *ctx);
int (*lock_read)(struct ldb_module *);
int (*unlock_read)(struct ldb_module *);
+ int (*begin_write)(struct ltdb_private *);
+ int (*prepare_write)(struct ltdb_private *);
+ int (*abort_write)(struct ltdb_private *);
+ int (*finish_write)(struct ltdb_private *);
int (*error)(struct ltdb_private *ltdb);
+ const char * (*errorstr)(struct ltdb_private *ltdb);
const char * (*name)(struct ltdb_private *ltdb);
+ bool (*has_changed)(struct ltdb_private *ltdb);
+ bool (*transaction_active)(struct ltdb_private *ltdb);
};
/* this private structure is used by the ltdb backend in the
bool read_only;
+ bool reindex_failed;
+
const struct ldb_schema_syntax *GUID_index_syntax;
/*
int error;
};
+struct ltdb_reindex_context {
+ struct ldb_module *module;
+ int error;
+ uint32_t count;
+};
+
+
/* special record types */
#define LTDB_INDEX "@INDEX"
#define LTDB_INDEXLIST "@INDEXLIST"
int ltdb_search(struct ltdb_context *ctx);
/* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
-int ltdb_lock_read(struct ldb_module *module);
-int ltdb_unlock_read(struct ldb_module *module);
/*
* Determine if this key could hold a record. We allow the new GUID
* index, the old DN index and a possible future ID=
TALLOC_CTX *mem_ctx,
const struct ldb_val *idx_val,
TDB_DATA *key);
+TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn);
int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg, struct ldb_request *req);
int ltdb_delete_noindex(struct ldb_module *module,
const char *path, int hash_size, int tdb_flags,
int open_flags, mode_t mode,
struct ldb_context *ldb);
+int init_store(struct ltdb_private *ltdb, const char *name,
+ struct ldb_context *ldb, const char *options[],
+ struct ldb_module **_module);
+
+int ltdb_connect(struct ldb_context *ldb, const char *url,
+ unsigned int flags, const char *options[],
+ struct ldb_module **_module);