summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2004-11-15 11:40:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:51 -0500
commit679e95db033fd11d17c1f1ac5e44f6cc4df2220e (patch)
tree2a6138f9c6c66025ac0e68965dc73f32846f0d1b /source4/lib/ldb/include
parent5b397619ccd3a2189c053209387093b60ff53094 (diff)
downloadsamba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.tar.gz
samba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.tar.bz2
samba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.zip
r3754: merge in ldb modules support from the tmp branch ldbPlugins
(This used to be commit 71323f424b4561af1fdddd2358629049be3dad8c)
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb.h40
1 files changed, 25 insertions, 15 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 3c78f12fb5..6a06678e0e 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -121,26 +121,39 @@ struct ldb_context;
typedef int (*ldb_traverse_fn)(struct ldb_context *, const struct ldb_message *);
+struct ldb_module_ops;
+
+/* basic module structure */
+struct ldb_module {
+ struct ldb_module *prev, *next;
+ struct ldb_context *ldb;
+ void *private_data;
+ const struct ldb_module_ops *ops;
+};
+
/*
- these function pointers define the operations that a ldb backend must perform
+ these function pointers define the operations that a ldb module must perform
they correspond exactly to the ldb_*() interface
*/
-struct ldb_backend_ops {
- int (*close)(struct ldb_context *);
- int (*search)(struct ldb_context *, const char *, enum ldb_scope,
+struct ldb_module_ops {
+ const char *name;
+ int (*close)(struct ldb_module *);
+ int (*search)(struct ldb_module *, const char *, enum ldb_scope,
const char *, const char * const [], struct ldb_message ***);
- int (*search_free)(struct ldb_context *, struct ldb_message **);
- int (*add_record)(struct ldb_context *, const struct ldb_message *);
- int (*modify_record)(struct ldb_context *, const struct ldb_message *);
- int (*delete_record)(struct ldb_context *, const char *);
- int (*rename_record)(struct ldb_context *, const char *olddn, const char *newdn);
- const char * (*errstring)(struct ldb_context *);
+ int (*search_free)(struct ldb_module *, struct ldb_message **);
+ int (*add_record)(struct ldb_module *, const struct ldb_message *);
+ int (*modify_record)(struct ldb_module *, const struct ldb_message *);
+ int (*delete_record)(struct ldb_module *, const char *);
+ int (*rename_record)(struct ldb_module *, const char *, const char *);
+ const char * (*errstring)(struct ldb_module *);
/* this is called when the alloc ops changes to ensure we
don't have any old allocated data in the context */
- void (*cache_free)(struct ldb_context *);
+ void (*cache_free)(struct ldb_module *);
};
+/* the modules init function */
+typedef struct ldb_module *(*init_ldb_module_function)(void);
/*
the user can optionally supply a allocator function. It is presumed
@@ -172,11 +185,8 @@ struct ldb_debug_ops {
every ldb connection is started by establishing a ldb_context
*/
struct ldb_context {
- /* a private pointer for the backend to use */
- void *private_data;
-
/* the operations provided by the backend */
- const struct ldb_backend_ops *ops;
+ struct ldb_module *modules;
/* memory allocation info */
struct ldb_alloc_ops alloc_ops;