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