aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-06-09 08:51:48 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-06-09 09:00:25 +0000
commite030a2ca08d92eb431e9b8e494c63affeeb8c0e1 (patch)
treece71ee2fa54457c89e674dfb913cded9f7e9cef2 /terminal.h
parentchangelog: add issue links for previous 2 entries (diff)
terminal: add 'charset_designator' enum to make code more self-documenting
This commit also renames the term_set_single_shift_ascii_printer() function to term_single_shift(), since the former is overly verbose and not really even accurate.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/terminal.h b/terminal.h
index a54185e2..b96621fd 100644
--- a/terminal.h
+++ b/terminal.h
@@ -189,10 +189,11 @@ enum cursor_origin { ORIGIN_ABSOLUTE, ORIGIN_RELATIVE };
enum cursor_keys { CURSOR_KEYS_DONTCARE, CURSOR_KEYS_NORMAL, CURSOR_KEYS_APPLICATION };
enum keypad_keys { KEYPAD_DONTCARE, KEYPAD_NUMERICAL, KEYPAD_APPLICATION };
enum charset { CHARSET_ASCII, CHARSET_GRAPHIC };
+enum charset_designator { G0, G1, G2, G3 };
struct charsets {
- int selected;
- int saved;
+ enum charset_designator selected;
+ enum charset_designator saved;
enum charset set[4]; /* G0-G3 */
};
@@ -606,7 +607,7 @@ bool term_shutdown(struct terminal *term);
int term_destroy(struct terminal *term);
void term_update_ascii_printer(struct terminal *term);
-void term_set_single_shift_ascii_printer(struct terminal *term, int selected);
+void term_single_shift(struct terminal *term, enum charset_designator idx);
void term_reset(struct terminal *term, bool hard);
bool term_to_slave(struct terminal *term, const void *data, size_t len);