source: trunk/libs/newlib/src/newlib/libc/ctype/isxdigit.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        <<isxdigit>>, <<isxdigit_l>>---hexadecimal digit predicate
4
5INDEX
6        isxdigit
7
8INDEX
9        isxdigit_l
10
11SYNOPSIS
12        #include <ctype.h>
13        int isxdigit(int <[c]>);
14
15        #include <ctype.h>
16        int isxdigit_l(int <[c]>, locale_t <[locale]>);
17
18DESCRIPTION
19<<isxdigit>> is a macro which classifies singlebyte charset values by table
20lookup.  It is a predicate returning non-zero for hexadecimal digits,
21and <<0>> for other characters.  It is defined only if <[c]> is
22representable as an unsigned char or if <[c]> is EOF.
23
24<<isxdigit_l>> is like <<isxdigit>> 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 isxdigit>>' or `<<#undef isxdigit_l>>'.
30
31RETURNS
32<<isxdigit>>, <<isxdigit_l>> return non-zero if <[c]> is a hexadecimal digit
33(<<0>>--<<9>>, <<a>>--<<f>>, or <<A>>--<<F>>).
34
35PORTABILITY
36<<isxdigit>> is ANSI C.
37<<isxdigit_l>> is POSIX-1.2008.
38
39No supporting OS subroutines are required.
40*/
41#include <_ansi.h>
42#include <ctype.h>
43
44
45#undef isxdigit
46int
47isxdigit (int c)
48{
49        return(__CTYPE_PTR[c+1] & ((_X)|(_N)));
50}
Note: See TracBrowser for help on using the repository browser.