Commit | Line | Data |
---|---|---|
d5d80ef9 | 1 | /* |
7edc52ec | 2 | * @(#)char.h 3.2 %G% |
d5d80ef9 EW |
3 | */ |
4 | ||
5 | /* | |
6 | * Macros and things to deal with control characters. | |
7 | * | |
8 | * Unctrl() is just like the standard function, except we don't want | |
9 | * to include curses. | |
10 | * Isctrl() returns true for all characters less than space and | |
11 | * greater than or equal to delete. | |
12 | * Isprt() is tab and all characters not isctrl(). It's used | |
13 | * by wwwrite(). | |
14 | * Isunctrl() includes all characters that should be expanded | |
15 | * using unctrl() by wwwrite() if ww_unctrl is set. | |
16 | */ | |
17 | ||
18 | char *_unctrl[]; | |
19 | char _cmap[]; | |
20 | #define ctrl(c) ('c' & 0x1f) | |
21 | #define unctrl(c) (_unctrl[(unsigned char) (c)]) | |
22 | #define _C 0x01 | |
23 | #define _P 0x02 | |
24 | #define _U 0x04 | |
25 | #define isctrl(c) (_cmap[(unsigned char) (c)] & _C) | |
26 | #define isprt(c) (_cmap[(unsigned char) (c)] & _P) | |
27 | #define isunctrl(c) (_cmap[(unsigned char) (c)] & _U) |