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