From e72e1b5e84b76761878f3099f772597b6a23f558 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 15 Dec 2003 16:39:44 +0000 Subject: 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 --- include/pttstruct.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/pttstruct.h') 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 */ -- cgit v1.2.3