lib/util/charset add functions isupper_m and islower_m
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Feb 2011 05:24:12 +0000 (16:24 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Feb 2011 04:09:46 +0000 (15:09 +1100)
lib/util/charset/charset.h
lib/util/charset/codepoints.c

index 92ea7304bfad9f2164d747792c2157d52de1a180..901885d8462a670cb2d76b288df2135bd3e00a4d 100644 (file)
@@ -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 */
index bc39f1b1a4790f6f347c667531450f4ac9a8bd8d..b1451d4a9ec5e439843bd7a946c11211561700de 100644 (file)
@@ -95,6 +95,22 @@ _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
        return SVAL(lowcase_table, val*2);
 }
 
+/**
+ 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
 */