summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include/ldb.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-15 13:08:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:19 -0500
commitc69717755abeaf8bf93e76255d0912e3a24b7cb0 (patch)
tree979dfa0ee6680bd67b47661ae78965b52577a698 /source4/lib/ldb/include/ldb.h
parent1a1027b8244a2f41676b2bd5999015c769fb4fb4 (diff)
downloadsamba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.tar.gz
samba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.tar.bz2
samba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.zip
r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointer
to a ldb_schema_syntax struct. the default attribute handler is now registered dynamicly as "*" attribute, instead of having its own code path. ldb_schema_attribute's can be added to the ldb_schema given a ldb_schema_syntax struct or the syntax name we may also need to introduce a ldb_schema_matching_rule, and add a pointer to a default ldb_schema_matching_rule in the ldb_schema_syntax. metze (This used to be commit b97b8f5dcbce006f005e53ca79df3330e62f117b)
Diffstat (limited to 'source4/lib/ldb/include/ldb.h')
-rw-r--r--source4/lib/ldb/include/ldb.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 3db334d341..853adb82c6 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -329,25 +329,23 @@ typedef int (*ldb_attr_comparison_t)(struct ldb_context *, void *mem_ctx, const
comparison_fn -> compare two values
*/
-struct ldb_attrib_handler {
-
- const char *attr;
- unsigned flags;
-
+struct ldb_schema_syntax {
+ const char *name;
ldb_attr_handler_t ldif_read_fn;
ldb_attr_handler_t ldif_write_fn;
ldb_attr_handler_t canonicalise_fn;
ldb_attr_comparison_t comparison_fn;
};
-struct ldb_schema_syntax {
+struct ldb_schema_attribute {
const char *name;
- ldb_attr_handler_t ldif_read_fn;
- ldb_attr_handler_t ldif_write_fn;
- ldb_attr_handler_t canonicalise_fn;
- ldb_attr_comparison_t comparison_fn;
+ unsigned flags;
+ const struct ldb_schema_syntax *syntax;
};
+const struct ldb_schema_attribute *ldb_schema_attribute_by_name(struct ldb_context *ldb,
+ const char *name);
+
/**
The attribute is not returned by default
*/
@@ -1281,10 +1279,6 @@ char *ldb_base64_encode(void *mem_ctx, const char *buf, int len);
*/
int ldb_base64_decode(char *s);
-int ldb_attrib_add_handlers(struct ldb_context *ldb,
- const struct ldb_attrib_handler *handlers,
- unsigned num_handlers);
-
/* The following definitions come from lib/ldb/common/ldb_dn.c */
struct ldb_dn *ldb_dn_new(void *mem_ctx, struct ldb_context *ldb, const char *dn);
@@ -1524,10 +1518,6 @@ int ldb_set_debug_stderr(struct ldb_context *ldb);
int ldb_set_opaque(struct ldb_context *ldb, const char *name, void *value);
void *ldb_get_opaque(struct ldb_context *ldb, const char *name);
-const struct ldb_attrib_handler *ldb_attrib_handler(struct ldb_context *ldb,
- const char *attrib);
-
-
const char **ldb_attr_list_copy(void *mem_ctx, const char * const *attrs);
const char **ldb_attr_list_copy_add(void *mem_ctx, const char * const *attrs, const char *new_attr);
int ldb_attr_in_list(const char * const *attrs, const char *attr);