OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-newlib/] [newlib-1.17.0/] [newlib/] [libc/] [ctype/] [isalnum.c] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jlechner
/*
2
FUNCTION
3
        <<isalnum>>---alphanumeric character predicate
4
 
5
INDEX
6
        isalnum
7
 
8
ANSI_SYNOPSIS
9
        #include <ctype.h>
10
        int isalnum(int <[c]>);
11
 
12
TRAD_SYNOPSIS
13
        #include <ctype.h>
14
        int isalnum(<[c]>);
15
 
16
 
17
DESCRIPTION
18
<<isalnum>> 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
21
for all integer values.
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
<<isalnum>> returns non-zero if <[c]> is a letter (<<a>>--<<z>> or
28
<<A>>--<<Z>>) or a digit (<<0>>--<<9>>).
29
 
30
PORTABILITY
31
<<isalnum>> is ANSI C.
32
 
33
No OS subroutines are required.
34
*/
35
 
36
#include <_ansi.h>
37
#include <ctype.h>
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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.