Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / isxdigit.c
blob2bfe18dbfab7a14360714f3917725374d23c1dfe
1 /*
2 FUNCTION
3 <<isxdigit>>, <<isxdigit_l>>---hexadecimal digit predicate
5 INDEX
6 isxdigit
8 INDEX
9 isxdigit_l
11 SYNOPSIS
12 #include <ctype.h>
13 int isxdigit(int <[c]>);
15 #include <ctype.h>
16 int isxdigit_l(int <[c]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<isxdigit>> is a macro which classifies singlebyte charset values by table
20 lookup. It is a predicate returning non-zero for hexadecimal digits,
21 and <<0>> for other characters. It is defined only if <[c]> is
22 representable as an unsigned char or if <[c]> is EOF.
24 <<isxdigit_l>> is like <<isxdigit>> 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 isxdigit>>' or `<<#undef isxdigit_l>>'.
31 RETURNS
32 <<isxdigit>>, <<isxdigit_l>> return non-zero if <[c]> is a hexadecimal digit
33 (<<0>>--<<9>>, <<a>>--<<f>>, or <<A>>--<<F>>).
35 PORTABILITY
36 <<isxdigit>> is ANSI C.
37 <<isxdigit_l>> is POSIX-1.2008.
39 No supporting OS subroutines are required.
41 #include <_ansi.h>
42 #include <ctype.h>
45 #undef isxdigit
46 int
47 isxdigit (int c)
49 return(__CTYPE_PTR[c+1] & ((_X)|(_N)));