Last change
on this file 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 | <<isascii>>, <<isascii_l>>---ASCII character predicate |
---|
| 4 | |
---|
| 5 | INDEX |
---|
| 6 | isascii |
---|
| 7 | |
---|
| 8 | INDEX |
---|
| 9 | isascii_l |
---|
| 10 | |
---|
| 11 | SYNOPSIS |
---|
| 12 | #include <ctype.h> |
---|
| 13 | int isascii(int <[c]>); |
---|
| 14 | |
---|
| 15 | #include <ctype.h> |
---|
| 16 | int isascii_l(int <[c]>, locale_t <[locale]>); |
---|
| 17 | |
---|
| 18 | DESCRIPTION |
---|
| 19 | <<isascii>> is a macro which returns non-zero when <[c]> is an ASCII |
---|
| 20 | character, and 0 otherwise. It is defined for all integer values. |
---|
| 21 | |
---|
| 22 | <<isascii_l>> is like <<isascii>> but performs the check based on the |
---|
| 23 | locale specified by the locale object locale. If <[locale]> is |
---|
| 24 | LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined. |
---|
| 25 | |
---|
| 26 | You can use a compiled subroutine instead of the macro definition by |
---|
| 27 | undefining the macro using `<<#undef isascii>>' or `<<#undef isascii_l>>'. |
---|
| 28 | |
---|
| 29 | RETURNS |
---|
| 30 | <<isascii>>, <<isascii_l>> return non-zero if the low order byte of <[c]> |
---|
| 31 | is in the range 0 to 127 (<<0x00>>--<<0x7F>>). |
---|
| 32 | |
---|
| 33 | PORTABILITY |
---|
| 34 | <<isascii>> is ANSI C. |
---|
| 35 | <<isascii_l>> is a GNU extension. |
---|
| 36 | |
---|
| 37 | No supporting OS subroutines are required. |
---|
| 38 | */ |
---|
| 39 | #include <_ansi.h> |
---|
| 40 | #include <ctype.h> |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | #undef isascii |
---|
| 45 | |
---|
| 46 | int |
---|
| 47 | isascii (int c) |
---|
| 48 | { |
---|
| 49 | return c >= 0 && c< 128; |
---|
| 50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.