summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-29 00:29:26 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-29 00:29:26 +0800
commit7f83ab24bc6209de9db34b8b7894698eb65b1f17 (patch)
tree0ae6efa3df9e6e7fb24c8f228db09702d7c42aa9
parent10706337ff35bf00080907c24a7d66f72e82bfa5 (diff)
downloadpttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar.gz
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar.bz2
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar.lz
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar.xz
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.tar.zst
pttbbs-7f83ab24bc6209de9db34b8b7894698eb65b1f17.zip
getans -> getdata
getkey -> vmsg_lines git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1884 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h1
-rw-r--r--mbbsd/admin.c4
-rw-r--r--mbbsd/stuff.c11
-rw-r--r--mbbsd/user.c2
4 files changed, 15 insertions, 3 deletions
diff --git a/include/proto.h b/include/proto.h
index c95d6a18..40786439 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -486,6 +486,7 @@ void setcalfile(char *buf, char *userid);
void stand_title(char *title);
//int getans(const char *fmt,...) GCC_CHECK_FORMAT(1,2);
char getans(char *);
+int getkey(const char *fmt,...) GCC_CHECK_FORMAT(1,2);
int vmsg(const char *fmt,...) GCC_CHECK_FORMAT(1,2);
void trim(char *buf);
void bell(void);
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index aa498b93..2175f764 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -232,7 +232,7 @@ setperms(unsigned int pbits, char *pstring[])
}
clrtobot();
while (
- (i = getans("請按 [A-5] 切換設定,按 [Return] 結束:"))!='\r')
+ (i = getkey("請按 [A-5] 切換設定,按 [Return] 結束:"))!='\r')
{
i = i - 'a';
if (i < 0)
@@ -955,7 +955,7 @@ scan_register_form(char *regfile, int automode, int neednum)
prints("%d.%-12s:%s\n", n - 2, finfo[n], fdata[n]);
}
if (muser.userlevel & PERM_LOGINOK) {
- ans[0] = getans("此帳號已經完成註冊, "
+ ans[0] = getkey("此帳號已經完成註冊, "
"更新(Y/N/Skip)?[N] ");
if (ans[0] != 'y' && ans[0] != 's')
ans[0] = 'd';
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 00c307fb..28388960 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -434,6 +434,17 @@ char getans(char *prompt)
}
int
+getkey(const char *fmt,...)
+{
+ char msg[256] = "\033[1;36;44m ◆ ", i;
+ va_list ap;
+ va_start(ap, fmt);
+ i = vsnprintf(msg + 14, 100, fmt, ap);
+ va_end(ap);
+ return vmsg_lines(b_lines, msg);
+}
+
+int
vmsg(const char *fmt,...)
{
char msg[256] = "\033[1;36;44m ◆ ", i;
diff --git a/mbbsd/user.c b/mbbsd/user.c
index edbe4fb1..127de100 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -236,7 +236,7 @@ static void Customize(void)
prints("%-30s%10s\n", "D. 目前的心情", mindbuf);
prints("%-30s%10s\n", "E. 高亮度顯示我的最愛",
((cuser.uflag2 & FAVNOHILIGHT) ? "否" : "是"));
- switch(getans("請按 [A-E] 切換設定,按 [Return] 結束:")){
+ switch(getkey("請按 [A-E] 切換設定,按 [Return] 結束:")){
case 'a':{
int currentset = cuser.uflag2 & WATER_MASK;
currentset = (currentset + 1) % 3;