blob: 7e05bd1a249f7f8ef5156ca5cb806df44f71b7b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
FUNCTION
<<isalnum>>---alphanumeric character predicate
INDEX
isalnum
ANSI_SYNOPSIS
#include <ctype.h>
int isalnum(int <[c]>);
TRAD_SYNOPSIS
#include <ctype.h>
int isalnum(<[c]>);
DESCRIPTION
<<isalnum>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for alphabetic or
numeric ASCII characters, and <<0>> for other arguments. It is defined
for all integer values.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isalnum>>'.
RETURNS
<<isalnum>> returns non-zero if <[c]> is a letter (<<a>>--<<z>> or
<<A>>--<<Z>>) or a digit (<<0>>--<<9>>).
PORTABILITY
<<isalnum>> is ANSI C.
No OS subroutines are required.
*/
#include <_ansi.h>
#include <ctype.h>
#undef isalnum
int
_DEFUN(isalnum,(c),int c)
{
return((_ctype_ + 1)[c] & (_U|_L|_N));
}
|