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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [ctype/] [isdigit.c] - Diff between revs 1005 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1005 Rev 1765
/*
/*
FUNCTION
FUNCTION
<<isdigit>>---decimal digit predicate
<<isdigit>>---decimal digit predicate
 
 
INDEX
INDEX
isdigit
isdigit
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
#include <ctype.h>
#include <ctype.h>
int isdigit(int <[c]>);
int isdigit(int <[c]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
#include <ctype.h>
#include <ctype.h>
int isdigit(<[c]>);
int isdigit(<[c]>);
 
 
DESCRIPTION
DESCRIPTION
<<isdigit>> is a macro which classifies ASCII integer values by table
<<isdigit>> is a macro which classifies ASCII integer values by table
lookup.  It is a predicate returning non-zero for decimal digits, and 0 for
lookup.  It is a predicate returning non-zero for decimal digits, and 0 for
other characters.  It is defined only when <<isascii>>(<[c]>) is true
other characters.  It is defined only when <<isascii>>(<[c]>) is true
or <[c]> is EOF.
or <[c]> is EOF.
 
 
You can use a compiled subroutine instead of the macro definition by
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isdigit>>'.
undefining the macro using `<<#undef isdigit>>'.
 
 
RETURNS
RETURNS
<<isdigit>> returns non-zero if <[c]> is a decimal digit (<<0>>--<<9>>).
<<isdigit>> returns non-zero if <[c]> is a decimal digit (<<0>>--<<9>>).
 
 
PORTABILITY
PORTABILITY
<<isdigit>> is ANSI C.
<<isdigit>> is ANSI C.
 
 
No supporting OS subroutines are required.
No supporting OS subroutines are required.
*/
*/
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <ctype.h>
#include <ctype.h>
 
 
 
 
#undef isdigit
#undef isdigit
int
int
_DEFUN(isdigit,(c),int c)
_DEFUN(isdigit,(c),int c)
{
{
        return((_ctype_ + 1)[c] & _N);
        return((_ctype_ + 1)[c] & _N);
}
}
 
 

powered by: WebSVN 2.1.0

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