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