]> diplodocus.org Git - nmh/blob - sbr/ctype-checked.h
Alter mh-chart(7)'s NAME to be lowercase.
[nmh] / sbr / ctype-checked.h
1 /* sbr/ctype-checked.h
2 *
3 * This code is Copyright (c) 2016, by the authors of nmh.
4 * See the COPYRIGHT file in the root directory of the nmh
5 * distribution for complete copyright information. */
6
7 #ifndef CTYPE_CHECKED_H
8 #define CTYPE_CHECKED_H
9 #include <ctype.h>
10
11 extern int ctype_identity[257];
12
13 #define CTYPE_CHECK(f, c) ((f)((ctype_identity + 1)[c]))
14
15 #ifdef isalnum
16 #undef isalnum
17 #endif
18 #define isalnum(c) CTYPE_CHECK(isalnum, c)
19
20 #ifdef isalpha
21 #undef isalpha
22 #endif
23 #define isalpha(c) CTYPE_CHECK(isalpha, c)
24
25 #ifdef iscntrl
26 #undef iscntrl
27 #endif
28 #define iscntrl(c) CTYPE_CHECK(iscntrl, c)
29
30 #ifdef isdigit
31 #undef isdigit
32 #endif
33 #define isdigit(c) CTYPE_CHECK(isdigit, c)
34
35 #ifdef isgraph
36 #undef isgraph
37 #endif
38 #define isgraph(c) CTYPE_CHECK(isgraph, c)
39
40 #ifdef islower
41 #undef islower
42 #endif
43 #define islower(c) CTYPE_CHECK(islower, c)
44
45 #ifdef isprint
46 #undef isprint
47 #endif
48 #define isprint(c) CTYPE_CHECK(isprint, c)
49
50 #ifdef ispunct
51 #undef ispunct
52 #endif
53 #define ispunct(c) CTYPE_CHECK(ispunct, c)
54
55 #ifdef isspace
56 #undef isspace
57 #endif
58 #define isspace(c) CTYPE_CHECK(isspace, c)
59
60 #ifdef isupper
61 #undef isupper
62 #endif
63 #define isupper(c) CTYPE_CHECK(isupper, c)
64
65 #ifdef isxdigit
66 #undef isxdigit
67 #endif
68 #define isxdigit(c) CTYPE_CHECK(isxdigit, c)
69
70 #ifdef tolower
71 #undef tolower
72 #endif
73 #define tolower(c) CTYPE_CHECK(tolower, c)
74
75 #ifdef toupper
76 #undef toupper
77 #endif
78 #define toupper(c) CTYPE_CHECK(toupper, c)
79
80 #ifdef isascii
81 #undef isascii
82 #endif
83 #define isascii(c) CTYPE_CHECK(isascii, c)
84
85 #ifdef toascii
86 #undef toascii
87 #endif
88 #define toascii(c) CTYPE_CHECK(toascii, c)
89
90 #ifdef isblank
91 #undef isblank
92 #endif
93 #define isblank(c) CTYPE_CHECK(isblank, c)
94
95 #endif