xref: /original-bsd/lib/libc/locale/isctype.c (revision 08eb28af)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #if defined(LIBC_SCCS) && !defined(lint)
9 static char sccsid[] = "@(#)isctype.c	5.2 (Berkeley) 06/01/90";
10 #endif /* LIBC_SCCS and not lint */
11 
12 #define _ANSI_LIBRARY
13 #include <ctype.h>
14 
15 #undef isalnum
16 isalnum(c)
17 	int c;
18 {
19 	return((_ctype_ + 1)[c] & (_U|_L|_N));
20 }
21 
22 #undef isalpha
23 isalpha(c)
24 	int c;
25 {
26 	return((_ctype_ + 1)[c] & (_U|_L));
27 }
28 
29 #undef iscntrl
30 iscntrl(c)
31 	int c;
32 {
33 	return((_ctype_ + 1)[c] & _C);
34 }
35 
36 #undef isdigit
37 isdigit(c)
38 	int c;
39 {
40 	return((_ctype_ + 1)[c] & _N);
41 }
42 
43 #undef isgraph
44 isgraph(c)
45 	int c;
46 {
47 	return((_ctype_ + 1)[c] & (_P|_U|_L|_N));
48 }
49 
50 #undef islower
51 islower(c)
52 	int c;
53 {
54 	return((_ctype_ + 1)[c] & _L);
55 }
56 
57 #undef isprint
58 isprint(c)
59 	int c;
60 {
61 	return((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B));
62 }
63 
64 #undef ispunct
65 ispunct(c)
66 	int c;
67 {
68 	return((_ctype_ + 1)[c] & _P);
69 }
70 
71 #undef isspace
72 isspace(c)
73 	int c;
74 {
75 	return((_ctype_ + 1)[c] & _S);
76 }
77 
78 #undef isupper
79 isupper(c)
80 	int c;
81 {
82 	return((_ctype_ + 1)[c] & _U);
83 }
84 
85 #undef isxdigit
86 isxdigit(c)
87 	int c;
88 {
89 	return((_ctype_ + 1)[c] & (_N|_X));
90 }
91 
92 #undef tolower
93 tolower(c)
94 	int c;
95 {
96 	return((c) - 'A' + 'a');
97 }
98 
99 #undef toupper
100 toupper(c)
101 	int c;
102 {
103 	return((c) - 'a' + 'A');
104 }
105