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