diff options
author | Curtis McEnroe | 2018-09-02 16:13:00 -0400 |
---|---|---|
committer | Curtis McEnroe | 2018-09-02 16:13:00 -0400 |
commit | 240f9ebf8445c6e9a569b40876db0681ffc8a1d0 (patch) | |
tree | 63dbb1ae562c3eec80d46d0eba85a8ea11086f85 /term.c | |
parent | ccb54d36d93d22b00858a167beb6e0f728986b7a (diff) |
Use PascalCase for constants
Begone underscores.
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/term.c b/term.c index 4f62d20..0b35499 100644 --- a/term.c +++ b/term.c @@ -42,27 +42,28 @@ static void privateMode(const char *mode, bool set) { void termMode(enum TermMode mode, bool set) { switch (mode) { - break; case TERM_FOCUS: privateMode("1004", set); - break; case TERM_PASTE: privateMode("2004", set); + break; case TermFocus: privateMode("1004", set); + break; case TermPaste: privateMode("2004", set); } } -#define ESC '\33' #define T(s, i) ((s) << 8 | (i)) +enum { Esc = '\33' }; + enum TermEvent termEvent(char ch) { static int state = 0; switch (T(state, ch)) { - case T(0, ESC): state = 1; return 0; + case T(0, Esc): state = 1; return 0; case T(1, '['): state = 2; return 0; - case T(2, 'I'): state = 0; return TERM_FOCUS_IN; - case T(2, 'O'): state = 0; return TERM_FOCUS_OUT; + case T(2, 'I'): state = 0; return TermFocusIn; + case T(2, 'O'): state = 0; return TermFocusOut; case T(2, '2'): state = 3; return 0; case T(3, '0'): state = 4; return 0; case T(4, '0'): state = 5; return 0; - case T(5, '~'): state = 0; return TERM_PASTE_START; + case T(5, '~'): state = 0; return TermPasteStart; case T(4, '1'): state = 6; return 0; - case T(6, '~'): state = 0; return TERM_PASTE_END; + case T(6, '~'): state = 0; return TermPasteEnd; default: state = 0; return 0; } } |