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