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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [ctype/] [iscntrl.c] - Blame information for rev 1775

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

Line No. Rev Author Line
1 39 lampret
 
2
/*
3
FUNCTION
4
        <<iscntrl>>---control character predicate
5
 
6
INDEX
7
        iscntrl
8
 
9
ANSI_SYNOPSIS
10
        #include <ctype.h>
11
        int iscntrl(int <[c]>);
12
 
13
TRAD_SYNOPSIS
14
        #include <ctype.h>
15
        int iscntrl(<[c]>);
16
 
17
DESCRIPTION
18
<<iscntrl>> is a macro which classifies ASCII integer values by table
19
lookup.  It is a predicate returning non-zero for control characters, and 0
20
for other characters.  It is defined only when <<isascii>>(<[c]>) is
21
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 iscntrl>>'.
25
 
26
RETURNS
27
<<iscntrl>> returns non-zero if <[c]> is a delete character or ordinary
28
control character (<<0x7F>> or <<0x00>>--<<0x1F>>).
29
 
30
PORTABILITY
31
<<iscntrl>> is ANSI C.
32
 
33
No supporting OS subroutines are required.
34
*/
35
 
36
#include <_ansi.h>
37
#include <ctype.h>
38
 
39
 
40
 
41
#undef iscntrl
42
int
43
_DEFUN(iscntrl,(c),int c)
44
{
45
        return((_ctype_ + 1)[c] & _C);
46
}
47
 
48
 

powered by: WebSVN 2.1.0

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