=== modified file 'termkey.c' --- termkey.c 2008-02-10 17:41:13 +0000 +++ termkey.c 2008-02-10 17:34:05 +0000 @@ -19,12 +19,12 @@ const char **keynames; // There are 64 codes 0x40 - 0x7F - termkey_keysym csi_ss3s[64]; - termkey_keysym ss3s[64]; + int csi_ss3s[64]; + int ss3s[64]; char ss3_kpalts[64]; int ncsifuncs; - termkey_keysym *csifuncs; + int *csifuncs; }; termkey_t *termkey_new_full(int fd, int flags, size_t buffsize) @@ -581,7 +581,7 @@ termkey_pushinput(tk, buffer, len); } -const char *termkey_describe_sym(termkey_t *tk, termkey_keysym code) +const char *termkey_describe_sym(termkey_t *tk, int code) { if(code == TERMKEY_SYM_UNKNOWN) return "UNKNOWN"; @@ -592,7 +592,7 @@ return "UNKNOWN"; } -termkey_keysym termkey_register_keyname(termkey_t *tk, termkey_keysym code, const char *name) +int termkey_register_keyname(termkey_t *tk, int code, const char *name) { if(!code) code = tk->nkeynames; @@ -613,7 +613,7 @@ return code; } -termkey_keysym termkey_register_csi_ss3(termkey_t *tk, termkey_keysym code, unsigned char cmd, const char *name) +int termkey_register_csi_ss3(termkey_t *tk, int code, unsigned char cmd, const char *name) { if(cmd < 0x40 || cmd >= 0x80) { fprintf(stderr, "Cannot register CSI/SS3 key at cmd 0x%02x - out of bounds\n", cmd); @@ -628,7 +628,7 @@ return code; } -termkey_keysym termkey_register_ss3kpalt(termkey_t *tk, termkey_keysym code, unsigned char cmd, const char *name, char kpalt) +int termkey_register_ss3kpalt(termkey_t *tk, int code, unsigned char cmd, const char *name, char kpalt) { if(cmd < 0x40 || cmd >= 0x80) { fprintf(stderr, "Cannot register SS3 key at cmd 0x%02x - out of bounds\n", cmd); @@ -644,13 +644,13 @@ return code; } -termkey_keysym termkey_register_csifunc(termkey_t *tk, termkey_keysym code, int number, const char *name) +int termkey_register_csifunc(termkey_t *tk, int code, int number, const char *name) { if(name) code = termkey_register_keyname(tk, code, name); if(number >= tk->ncsifuncs) { - termkey_keysym *new_csifuncs = realloc(tk->csifuncs, sizeof(new_csifuncs[0]) * (number + 1)); + int *new_csifuncs = realloc(tk->csifuncs, sizeof(new_csifuncs[0]) * (number + 1)); tk->csifuncs = new_csifuncs; // Fill in the hole === modified file 'termkey.h' --- termkey.h 2008-02-10 17:41:13 +0000 +++ termkey.h 2008-02-09 19:30:37 +0000 @@ -85,11 +85,9 @@ TERMKEY_KEYMOD_CTRL = 0x04, }; -typedef int termkey_keysym; - typedef struct { int modifiers; - termkey_keysym code; // Or Unicode codepoint + int code; int flags; /* Any Unicode character can be UTF-8 encoded in no more than 6 bytes, plus @@ -117,13 +115,13 @@ void termkey_advisereadable(termkey_t *tk); // Registration of keys and names -termkey_keysym termkey_register_keyname(termkey_t *tk, termkey_keysym code, const char *name); - -termkey_keysym termkey_register_csi_ss3(termkey_t *tk, termkey_keysym code, unsigned char cmd, const char *name); -termkey_keysym termkey_register_ss3kpalt(termkey_t *tk, termkey_keysym code, unsigned char cmd, const char *name, char kpalt); -termkey_keysym termkey_register_csifunc(termkey_t *tk, termkey_keysym code, int number, const char *name); - - -const char *termkey_describe_sym(termkey_t *tk, termkey_keysym code); +int termkey_register_keyname(termkey_t *tk, int code, const char *name); + +int termkey_register_csi_ss3(termkey_t *tk, int code, unsigned char cmd, const char *name); +int termkey_register_ss3kpalt(termkey_t *tk, int code, unsigned char cmd, const char *name, char kpalt); +int termkey_register_csifunc(termkey_t *tk, int code, int number, const char *name); + + +const char *termkey_describe_sym(termkey_t *tk, int code); #endif