source: trunk/libs/newlib/src/newlib/libc/ctype/islower.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.2 KB
Line 
1/*
2FUNCTION
3        <<islower>>, <<islower_l>>---lowercase character predicate
4
5INDEX
6        islower
7
8INDEX
9        islower_l
10
11SYNOPSIS
12        #include <ctype.h>
13        int islower(int <[c]>);
14
15        #include <ctype.h>
16        int islower_l(int <[c]>, locale_t <[locale]>);
17
18DESCRIPTION
19<<islower>> is a macro which classifies singlebyte charset values by table
20lookup.  It is a predicate returning non-zero for minuscules
21(lowercase alphabetic characters), and 0 for other characters.
22It is defined only if <[c]> is representable as an unsigned char or if
23<[c]> is EOF.
24
25<<islower_l>> is like <<islower>> but performs the check based on the
26locale specified by the locale object locale.  If <[locale]> is
27LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
28
29You can use a compiled subroutine instead of the macro definition by
30undefining the macro using `<<#undef islower>>' or `<<#undef islower_l>>'.
31
32RETURNS
33<<islower>>, <<islower_l>> return non-zero if <[c]> is a lowercase letter.
34
35PORTABILITY
36<<islower>> is ANSI C.
37<<islower_l>> is POSIX-1.2008.
38
39No supporting OS subroutines are required.
40*/
41#include <_ansi.h>
42#include <ctype.h>
43
44#undef islower
45int
46islower (int c)
47{
48        return ((__CTYPE_PTR[c+1] & (_U|_L)) == _L);
49}
Note: See TracBrowser for help on using the repository browser.