2017-04-11 21:13:36 +00:00
|
|
|
/*
|
|
|
|
FUNCTION
|
2017-10-07 00:16:47 +00:00
|
|
|
<<isalnum>>, <<isalnum_l>>---alphanumeric character predicate
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
INDEX
|
|
|
|
isalnum
|
2017-10-07 00:16:47 +00:00
|
|
|
INDEX
|
|
|
|
isalnum_l
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
ANSI_SYNOPSIS
|
|
|
|
#include <ctype.h>
|
|
|
|
int isalnum(int <[c]>);
|
|
|
|
|
2017-10-07 00:16:47 +00:00
|
|
|
#include <ctype.h>
|
|
|
|
int isalnum_l(int <[c]>, locale_t <[locale]>);
|
|
|
|
|
2017-04-11 21:13:36 +00:00
|
|
|
TRAD_SYNOPSIS
|
|
|
|
#include <ctype.h>
|
|
|
|
int isalnum(<[c]>);
|
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
2017-10-07 00:16:47 +00:00
|
|
|
<<isalnum>> is a macro which classifies singlebyte charset values by table
|
2017-04-11 21:13:36 +00:00
|
|
|
lookup. It is a predicate returning non-zero for alphabetic or
|
|
|
|
numeric ASCII characters, and <<0>> for other arguments. It is defined
|
2017-10-07 00:16:47 +00:00
|
|
|
only if <[c]> is representable as an unsigned char or if <[c]> is EOF.
|
|
|
|
|
|
|
|
<<isalnum_l>> is like <<isalnum>> but performs the check based on the
|
|
|
|
locale specified by the locale object locale. If <[locale]> is
|
|
|
|
LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
You can use a compiled subroutine instead of the macro definition by
|
2017-10-07 00:16:47 +00:00
|
|
|
undefining the macro using `<<#undef isalnum>>' or `<<#undef isalnum_l>>'.
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
RETURNS
|
2017-10-07 00:16:47 +00:00
|
|
|
<<isalnum>>,<<isalnum_l>> return non-zero if <[c]> is a letter or a digit.
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
PORTABILITY
|
|
|
|
<<isalnum>> is ANSI C.
|
2017-10-07 00:16:47 +00:00
|
|
|
<<isalnum_l>> is POSIX-1.2008.
|
2017-04-11 21:13:36 +00:00
|
|
|
|
|
|
|
No OS subroutines are required.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <_ansi.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
#undef isalnum
|
|
|
|
|
|
|
|
int
|
|
|
|
_DEFUN(isalnum,(c),int c)
|
|
|
|
{
|
2017-10-07 00:16:47 +00:00
|
|
|
return(__CTYPE_PTR[c+1] & (_U|_L|_N));
|
2017-04-11 21:13:36 +00:00
|
|
|
}
|