diff options
Diffstat (limited to 'source/lib/ldb/include')
-rw-r--r-- | source/lib/ldb/include/ldb.h | 26 | ||||
-rw-r--r-- | source/lib/ldb/include/ldb_private.h | 23 |
2 files changed, 22 insertions, 27 deletions
diff --git a/source/lib/ldb/include/ldb.h b/source/lib/ldb/include/ldb.h index 3db334d341d..853adb82c6e 100644 --- a/source/lib/ldb/include/ldb.h +++ b/source/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); diff --git a/source/lib/ldb/include/ldb_private.h b/source/lib/ldb/include/ldb_private.h index 02fb370e164..81993efaef7 100644 --- a/source/lib/ldb/include/ldb_private.h +++ b/source/lib/ldb/include/ldb_private.h @@ -79,8 +79,8 @@ typedef int (*ldb_connect_fn) (struct ldb_context *ldb, const char *url, unsigne */ struct ldb_schema { /* attribute handling table */ - unsigned num_attrib_handlers; - struct ldb_attrib_handler *attrib_handlers; + unsigned num_attributes; + struct ldb_schema_attribute *attributes; /* objectclass information */ unsigned num_classes; @@ -183,17 +183,22 @@ int ldb_match_msg(struct ldb_context *ldb, struct ldb_dn *base, enum ldb_scope scope); -void ldb_remove_attrib_handler(struct ldb_context *ldb, const char *attrib); const struct ldb_schema_syntax *ldb_standard_syntax_by_name(struct ldb_context *ldb, const char *syntax); -int ldb_set_attrib_handlers(struct ldb_context *ldb, - const struct ldb_attrib_handler *handlers, - unsigned num_handlers); -int ldb_setup_wellknown_attributes(struct ldb_context *ldb); -int ldb_set_attrib_handler_syntax(struct ldb_context *ldb, - const char *attr, const char *syntax); /* The following definitions come from lib/ldb/common/ldb_attributes.c */ + +int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb, + const char *name, + unsigned flags, + const struct ldb_schema_syntax *syntax); +int ldb_schema_attribute_add(struct ldb_context *ldb, + const char *name, + unsigned flags, + const char *syntax); +void ldb_schema_attribute_remove(struct ldb_context *ldb, const char *name); +int ldb_setup_wellknown_attributes(struct ldb_context *ldb); + const char **ldb_subclass_list(struct ldb_context *ldb, const char *classname); void ldb_subclass_remove(struct ldb_context *ldb, const char *classname); int ldb_subclass_add(struct ldb_context *ldb, const char *classname, const char *subclass); |