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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [ctype/] [ispunct.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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