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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [ctype/] [isdigit.c] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
/*
2
FUNCTION
3
<<isdigit>>---decimal digit predicate
4
 
5
INDEX
6
isdigit
7
 
8
ANSI_SYNOPSIS
9
#include <ctype.h>
10
int isdigit(int <[c]>);
11
 
12
TRAD_SYNOPSIS
13
#include <ctype.h>
14
int isdigit(<[c]>);
15
 
16
DESCRIPTION
17
<<isdigit>> is a macro which classifies ASCII integer values by table
18
lookup.  It is a predicate returning non-zero for decimal digits, and 0 for
19
other characters.  It is defined only when <<isascii>>(<[c]>) is true
20
or <[c]> is EOF.
21
 
22
You can use a compiled subroutine instead of the macro definition by
23
undefining the macro using `<<#undef isdigit>>'.
24
 
25
RETURNS
26
<<isdigit>> returns non-zero if <[c]> is a decimal digit (<<0>>--<<9>>).
27
 
28
PORTABILITY
29
<<isdigit>> is ANSI C.
30
 
31
No supporting OS subroutines are required.
32
*/
33
 
34
#include <_ansi.h>
35
#include <ctype.h>
36
 
37
 
38
#undef isdigit
39
int
40
_DEFUN(isdigit,(c),int c)
41
{
42
        return((_ctype_ + 1)[c] & _N);
43
}

powered by: WebSVN 2.1.0

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