1 /* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Edward Wang at The University of California, Berkeley. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)char.h 8.1 (Berkeley) 06/06/93 11 */ 12 13 /* 14 * Macros and things to deal with control characters. 15 * 16 * Unctrl() is just like the standard function, except we don't want 17 * to include curses. 18 * Isctrl() returns true for all characters less than space and 19 * greater than or equal to delete. 20 * Isprt() is tab and all characters not isctrl(). It's used 21 * by wwwrite(). 22 * Isunctrl() includes all characters that should be expanded 23 * using unctrl() by wwwrite() if ww_unctrl is set. 24 */ 25 26 extern char *_unctrl[]; 27 extern char _cmap[]; 28 #define ctrl(c) (c & 0x1f) 29 #define unctrl(c) (_unctrl[(unsigned char) (c)]) 30 #define _C 0x01 31 #define _P 0x02 32 #define _U 0x04 33 #define isctrl(c) (_cmap[(unsigned char) (c)] & _C) 34 #define isprt(c) (_cmap[(unsigned char) (c)] & _P) 35 #define isunctrl(c) (_cmap[(unsigned char) (c)] & _U) 36