Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 45 lines (36 sloc) 1.325 kb
6335386 @mbert Import Elvis 1.8 (written by Steve Kirkendall)
authored
1 /* ctype.h */
2
3 /* This file contains macros definitions and extern declarations for a
4 * version of <ctype.h> which is aware of the o_flipcase letters used in
5 * elvis.
6 *
7 * This file uses the "uchar" data type and "UCHAR" conversion macro which
8 * are defined in "config.h". Consequently, any file that includes this
9 * header must include config.h first.
10 */
11
12 #ifndef _CT_UPPER
13
14 #define _CT_UPPER 0x01
15 #define _CT_LOWER 0x02
16 #define _CT_SPACE 0x04
17 #define _CT_DIGIT 0x08
18 #define _CT_ALNUM 0x10
19 #define _CT_CNTRL 0x20
20
21 #define isalnum(c) (_ct_ctypes[UCHAR(c)] & _CT_ALNUM)
22 #define isalpha(c) (_ct_ctypes[UCHAR(c)] & (_CT_LOWER|_CT_UPPER))
23 #define isdigit(c) (_ct_ctypes[UCHAR(c)] & _CT_DIGIT)
24 #define islower(c) (_ct_ctypes[UCHAR(c)] & _CT_LOWER)
25 #define isspace(c) (_ct_ctypes[UCHAR(c)] & _CT_SPACE)
26 #define isupper(c) (_ct_ctypes[UCHAR(c)] & _CT_UPPER)
27 #define iscntrl(c) (_ct_ctypes[UCHAR(c)] & _CT_CNTRL)
28 #define ispunct(c) (!_ct_ctypes[UCHAR(c)]) /* punct = "none of the above" */
29
30 #define isascii(c) (!((c) & 0x80))
31
32 #define toupper(c) _ct_toupper[UCHAR(c)]
33 #define tolower(c) _ct_tolower[UCHAR(c)]
34
35 extern uchar _ct_toupper[];
36 extern uchar _ct_tolower[];
37 extern uchar _ct_ctypes[];
38 #ifdef P_
39 extern void _ct_init P_((uchar *));
40 #else
41 extern void _ct_init(/* uchar *flipcase */);
42 #endif
43
44 #endif /* ndef _CT_UPPER */
Something went wrong with that request. Please try again.