summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1999-12-23 01:57:43 +0000
committerJeremy Allison <jra@samba.org>1999-12-23 01:57:43 +0000
commit7c51c5ddf31cc990610d07edb1cbe7265288e2c3 (patch)
treee0a0592582f6661c8df0840e81ccc40d9a1b6475 /source3/lib
parent63ca6eaff0f9451aeb8b4f14e0e6767ff32c06b7 (diff)
downloadsamba-7c51c5ddf31cc990610d07edb1cbe7265288e2c3.tar.gz
samba-7c51c5ddf31cc990610d07edb1cbe7265288e2c3.tar.bz2
samba-7c51c5ddf31cc990610d07edb1cbe7265288e2c3.zip
Samba now includes a full ucs2 upper to lower case (and vica versa) map table.
Jeremy. (This used to be commit d7b72d4cbfb6bd1925abc7f95c1180d3d65856a5)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_unistr.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index cdeaefce7a..486091a8b5 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -905,3 +905,59 @@ smb_ucs2_t *wstrdup(const smb_ucs2_t *s)
safe_wstrcpy(newstr, s, newlen);
return newstr;
}
+
+/*******************************************************************
+ Mapping tables for UNICODE character. Allows toupper/tolower and
+ isXXX functions to work.
+********************************************************************/
+
+typedef struct {
+ smb_ucs2_t lower;
+ smb_ucs2_t upper;
+ unsigned char flags;
+} smb_unicode_table_t;
+
+static smb_unicode_table_t map_table[] = {
+#include "unicode_map_table.h"
+};
+
+/*******************************************************************
+ Is an upper case wchar.
+********************************************************************/
+
+int wisupper( smb_ucs2_t val)
+{
+ return (map_table[val].flags & UNI_UPPER);
+}
+/*******************************************************************
+ Is a lower case wchar.
+********************************************************************/
+
+int wislower( smb_ucs2_t val)
+{
+ return (map_table[val].flags & UNI_LOWER);
+}
+/*******************************************************************
+ Is a digit wchar.
+********************************************************************/
+
+int wisdigit( smb_ucs2_t val)
+{
+ return (map_table[val].flags & UNI_DIGIT);
+}
+/*******************************************************************
+ Is a hex digit wchar.
+********************************************************************/
+
+int wisxdigit( smb_ucs2_t val)
+{
+ return (map_table[val].flags & UNI_XDIGIT);
+}
+/*******************************************************************
+ Is a space wchar.
+********************************************************************/
+
+int wisspace( smb_ucs2_t val)
+{
+ return (map_table[val].flags & UNI_SPACE);
+}