1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

lib/util/charset add functions isupper_m and islower_m

This commit is contained in:
Andrew Bartlett 2011-02-16 16:24:12 +11:00 committed by Andrew Tridgell
parent ed71c1ef1f
commit 0581a5bb3c
2 changed files with 19 additions and 0 deletions

View 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 */

View 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
*/