diff options
author | Simo Sorce <idra@samba.org> | 2009-01-29 18:39:30 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2009-01-30 01:02:03 -0500 |
commit | 380874ef863866c94c999ef53252b9d30df65e88 (patch) | |
tree | aafdb720253d5a6013e2a23a0e81b0a9b90f054b /source4/lib/ldb/modules/skel.c | |
parent | a5f0640bf99e6f7e38b0b1e7a7a56f8f58ec7e47 (diff) | |
download | samba-380874ef863866c94c999ef53252b9d30df65e88.tar.gz samba-380874ef863866c94c999ef53252b9d30df65e88.tar.bz2 samba-380874ef863866c94c999ef53252b9d30df65e88.zip |
Fix the mess with ldb includes.
Separate again the public from the private headers.
Add a new header specific for modules.
Also add service function for modules as now ldb_context and ldb_module are
opaque structures for them.
Diffstat (limited to 'source4/lib/ldb/modules/skel.c')
-rw-r--r-- | source4/lib/ldb/modules/skel.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 0cd29ac4b7..248f9b346b 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -31,7 +31,7 @@ * Author: Simo Sorce */ -#include "ldb_includes.h" +#include "ldb_module.h" struct private_data { @@ -87,9 +87,13 @@ static int skel_del_trans(struct ldb_module *module) static int skel_destructor(struct ldb_module *ctx) { - struct private_data *data = talloc_get_type(ctx->private_data, struct private_data); + struct private_data *data; + + data = talloc_get_type(ldb_module_get_private(ctx), struct private_data); + /* put your clean-up functions here */ if (data->some_private_data) talloc_free(data->some_private_data); + return 0; } @@ -100,16 +104,19 @@ static int skel_request(struct ldb_module *module, struct ldb_request *req) static int skel_init(struct ldb_module *module) { + struct ldb_context *ldb; struct private_data *data; + ldb = ldb_module_get_ctx(module); + data = talloc(module, struct private_data); if (data == NULL) { - ldb_oom(module->ldb); + ldb_oom(ldb); return LDB_ERR_OPERATIONS_ERROR; } data->some_private_data = NULL; - module->private_data = data; + ldb_module_set_private(module, data); talloc_set_destructor (module, skel_destructor); |