Subversion Repositories Kolibri OS

Rev

Rev 4874 | Details | Compare with Previous | Last modification | View Log | RSS feed

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