diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-10-06 06:57:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:27 -0500 |
commit | 78d0e79c9f9263e7f3798aa2e174a347ea1a3df1 (patch) | |
tree | b6407a778000a9fb9ea039d8f70a3396777874df /source4/lib/ldb/modules/timestamps.c | |
parent | 01e6c562086b42a59fc1ac6aa1a3359747b96fe6 (diff) | |
download | samba-78d0e79c9f9263e7f3798aa2e174a347ea1a3df1.tar.gz samba-78d0e79c9f9263e7f3798aa2e174a347ea1a3df1.tar.xz samba-78d0e79c9f9263e7f3798aa2e174a347ea1a3df1.zip |
r10759: make modules easier to write by allowing modules to only implement the
functions they care about, instead of all functions. This also makes
it more likely that future changes to ldb will not break existing
modules
(This used to be commit 45f0c967b58e7c1b2e900a4d74cfde2a2c527dfa)
Diffstat (limited to 'source4/lib/ldb/modules/timestamps.c')
-rw-r--r-- | source4/lib/ldb/modules/timestamps.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/source4/lib/ldb/modules/timestamps.c b/source4/lib/ldb/modules/timestamps.c index 5a1e54486a..13e9c2ccc4 100644 --- a/source4/lib/ldb/modules/timestamps.c +++ b/source4/lib/ldb/modules/timestamps.c @@ -191,53 +191,12 @@ static int timestamps_modify_record(struct ldb_module *module, const struct ldb_ return ret; } -static int timestamps_delete_record(struct ldb_module *module, const struct ldb_dn *dn) -{ - ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_delete_record\n"); - return ldb_next_delete_record(module, dn); -} - -static int timestamps_rename_record(struct ldb_module *module, const struct ldb_dn *olddn, const struct ldb_dn *newdn) -{ - ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_rename_record\n"); - return ldb_next_rename_record(module, olddn, newdn); -} - -static int timestamps_start_trans(struct ldb_module *module) -{ - ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_start_trans\n"); - return ldb_next_start_trans(module); -} - -static int timestamps_end_trans(struct ldb_module *module) -{ - ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_end_trans\n"); - return ldb_next_end_trans(module); -} - -static int timestamps_del_trans(struct ldb_module *module) -{ - ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_del_trans\n"); - return ldb_next_del_trans(module); -} - -static int timestamps_destructor(void *module_ctx) -{ - /* struct ldb_module *ctx = module_ctx; */ - /* put your clean-up functions here */ - return 0; -} static const struct ldb_module_ops timestamps_ops = { .name = "timestamps", .search_bytree = timestamps_search_bytree, .add_record = timestamps_add_record, - .modify_record = timestamps_modify_record, - .delete_record = timestamps_delete_record, - .rename_record = timestamps_rename_record, - .start_transaction = timestamps_start_trans, - .end_transaction = timestamps_end_trans, - .del_transaction = timestamps_del_trans + .modify_record = timestamps_modify_record }; @@ -259,7 +218,5 @@ struct ldb_module *timestamps_module_init(struct ldb_context *ldb, const char *o ctx->prev = ctx->next = NULL; ctx->ops = ×tamps_ops; - talloc_set_destructor (ctx, timestamps_destructor); - return ctx; } |