summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-19 08:02:06 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-03-21 11:22:43 -0400
commit2b4332767d299263a288e0a74bbfbc9de674de95 (patch)
tree157b879c273d15c3d68f21ec307298860ec762d5 /src/util
parent5ca493af3e24e2cf7299289364cf23ccec9e5d35 (diff)
downloadsssd-2b4332767d299263a288e0a74bbfbc9de674de95.tar.gz
sssd-2b4332767d299263a288e0a74bbfbc9de674de95.tar.xz
sssd-2b4332767d299263a288e0a74bbfbc9de674de95.zip
Make the string_equal() function public
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sss_utf8.c9
-rw-r--r--src/util/util.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/util/sss_utf8.c b/src/util/sss_utf8.c
index 7997a6df4..27c5cb60a 100644
--- a/src/util/sss_utf8.c
+++ b/src/util/sss_utf8.c
@@ -171,3 +171,12 @@ errno_t sss_utf8_case_eq(const uint8_t *s1, const uint8_t *s2)
#else
#error No unicode library
#endif
+
+bool sss_string_equal(bool cs, const char *s1, const char *s2)
+{
+ if (cs) {
+ return strcmp(s1, s2) == 0;
+ }
+
+ return sss_utf8_case_eq((const uint8_t *)s1, (const uint8_t *)s2) == EOK;
+}
diff --git a/src/util/util.h b/src/util/util.h
index 7eb62a9b9..985c78981 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -516,6 +516,7 @@ char *
sss_tc_utf8_str_tolower(TALLOC_CTX *mem_ctx, const char *s);
uint8_t *
sss_tc_utf8_tolower(TALLOC_CTX *mem_ctx, const uint8_t *s, size_t len, size_t *_nlen);
+bool sss_string_equal(bool cs, const char *s1, const char *s2);
/* len includes terminating '\0' */
struct sized_string {