summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-16 16:24:12 +1100
committerAndrew Tridgell <tridge@samba.org>2011-02-18 15:09:46 +1100
commit0581a5bb3cae6b00b2b78b57b86c3ac350759114 (patch)
tree52cbc837eabdba7de82bfaca2ebc8a3a4ea1dd2d /lib
parented71c1ef1fbeb5d2ba3aa98954b6a1e018515f46 (diff)
downloadsamba-0581a5bb3cae6b00b2b78b57b86c3ac350759114.tar.gz
samba-0581a5bb3cae6b00b2b78b57b86c3ac350759114.tar.bz2
samba-0581a5bb3cae6b00b2b78b57b86c3ac350759114.zip
lib/util/charset add functions isupper_m and islower_m
Diffstat (limited to 'lib')
-rw-r--r--lib/util/charset/charset.h3
-rw-r--r--lib/util/charset/codepoints.c16
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 92ea7304bf..901885d846 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -184,8 +184,11 @@ codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic,
const char *str, size_t *size);
ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic,
char *str, codepoint_t c);
+
codepoint_t toupper_m(codepoint_t val);
codepoint_t tolower_m(codepoint_t val);
+bool islower_m(codepoint_t val);
+bool isupper_m(codepoint_t val);
int codepoint_cmpi(codepoint_t c1, codepoint_t c2);
/* Iconv convenience functions */
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c
index bc39f1b1a4..b1451d4a9e 100644
--- a/lib/util/charset/codepoints.c
+++ b/lib/util/charset/codepoints.c
@@ -96,6 +96,22 @@ _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
}
/**
+ If we upper cased this character, would we get the same character?
+**/
+_PUBLIC_ bool islower_m(codepoint_t val)
+{
+ return (toupper_m(val) != val);
+}
+
+/**
+ If we lower cased this character, would we get the same character?
+**/
+_PUBLIC_ bool isupper_m(codepoint_t val)
+{
+ return (tolower_m(val) != val);
+}
+
+/**
compare two codepoints case insensitively
*/
_PUBLIC_ int codepoint_cmpi(codepoint_t c1, codepoint_t c2)