summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-29 00:07:44 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-29 00:07:44 +0800
commit7a30b4ab866b2c4e9856f784655dcb84d60319cb (patch)
treef0b5ca45614eb70ffc030cb29e26819afe54d358
parentd829359d65aea7afebcd6628c6429af83c5cbbf3 (diff)
downloadpttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar.gz
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar.bz2
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar.lz
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar.xz
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.tar.zst
pttbbs-7a30b4ab866b2c4e9856f784655dcb84d60319cb.zip
* change vkey_flush to vkey_purge to make its name more descriptive, prevent confusion
* thanks for kcwu's suggestion git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5005 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/proto.h2
-rw-r--r--pttbbs/mbbsd/bbslua.c18
-rw-r--r--pttbbs/mbbsd/ccw.c6
-rw-r--r--pttbbs/mbbsd/io.c2
-rw-r--r--pttbbs/mbbsd/register.c2
-rw-r--r--pttbbs/mbbsd/stuff.c2
-rw-r--r--pttbbs/mbbsd/vtuikit.c2
7 files changed, 17 insertions, 17 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 55f5bebc..4f7291ec 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -287,7 +287,7 @@ void add_io(int fd, int timeout);
// new input api
int vkey(); // identical to igetch
-void vkey_flush(); // identical to drop_input
+void vkey_purge(); // identical to drop_input
int vkey_is_full(); // identical to input_isfull
int vkey_detach(void); // works like to add_io(0, 0)
int vkey_attach(int fd); // works like add_io(fd, ...)
diff --git a/pttbbs/mbbsd/bbslua.c b/pttbbs/mbbsd/bbslua.c
index 37c0832f..cbf2c553 100644
--- a/pttbbs/mbbsd/bbslua.c
+++ b/pttbbs/mbbsd/bbslua.c
@@ -177,10 +177,10 @@ static int
bl_peekbreak(float f)
{
if (vkey_is_full())
- vkey_flush();
+ vkey_purge();
if (peek_input(f, BLCONF_BREAK_KEY))
{
- vkey_flush();
+ vkey_purge();
blrt.abort = 1;
return 1;
}
@@ -385,7 +385,7 @@ bl_getch(lua_State* L)
int c = vkey();
if (c == BLCONF_BREAK_KEY)
{
- vkey_flush();
+ vkey_purge();
blrt.abort = 1;
return lua_yield(L, 0);
}
@@ -435,7 +435,7 @@ bl_getstr(lua_State* L)
// such workaround.
if (buf[1] == Ctrl('C'))
{
- vkey_flush();
+ vkey_purge();
blrt.abort = 1;
return lua_yield(L, 0);
}
@@ -476,7 +476,7 @@ bl_kbreset(lua_State *L)
if (bl_peekbreak(BLCONF_PEEK_TIME))
return lua_yield(L, 0);
- vkey_flush();
+ vkey_purge();
return 0;
}
@@ -580,7 +580,7 @@ bl_pause(lua_State* L)
n = vmsg(s);
if (n == BLCONF_BREAK_KEY)
{
- vkey_flush();
+ vkey_purge();
blrt.abort = 1;
return lua_yield(L, 0);
}
@@ -1033,7 +1033,7 @@ bbsluaHook(lua_State *L, lua_Debug* ar)
// vmsg("bbslua HOOK!");
if (blrt.abort)
{
- vkey_flush();
+ vkey_purge();
lua_yield(L, 0);
return;
}
@@ -1046,7 +1046,7 @@ bbsluaHook(lua_State *L, lua_Debug* ar)
// now, peek and check
if (vkey_is_full())
- vkey_flush();
+ vkey_purge();
// refresh();
@@ -1768,7 +1768,7 @@ bbslua(const char *fpath)
lua_close(L);
blrt.running =0;
- vkey_flush();
+ vkey_purge();
#ifdef BBSLUA_USAGE
{
double cputime;
diff --git a/pttbbs/mbbsd/ccw.c b/pttbbs/mbbsd/ccw.c
index 69a747d2..8dc57dd0 100644
--- a/pttbbs/mbbsd/ccw.c
+++ b/pttbbs/mbbsd/ccw.c
@@ -1002,15 +1002,15 @@ ccw_chat_anti_flood(CCW_CTX *ctx)
{
// flush all input!
unsigned char garbage[STRLEN];
- vkey_flush();
+ vkey_purge();
while (wait_input(1, 0))
{
if (num_in_buf())
- vkey_flush();
+ vkey_purge();
else
tty_read(garbage, sizeof(garbage));
}
- vkey_flush();
+ vkey_purge();
vmsg("請勿大量剪貼或造成洗板面的效果。");
// log?
diff --git a/pttbbs/mbbsd/io.c b/pttbbs/mbbsd/io.c
index 8e8c06b0..9cabf489 100644
--- a/pttbbs/mbbsd/io.c
+++ b/pttbbs/mbbsd/io.c
@@ -638,7 +638,7 @@ wait_input(float f, int bIgnoreBuf)
}
inline void
-vkey_flush(void)
+vkey_purge(void)
{
icurrchar = ibufsize = 0;
}
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index d143bdeb..5f7f84f4 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -454,7 +454,7 @@ static int verify_captcha()
// flush out current input
doupdate();
peek_input(0.1f, Ctrl('C'));
- vkey_flush();
+ vkey_purge();
sleep(1);
}
diff --git a/pttbbs/mbbsd/stuff.c b/pttbbs/mbbsd/stuff.c
index 7a29cf8b..ff40d6c4 100644
--- a/pttbbs/mbbsd/stuff.c
+++ b/pttbbs/mbbsd/stuff.c
@@ -158,7 +158,7 @@ wait_penalty(int sec)
sec = 5;
sleep(sec);
peek_input(0.1, Ctrl('C'));
- vkey_flush();
+ vkey_purge();
}
lastWait = now;
}
diff --git a/pttbbs/mbbsd/vtuikit.c b/pttbbs/mbbsd/vtuikit.c
index 1011e50f..050387ec 100644
--- a/pttbbs/mbbsd/vtuikit.c
+++ b/pttbbs/mbbsd/vtuikit.c
@@ -1313,7 +1313,7 @@ vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBA
if (c > 0x80 && num_in_buf() &&
len - rt.iend < 3) // we need 3 for DBCS+NUL.
{
- vkey_flush();
+ vkey_purge();
bell(); continue;
}