Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / isalpha.c
blob8b8e78a296359a4a8b3687fd76b1b73cd707a6da
1 /*
2 FUNCTION
3 <<isalpha>>, <<isalpha_l>>---alphabetic character predicate
5 INDEX
6 isalpha
8 INDEX
9 isalpha_l
11 SYNOPSIS
12 #include <ctype.h>
13 int isalpha(int <[c]>);
15 #include <ctype.h>
16 int isalpha_l(int <[c]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<isalpha>> is a macro which classifies singlebyte charset values by table
20 lookup. It is a predicate returning non-zero when <[c]> represents an
21 alphabetic ASCII character, and 0 otherwise. It is defined only if
22 <[c]> is representable as an unsigned char or if <[c]> is EOF.
24 <<isalpha_l>> is like <<isalpha>> 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.
28 You can use a compiled subroutine instead of the macro definition by
29 undefining the macro using `<<#undef isalpha>>' or `<<#undef isalpha_l>>'.
31 RETURNS
32 <<isalpha>>, <<isalpha_l>> return non-zero if <[c]> is a letter.
34 PORTABILITY
35 <<isalpha>> is ANSI C.
36 <<isalpha_l>> is POSIX-1.2008.
38 No supporting OS subroutines are required.
41 #include <_ansi.h>
42 #include <ctype.h>
44 #undef isalpha
45 int
46 isalpha (int c)
48 return(__CTYPE_PTR[c+1] & (_U|_L));