diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-02 10:40:52 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-03 07:43:57 +1100 |
commit | 8a2142773f3be50734a1ae51898e18dcaa26db28 (patch) | |
tree | 85b6096ba989b4c2ef5f9c12f56b6443a77c6f96 /source4/lib/ldb/tools | |
parent | 0e95fca747826209edfde79d18b106c69e51cd6b (diff) | |
download | samba-8a2142773f3be50734a1ae51898e18dcaa26db28.tar.gz samba-8a2142773f3be50734a1ae51898e18dcaa26db28.tar.bz2 samba-8a2142773f3be50734a1ae51898e18dcaa26db28.zip |
s4-ldb: expose some more ldb module functions
this exposes enough functions for s4 to not need ldb_private.h any
more.
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r-- | source4/lib/ldb/tools/cmdline.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index 5ab6dc05bd..c5391cce8f 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -24,7 +24,6 @@ #include "replace.h" #include "system/filesys.h" #include "system/time.h" -#include "ldb_private.h" #include "ldb.h" #include "ldb_module.h" #include "tools/cmdline.h" @@ -66,7 +65,8 @@ static struct poptOption builtin_popt_options[] = { void ldb_cmdline_help(struct ldb_context *ldb, const char *cmdname, FILE *f) { poptContext pc; - pc = poptGetContext(cmdname, 0, NULL, ldb->popt_options, + struct poptOption **popt_options = ldb_module_popt_options(ldb); + pc = poptGetContext(cmdname, 0, NULL, *popt_options, POPT_CONTEXT_KEEP_FIRST); poptPrintHelp(pc, f, 0); } @@ -103,6 +103,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int opt; int flags = 0; int rc; + struct poptOption **popt_options; /* make the ldb utilities line buffered */ setlinebuf(stdout); @@ -129,7 +130,8 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, options.scope = LDB_SCOPE_DEFAULT; - ldb->popt_options = builtin_popt_options; + popt_options = ldb_module_popt_options(ldb); + (*popt_options) = builtin_popt_options; rc = ldb_modules_hook(ldb, LDB_MODULE_HOOK_CMDLINE_OPTIONS); if (rc != LDB_SUCCESS) { @@ -137,7 +139,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, goto failed; } - pc = poptGetContext(argv[0], argc, argv, ldb->popt_options, + pc = poptGetContext(argv[0], argc, argv, *popt_options, POPT_CONTEXT_KEEP_FIRST); while((opt = poptGetNextOpt(pc)) != -1) { |