summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-27 17:13:25 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-27 17:13:25 +0800
commit7fb50c3a816f8b243e387dd903df6fbd732735d3 (patch)
tree1d64a28cd87a251048652b27299fab8abcd6aa2c /mbbsd/io.c
parent47e1682c7ad6d559f46b49d525423479d7d78316 (diff)
downloadpttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.gz
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.bz2
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.lz
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.xz
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.tar.zst
pttbbs-7fb50c3a816f8b243e387dd903df6fbd732735d3.zip
- many small revise
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4487 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index c3a7f5e4..375d1a6d 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -31,7 +31,7 @@ static unsigned long szTotalOutput = 0, szLastOutput = 0;
extern unsigned char fakeEscape;
unsigned char fakeEscape = 0;
-unsigned char fakeEscFilter(unsigned char c)
+static unsigned char fakeEscFilter(unsigned char c)
{
if (!fakeEscape) return c;
if (c == ESC_CHR) return '*';
@@ -48,17 +48,15 @@ unsigned char fakeEscFilter(unsigned char c)
/* ----------------------------------------------------- */
#ifdef CONVERT
-extern read_write_type write_type;
-extern read_write_type read_type;
-extern convert_type input_type;
-
inline static ssize_t input_wrapper(void *buf, ssize_t count) {
/* input_wrapper is a special case.
* because we may do nothing,
* a if-branch is better than a function-pointer call.
*/
- if(input_type) return (*input_type)(buf, count);
- else return count;
+ if(input_type)
+ return (*input_type)(buf, count);
+ else
+ return count;
}
inline static int read_wrapper(int fd, void *buf, size_t count) {
@@ -745,6 +743,10 @@ drop_input(void)
icurrchar = ibufsize = 0;
}
+/*
+ * wait user input for f seconds.
+ * return 1 if control key c is available.
+ */
int
peek_input(float f, int c)
{