Subversion Repositories Kolibri OS

Rev

Rev 4874 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4349 Serge 1
 
2
FUNCTION
3
	<>, <>---printable character predicates
4
5
 
6
	isprint
7
INDEX
8
	isgraph
9
10
 
11
	#include 
12
	int isprint(int <[c]>);
13
	int isgraph(int <[c]>);
14
15
 
16
	#include 
17
	int isprint(<[c]>);
18
	int isgraph(<[c]>);
19
20
 
21
 
22
<> is a macro which classifies ASCII integer values by table
23
lookup.  It is a predicate returning non-zero for printable
24
characters, and 0 for other character arguments.
25
It is defined only if <[c]> is representable as an unsigned char or if
4921 Serge 26
<[c]> is EOF.
27
4349 Serge 28
 
29
undefining either macro using `<<#undef isprint>>' or `<<#undef isgraph>>'.
30
31
 
32
<> returns non-zero if <[c]> is a printing character,
33
(<<0x20>>--<<0x7E>>).
34
<> behaves identically to <>, except that the space
35
character (<<0x20>>) is excluded.
36
37
 
38
<> and <> are ANSI C.
39
40
 
41
*/
42
43
 
44
#include 
45
46
 
47
int
48
_DEFUN(isgraph,(c),int c)
49
{
50
	return(__ctype_ptr__[c+1] & (_P|_U|_L|_N));
51
}
52
53
 
54
 
55
int
56
_DEFUN(isprint,(c),int c)
57
{
58
	return(__ctype_ptr__[c+1] & (_P|_U|_L|_N|_B));
59
}
60