static char *ldb_modules_strdup_no_spaces(TALLOC_CTX *mem_ctx, const char *string)
{
- int i, len;
+ size_t i, len;
char *trimmed;
trimmed = talloc_strdup(mem_ctx, string);
char **modules = NULL;
const char **m;
char *modstr, *p;
- int i;
+ unsigned int i;
/* spaces not admitted */
modstr = ldb_modules_strdup_no_spaces(mem_ctx, string);
static ldb_connect_fn ldb_find_backend(const char *url)
{
struct backends_list_entry *backend;
- int i;
+ unsigned int i;
for (i = 0; builtins[i].backend_ops || builtins[i].module_ops; i++) {
if (builtins[i].backend_ops == NULL) continue;
static const struct ldb_module_ops *ldb_find_module_ops(const char *name)
{
struct ops_list_entry *e;
- int i;
+ unsigned int i;
for (i = 0; builtins[i].backend_ops || builtins[i].module_ops; i++) {
if (builtins[i].module_ops == NULL) continue;
int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, struct ldb_module *backend, struct ldb_module **out)
{
struct ldb_module *module;
- int i;
+ unsigned int i;
module = backend;
int ldb_load_modules(struct ldb_context *ldb, const char *options[])
{
const char **modules = NULL;
- int i;
+ unsigned int i;
int ret;
TALLOC_CTX *mem_ctx = talloc_new(ldb);
if (!mem_ctx) {
return module->ldb;
}
+const struct ldb_module_ops *ldb_module_get_ops(struct ldb_module *module)
+{
+ return module->ops;
+}
+
void *ldb_module_get_private(struct ldb_module *module)
{
return module->private_data;
* all our modules, and leaves us one less sharp
* corner for module developers to cut themselves on
*/
- ldb_module_done(request, NULL, NULL, ret);
+ ret = ldb_module_done(request, NULL, NULL, ret);
}
return ret;
}
* req: the original request passed to your module
* ctrls: controls to send in the reply (must be a talloc pointer, steal)
* response: results for extended request (steal)
- * error: LDB_SUCCESS for a succesful return
+ * error: LDB_SUCCESS for a successful return
* any other ldb error otherwise
*/
int ldb_module_done(struct ldb_request *req,
ldb_debug_end(req->handle->ldb, LDB_DEBUG_TRACE);
}
- req->callback(req, ares);
- return error;
+ return req->callback(req, ares);
}
/* to be used *only* in modules init functions.
return ret;
}
+#ifdef STATIC_ldb_MODULES
+#define STATIC_LIBLDB_MODULES STATIC_ldb_MODULES
+#endif
+
#ifndef STATIC_LIBLDB_MODULES
#ifdef HAVE_LDB_LDAP