summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-08-12 12:37:54 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-08-12 12:37:54 -0400
commita9860417f53216a2f3b0b490afec46ab5db70181 (patch)
tree6dd9d598a78ff644a9b645ded415ec3f84bba53f /sux.h
parentd49e39c672e78d536d658785adffb9149715832b (diff)
- 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.
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sux.h b/sux.h
index 75337c9..b729550 100644
--- a/sux.h
+++ b/sux.h
@@ -2,6 +2,7 @@
#include <pthread.h>
#include <ctype.h>
#include <string.h>
+#include <limits.h>
#if bench
#include <sys/time.h>
@@ -27,7 +28,6 @@ extern uint8_t subdbg;
static const uint64_t mem_size = 0x04000000; /* Size of address space. */
extern uint8_t step;
-extern uint8_t esc;
extern uint8_t end;
#define setflag(flag, bit) ((flag)) ? (cpu->ps.u8[thread] |= bit) : (cpu->ps.u8[thread] &= ~bit)