diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-02-07 01:17:59 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-02-07 01:17:59 +0000 |
commit | 6294cca6f9bc910b224393e38e3c09eeb821fcb7 (patch) | |
tree | ee6f17b08d778eb2bbdbe1e5c30645363bb8b241 /termkey.h | |
parent | a503403226e4e2a929efddd4a2d0daad9c33c596 (diff) | |
download | termo-6294cca6f9bc910b224393e38e3c09eeb821fcb7.tar.gz termo-6294cca6f9bc910b224393e38e3c09eeb821fcb7.tar.xz termo-6294cca6f9bc910b224393e38e3c09eeb821fcb7.zip |
Denote general status with return codes, not special key symbols
Diffstat (limited to 'termkey.h')
-rw-r--r-- | termkey.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -5,9 +5,8 @@ #include <stdlib.h> typedef enum { - TERMKEY_SYM_EOF = -1, // Stream closed - TERMKEY_SYM_UNKNOWN = -2, - TERMKEY_SYM_NONE = 0, // Did not find a key + TERMKEY_SYM_UNKNOWN = -1, + TERMKEY_SYM_NONE = 0, // Special names in C0 TERMKEY_SYM_BACKSPACE, @@ -68,7 +67,13 @@ typedef enum { TERMKEY_SYM_KPEQUALS, // et cetera ad nauseum -} termkey_sym_e; +} termkey_sym; + +typedef enum { + TERMKEY_RES_NONE, + TERMKEY_RES_KEY, + TERMKEY_RES_EOF, +} termkey_result; enum { TERMKEY_KEYFLAG_SPECIAL = 0x01, // 'code' is a special keycode, not a unicode codepoint @@ -100,8 +105,8 @@ enum { termkey_t *termkey_new(int fd, int flags); void termkey_free(termkey_t *tk); -int termkey_getkey(termkey_t *tk, termkey_key *key); -int termkey_waitkey(termkey_t *tk, termkey_key *key); +termkey_result termkey_getkey(termkey_t *tk, termkey_key *key); +termkey_result termkey_waitkey(termkey_t *tk, termkey_key *key); void termkey_pushinput(termkey_t *tk, unsigned char *input, size_t inputlen); |