diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-16 00:39:44 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-16 00:39:44 +0800 |
commit | e72e1b5e84b76761878f3099f772597b6a23f558 (patch) | |
tree | 8eceb1e28daacdb6bd46d05c8f6dd74d218be560 /include | |
parent | dfeaae1c3095de44306a00562c041fa8b090e64d (diff) | |
download | pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar.gz pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar.bz2 pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar.lz pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar.xz pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.tar.zst pttbbs-e72e1b5e84b76761878f3099f772597b6a23f558.zip |
O(1) key-func mapping in i_read_key
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1410 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r-- | include/pttstruct.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h index 0c3a18cc..3c547901 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -305,10 +305,10 @@ typedef struct { int num, page, now, level; } menu_t; -typedef struct onekey_t { /* Used to pass commands to the readmenu */ - int key; - int (*fptr)(); -} onekey_t; +/* Used to pass commands to the readmenu. + * direct mapping, indexed by ascii code. */ +#define onekey_size ((int) 'z') +typedef int (* onekey_t)(); #define ANSILINELEN (511) /* Maximum Screen width in chars */ |