Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / isalnum.c
blobd926f97b7c3f5b4a84d186d9fbd02d3003435eb3
1 /*
2 FUNCTION
3 <<isalnum>>, <<isalnum_l>>---alphanumeric character predicate
5 INDEX
6 isalnum
7 INDEX
8 isalnum_l
10 SYNOPSIS
11 #include <ctype.h>
12 int isalnum(int <[c]>);
14 #include <ctype.h>
15 int isalnum_l(int <[c]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<isalnum>> is a macro which classifies singlebyte charset values by table
20 lookup. It is a predicate returning non-zero for alphabetic or
21 numeric ASCII characters, and <<0>> for other arguments. It is defined
22 only if <[c]> is representable as an unsigned char or if <[c]> is EOF.
24 <<isalnum_l>> is like <<isalnum>> 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 isalnum>>' or `<<#undef isalnum_l>>'.
31 RETURNS
32 <<isalnum>>,<<isalnum_l>> return non-zero if <[c]> is a letter or a digit.
34 PORTABILITY
35 <<isalnum>> is ANSI C.
36 <<isalnum_l>> is POSIX-1.2008.
38 No OS subroutines are required.
41 #include <_ansi.h>
42 #include <ctype.h>
44 #undef isalnum
46 int
47 isalnum (int c)
49 return(__CTYPE_PTR[c+1] & (_U|_L|_N));