From 36bc6cd0952b2eddc17e7da803d85decf96d32cc Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sun, 28 Sep 2014 03:51:45 +0200 Subject: Move to iconv That is the major change in this commit. Also Ctrl-modified keys now should work in URxvt, which was surprisingly trivial to achieve. Coming up next: - making sure the tests still work - introducing CMake --- termkey-internal.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'termkey-internal.h') diff --git a/termkey-internal.h b/termkey-internal.h index cd7e6d7..7282454 100644 --- a/termkey-internal.h +++ b/termkey-internal.h @@ -5,6 +5,8 @@ #include #include +#include +#include typedef struct termkey_driver termkey_driver_t; struct termkey_driver @@ -40,29 +42,30 @@ struct termkey int fd; int flags; int canonflags; + unsigned char *buffer; size_t buffstart; // First offset in buffer - size_t buffcount; // NUMBER of entires valid in buffer + size_t buffcount; // Number of entires valid in buffer size_t buffsize; // Total malloc'ed size - // Position beyond buffstart at which peekkey() should next start - // normally 0, but see also termkey_interpret_csi(). + // Position beyond buffstart at which peekkey() should next start. + // Normally 0, but see also termkey_interpret_csi(). size_t hightide; struct termios restore_termios; - char restore_termios_valid; + bool restore_termios_valid; - int waittime; // msec + int waittime; // In milliseconds - char is_closed; - char is_started; + bool is_closed; // We've received EOF + bool is_started; int nkeynames; const char **keynames; - // There are 32 C0 codes - keyinfo_t c0[32]; - + keyinfo_t c0[32]; // There are 32 C0 codes + iconv_t to_utf32_conv; + iconv_t from_utf32_conv; termkey_driver_node_t *drivers; // Now some "protected" methods for the driver to call but which we don't @@ -70,7 +73,7 @@ struct termkey struct { void (*emit_codepoint) (termkey_t *tk, - long codepoint, termkey_key_t *key); + uint32_t codepoint, termkey_key_t *key); termkey_result_t (*peekkey_simple) (termkey_t *tk, termkey_key_t *key, int force, size_t *nbytes); termkey_result_t (*peekkey_mouse) (termkey_t *tk, -- cgit v1.2.3-54-g00ecf