summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-04 06:57:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:45 -0500
commit04396c36d3ee8300b2b73ea8b43a45ea1b250828 (patch)
tree9f48c588c7faf2ace8b1ea0281cd3fd01d10af5f /source4/lib/ldb/include
parent88279373abc07fa50a969135eb5ecf58d6c40cc7 (diff)
downloadsamba-04396c36d3ee8300b2b73ea8b43a45ea1b250828.tar.gz
samba-04396c36d3ee8300b2b73ea8b43a45ea1b250828.tar.bz2
samba-04396c36d3ee8300b2b73ea8b43a45ea1b250828.zip
r13333: revert previous commit I will use ldb_caseless_cmp in attrib_handlers
to correctly support utf8 comparisons add an ldb_attr_Casefold function for attribute names and use it instead of casefold in the right places (This used to be commit 3b4eb2413bbce059dde69f35c03cdc3cc2ba85c5)
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 0e192c2e31..7c39aeeeb9 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -214,6 +214,7 @@ struct ldb_debug_ops {
*/
struct ldb_utf8_fns {
void *context;
+ int (*caseless_cmp)(void *context, const char *s1, const char *s2);
char *(*casefold)(void *context, void *mem_ctx, const char *s);
};
@@ -748,6 +749,21 @@ void ldb_set_utf8_default(struct ldb_context *ldb);
char *ldb_casefold(struct ldb_context *ldb, void *mem_ctx, const char *s);
/**
+ Compare two strings, without regard to case.
+
+ \param ldb the ldb context
+ \param s1 the first string to compare
+ \param s2 the second string to compare
+
+ \return 0 if the strings are the same, non-zero if there are any
+ differences except for case.
+
+ \note The default function is not yet UTF8 aware. Provide your own
+ set of functions through ldb_set_utf8_fns()
+*/
+int ldb_caseless_cmp(struct ldb_context *ldb, const char *s1, const char *s2);
+
+/**
Check the attribute name is valid according to rfc2251
\param s tthe string to check
@@ -1101,6 +1117,7 @@ int ldb_set_debug(struct ldb_context *ldb,
*/
void ldb_set_utf8_fns(struct ldb_context *ldb,
void *context,
+ int (*cmp)(void *, const char *, const char *),
char *(*casefold)(void *, void *, const char *));
/**