diff options
Diffstat (limited to 'escape.h')
-rw-r--r-- | escape.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -34,6 +34,27 @@ enum esc_state { //escape followed by an escape, has to be user generated DOUBLE_ESC, }; + +//returns 1 if the current state is safe to insert characters after, 0 if not +int safe_state(enum esc_state state) { + swtich (state) { + case CSI_END: + case ST: + case nF_END: + case C0: + case C1: + case DECSC: + case DECRC: + case DOUBLE_ESC: + case NORMAL: + return 1; + break; + default: + return 0; + break; + } +} + //global stdin -> pty ESC state enum esc_state in_state = NORMAL; //global pty -> stdout ESC state |