|
|
1.1 root 1: /*
2: * Copyright (c) 1989 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that: (1) source distributions retain this entire copyright
7: * notice and comment, and (2) distributions including binaries display
8: * the following acknowledgement: ``This product includes software
9: * developed by the University of California, Berkeley and its contributors''
10: * in the documentation or other materials provided with the distribution
11: * and in all advertising materials mentioning features or use of this
12: * software. Neither the name of the University nor the names of its
13: * contributors may be used to endorse or promote products derived
14: * from this software without specific prior written permission.
15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18: *
19: * @(#)ctype.h 5.2 (Berkeley) 6/1/90
20: */
21:
22: #define _U 0x01
23: #define _L 0x02
24: #define _N 0x04
25: #define _S 0x08
26: #define _P 0x10
27: #define _C 0x20
28: #define _X 0x40
29: #define _B 0x80
30:
31: extern char _ctype_[];
32:
33: #define isdigit(c) ((_ctype_ + 1)[c] & _N)
34: #define islower(c) ((_ctype_ + 1)[c] & _L)
35: #define isspace(c) ((_ctype_ + 1)[c] & _S)
36: #define ispunct(c) ((_ctype_ + 1)[c] & _P)
37: #define isupper(c) ((_ctype_ + 1)[c] & _U)
38: #define isalpha(c) ((_ctype_ + 1)[c] & (_U|_L))
39: #define isxdigit(c) ((_ctype_ + 1)[c] & (_N|_X))
40: #define isalnum(c) ((_ctype_ + 1)[c] & (_U|_L|_N))
41: #define isprint(c) ((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B))
42: #define isgraph(c) ((_ctype_ + 1)[c] & (_P|_U|_L|_N))
43: #define iscntrl(c) ((_ctype_ + 1)[c] & _C)
44: #define isascii(c) ((unsigned)(c) <= 0177)
45: #define toupper(c) ((c) - 'a' + 'A')
46: #define tolower(c) ((c) - 'A' + 'a')
47: #define toascii(c) ((c) & 0177)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.