1 /* chardefs.h -- Character definitions for readline. */
5 #define savestring(x) (char *)strcpy (xmalloc (1 + strlen (x)), (x))
9 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
16 /* Some character stuff. */
17 #define control_character_threshold 0x020 /* smaller than this is control */
18 #define meta_character_threshold 0x07f /* larger than this is Meta. */
19 #define control_character_bit 0x40 /* 0x000000, must be off. */
20 #define meta_character_bit 0x080 /* x0000000, must be on. */
22 #define CTRL(c) ((c) & (~control_character_bit))
23 #define META(c) ((c) | meta_character_bit)
25 #define UNMETA(c) ((c) & (~meta_character_bit))
26 #define UNCTRL(c) to_upper(((c)|control_character_bit))
28 #define lowercase_p(c) (((c) > ('a' - 1) && (c) < ('z' + 1)))
29 #define uppercase_p(c) (((c) > ('A' - 1) && (c) < ('Z' + 1)))
31 #define pure_alphabetic(c) (lowercase_p(c) || uppercase_p(c))
34 #define to_upper(c) (lowercase_p(c) ? ((c) - 32) : (c))
35 #define to_lower(c) (uppercase_p(c) ? ((c) + 32) : (c))
38 #define CTRL_P(c) ((c) < control_character_threshold)
39 #define META_P(c) ((c) > meta_character_threshold)
42 #define RETURN CTRL('M')
45 #define ABORT_CHAR CTRL('G')
46 #define PAGE CTRL('L')
50 #endif /* _CHARDEFS_ */