From a9860417f53216a2f3b0b490afec46ab5db70181 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 12 Aug 2020 12:37:54 -0400 Subject: - Refactored the escape sequence parsing, and handling. It now uses a struct to store the escape sequence. Before it handles the escape sequence, it parses it, which includes things like getting any arguments that are supplied, and getting the mode type. - Moved the code that handles control codes to a separate function. The reason for doing this was because I wanted to make the escape sequence handling faster, but also make the code more readable at the same time. I got the idea to do this from st, a terminal emulator created by the suckless.org project. --- sux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sux.c') diff --git a/sux.c b/sux.c index 3082632..d26118d 100644 --- a/sux.c +++ b/sux.c @@ -27,7 +27,6 @@ pthread_cond_t main_cond = PTHREAD_COND_INITIALIZER; uint8_t threads_done = 0; uint8_t step = 0; -uint8_t esc = 0; uint8_t *addr; @@ -621,12 +620,12 @@ int main(int argc, char **argv) { pthread_mutex_lock(&main_mutex); pthread_cond_wait(&main_cond, &main_mutex); pthread_mutex_unlock(&main_mutex); - #if keypoll + /*#if keypoll pthread_mutex_lock(&mutex); #endif #if keypoll pthread_mutex_unlock(&mutex); - #endif + #endif*/ #else pthread_mutex_lock(&main_mutex); pthread_cond_wait(&main_cond, &main_mutex); -- cgit v1.2.3-13-gbd6f