From f017f871078fd2219766ea061468268acb92140c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 5 Nov 2007 21:57:33 +0100 Subject: r25842: Start working on test for loading dso's in ldb. (This used to be commit d41ed7ca8d3954bf586126edd7aba17acc6af8a1) --- source4/lib/ldb/tests/sample_module.c | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 source4/lib/ldb/tests/sample_module.c (limited to 'source4/lib/ldb/tests/sample_module.c') diff --git a/source4/lib/ldb/tests/sample_module.c b/source4/lib/ldb/tests/sample_module.c new file mode 100644 index 0000000000..8ab1d33146 --- /dev/null +++ b/source4/lib/ldb/tests/sample_module.c @@ -0,0 +1,43 @@ +/* + Unix SMB/CIFS implementation. + Samba utility functions + Copyright (C) Jelmer Vernooij 2007 + + ** NOTE! The following LGPL license applies to the ldb + ** library. This does NOT imply that all of Samba is released + ** under the LGPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . +*/ + +#include "ldb_includes.h" +#include "ldb.h" +#include "ldb_errors.h" + +int sample_add(struct ldb_module *mod, struct ldb_request *req) +{ + ldb_msg_add_fmt(req->op.add.message, "touchedBy", "sample"); + + return ldb_next_request(mod, req); +} + +static const struct ldb_module_ops sample_ops = { + .name = "sample_module", + .add = sample_add, +}; + +int init_module(void) +{ + return ldb_register_module(&sample_ops); +} -- cgit From 71bc5acead0e16473273eb8741373e865b6d2c44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 20 Feb 2008 01:37:53 +0100 Subject: Allow ldb backends without init function, use init function-less ldb modules. (This used to be commit 141ee91272fb4dafca0149f679e17721b6a3011e) --- source4/lib/ldb/tests/sample_module.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source4/lib/ldb/tests/sample_module.c') diff --git a/source4/lib/ldb/tests/sample_module.c b/source4/lib/ldb/tests/sample_module.c index 8ab1d33146..1a9e72c907 100644 --- a/source4/lib/ldb/tests/sample_module.c +++ b/source4/lib/ldb/tests/sample_module.c @@ -32,12 +32,7 @@ int sample_add(struct ldb_module *mod, struct ldb_request *req) return ldb_next_request(mod, req); } -static const struct ldb_module_ops sample_ops = { - .name = "sample_module", +const struct ldb_module_ops ldb_sample_module_ops = { + .name = "sample", .add = sample_add, }; - -int init_module(void) -{ - return ldb_register_module(&sample_ops); -} -- cgit From 39a817d310964f8e9a63cfb096b3ad24fa03bd5e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 20 Feb 2008 04:33:43 +0100 Subject: Fix use of some modules (needed _PUBLIC_). (This used to be commit ce332130ea77159832da23bab760fa26921719e2) --- source4/lib/ldb/tests/sample_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb/tests/sample_module.c') diff --git a/source4/lib/ldb/tests/sample_module.c b/source4/lib/ldb/tests/sample_module.c index 1a9e72c907..98d8e865dd 100644 --- a/source4/lib/ldb/tests/sample_module.c +++ b/source4/lib/ldb/tests/sample_module.c @@ -32,7 +32,7 @@ int sample_add(struct ldb_module *mod, struct ldb_request *req) return ldb_next_request(mod, req); } -const struct ldb_module_ops ldb_sample_module_ops = { +_PUBLIC_ const struct ldb_module_ops ldb_sample_module_ops = { .name = "sample", .add = sample_add, }; -- cgit From 92f6333535a57c034e2ceb3305b420c921a48094 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Mar 2008 14:29:13 +0100 Subject: ldb: fix the standalone build metze (This used to be commit 91b49365abed6f67e2b3c18b0090b4e6ff1df935) --- source4/lib/ldb/tests/sample_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb/tests/sample_module.c') diff --git a/source4/lib/ldb/tests/sample_module.c b/source4/lib/ldb/tests/sample_module.c index 98d8e865dd..1a9e72c907 100644 --- a/source4/lib/ldb/tests/sample_module.c +++ b/source4/lib/ldb/tests/sample_module.c @@ -32,7 +32,7 @@ int sample_add(struct ldb_module *mod, struct ldb_request *req) return ldb_next_request(mod, req); } -_PUBLIC_ const struct ldb_module_ops ldb_sample_module_ops = { +const struct ldb_module_ops ldb_sample_module_ops = { .name = "sample", .add = sample_add, }; -- cgit