diff options
Diffstat (limited to 'src/ctype/islower.c')
-rw-r--r-- | src/ctype/islower.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ctype/islower.c b/src/ctype/islower.c new file mode 100644 index 00000000..082697dd --- /dev/null +++ b/src/ctype/islower.c @@ -0,0 +1,30 @@ +#include <ctype.h> +#include "limits.h" +#include "nonstd/assert.h" +#include "nonstd/internal.h" +#include "nonstd/ctype.h" + +/** test whether a character is a lowercase letter **/ +int islower(int c) +{ + unsigned int *map = __libc(CTYPE); + + ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); + /* + RETURN(NONZERO, ARGUMENT(c) is a lowercase letter); + RETURN(0, ARGUMENT(c) is not a lowercase letter); + */ + return map[c] & LOWER; +} + +/*** +tests whether ARGUMENT(c) is a character in the class CHARACTER_CLASS(lower) +in the current locale. +***/ + +/* +LC_CTYPE +C_LOCALE(`THIS() is true for the characters CHAR(a), CHAR(b), CHAR(c), CHAR(d), CHAR(e), CHAR(f), CHAR(g), CHAR(h), CHAR(i), CHAR(j), CHAR(k), CHAR(l), CHAR(m), CHAR(n), CHAR(o), CHAR(p), CHAR(q), CHAR(s), CHAR(t), CHAR(u), CHAR(w), CHAR(x), CHAR(y), and CHAR(z)') +OTHER_LOCALES(`THIS() is true for a set of characters for which none of FUNCTION(iscntrl), FUNCTION(isdigit), FUNCTION(ispunct), or FUNCTION(isspace) is true') +STDC(1) +*/ |