diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-13 08:55:09 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-13 08:55:09 +0800 |
commit | af8f62d5f4f18a60ad4230b38a74e1f26f71ce30 (patch) | |
tree | 55cc2b0ac5c3b9d8d8c97786ef04b5886232d02d /mbbsd/screen.c | |
parent | 3037e00cf92dbe072c02ab46e930007fef201d54 (diff) | |
download | pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar.gz pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar.bz2 pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar.lz pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar.xz pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.tar.zst pttbbs-af8f62d5f4f18a60ad4230b38a74e1f26f71ce30.zip |
- enable ncurses 'typeahead' API
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3832 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r-- | mbbsd/screen.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 5eee18e4..25ec5c22 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -13,6 +13,7 @@ static unsigned short cur_ln = 0, cur_col = 0; static unsigned char docls; static unsigned char standing = NA; static int scrollcnt, tc_col, tc_line; +static unsigned char _typeahead = 1; #define MODIFIED (1) /* if line has been modifed, screen output */ #define STANDOUT (2) /* if this line has a standout region */ @@ -205,10 +206,28 @@ redrawwin(void) oflush(); } +int +typeahead(int fd) +{ + switch(fd) + { + case TYPEAHEAD_NONE: + _typeahead = 0; + break; + case TYPEAHEAD_STDIN: + _typeahead = 1; + break; + default: // shall never reach here + assert(NULL); + break; + } + return 0; +} + void refresh(void) { - if (num_in_buf()) + if (num_in_buf() && _typeahead) return; doupdate(); } |