summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ansi.h9
-rw-r--r--mbbsd/bbs.c4
-rw-r--r--mbbsd/board.c10
-rw-r--r--mbbsd/edit.c2
-rw-r--r--mbbsd/io.c2
-rw-r--r--mbbsd/mail.c2
-rw-r--r--mbbsd/more.c4
-rw-r--r--mbbsd/name.c8
-rw-r--r--mbbsd/pfterm.c2
-rw-r--r--mbbsd/pmore.c4
-rw-r--r--mbbsd/register.c2
-rw-r--r--mbbsd/talk.c2
-rw-r--r--mbbsd/user.c4
-rw-r--r--mbbsd/var.c2
14 files changed, 30 insertions, 27 deletions
diff --git a/include/ansi.h b/include/ansi.h
index faa3b0f8..33ecd1f1 100644
--- a/include/ansi.h
+++ b/include/ansi.h
@@ -14,12 +14,13 @@
#define ESC_CHR '\x1b'
// Common ANSI commands.
-#define ANSI_RESET ESC_STR "[m"
-#define ANSI_COLOR(x) ESC_STR "[" #x "m"
+#define ANSI_RESET ESC_STR "[m"
+#define ANSI_COLOR(x) ESC_STR "[" #x "m"
#define ANSI_MOVETO(y,x) ESC_STR "[" #y ";" #x "H"
-#define ANSI_CLRTOEND ESC_STR "[K"
+#define ANSI_CLRTOEND ESC_STR "[K"
+#define ANSI_REVERSE ANSI_COLOR(7)
-#define ANSI_SAVEPOS ESC_STR "[s"
+#define ANSI_SAVEPOS ESC_STR "[s"
#define ANSI_RESTOREPOS ESC_STR "[u"
#define ANSI_IN_ESCAPE(x) (((x) >= '0' && (x) <= '9') || \
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 598d5106..8ff14cfe 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -419,7 +419,7 @@ readtitle(void)
snprintf(buf, sizeof(buf), "人氣:%d ", SHM->bcache[currbid - 1].nuser);
}
- vbarf(ANSI_COLOR(7) " 編號 %s 作 者 文 章 標 題\t%s ",
+ vbarf(ANSI_REVERSE " 編號 %s 作 者 文 章 標 題\t%s ",
IS_LISTING_MONEY ? listmode_desc[LISTMODE_MONEY] : listmode_desc[currlistmode],
buf);
}
@@ -2968,7 +2968,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
// make sure to do modification
{
char ans[3];
- sprintf(buf+strlen(buf), ANSI_COLOR(7) "%-*s"
+ sprintf(buf+strlen(buf), ANSI_REVERSE "%-*s"
ANSI_RESET " 確定[y/N]:", maxlength, msg);
if(!getdata(b_lines, 0, buf, ans, sizeof(ans), LCECHO) ||
ans[0] != 'y')
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 3777079f..a38235da 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -310,7 +310,7 @@ b_config(void)
move(ytitle-1, 0); clrtobot();
// outs(MSG_SEPERATOR); // deprecated by grayout
- outs("\n" ANSI_COLOR(7)); // now (ytitle, 0);
+ outs("\n" ANSI_REVERSE); // now (ytitle, 0);
vbarf(" 《%s》看板設定", bp->brdname);
move(ytitle +2, 0);
@@ -1032,8 +1032,10 @@ search_local_board()
if (!IS_LISTING_FAV() ||
(nbrd[num].myattr & NBRD_BOARD && HasBoardPerm(B_BH(&nbrd[num]))) )
NameList_add(&namelist, B_BH(&nbrd[num])->brdname);
- namecomplete2(&namelist, "【 搜尋所在位置看板 】", genbuf);
+ namecomplete2(&namelist, ANSI_REVERSE "【 搜尋所在位置看板 】"
+ ANSI_RESET "\n請輸入看板名稱(按空白鍵自動搜尋): ", genbuf);
NameList_delete(&namelist);
+
for (num = 0; num < brdnum; num++)
if (!strcasecmp(B_BH(&nbrd[num])->brdname, genbuf))
@@ -1166,7 +1168,7 @@ show_brdlist(int head, int clsflag, int newflag)
//
// newflag is not so different now because we use all 5 digits.
- vbarf(ANSI_COLOR(7) " %s 看 板 類別 轉信 中 文 敘 述 人氣 板 主",
+ vbarf(ANSI_REVERSE " %s 看 板 類別 轉信 中 文 敘 述 人氣 板 主",
newflag ? "總數" : "編號");
move(b_lines, 0);
brdlist_foot();
@@ -1899,7 +1901,7 @@ choose_board(int newflag)
move(0, 0);
clrtoeol();
/* use CompleteBoard or CompleteBoardAndGroup ? */
- CompleteBoard(ANSI_COLOR(7) "【 增加我的最愛 】" ANSI_RESET "\n"
+ CompleteBoard(ANSI_REVERSE "【 增加我的最愛 】" ANSI_RESET "\n"
"請輸入欲加入的看板名稱(按空白鍵自動搜尋):",
bname);
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index d32b166c..b0c806ac 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -2581,7 +2581,7 @@ display_textline_internal(textline_t *p, int i)
curr_buf->blockln <= tmp && tmp <= curr_buf->currln) ||
(curr_buf->currln <= tmp && tmp <= curr_buf->blockln)) )
{
- // outs(ANSI_COLOR(7)); // remove me when EOATTR is ready...
+ // outs(ANSI_REVERSE); // remove me when EOATTR is ready...
attr |= EOATTR_SELECTED;
}
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 306fb765..0c35b030 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -362,7 +362,7 @@ _debug_check_keyinput()
move(b_lines, 0);
if(dbcsaware)
{
- outs( ANSI_COLOR(7) "游標在此" ANSI_RESET
+ outs( ANSI_REVERSE "游標在此" ANSI_RESET
" 測試中文模式會不會亂送鍵。 'q' 離開, 'd' 回英文模式 ");
move(b_lines, 4);
} else {
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 9149aade..f4b88129 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -998,7 +998,7 @@ mailtitle(void)
showtitle("郵件選單", BBSName);
outs("[←]離開[↑↓]選擇[→]閱\讀信件 [X]轉錄看板[F]轉寄站外 ");
prints(" [O]站外信:%s [h]求助\n" , REJECT_OUTTAMAIL ? ANSI_COLOR(31) "關" ANSI_RESET : "開");
- vbarf(ANSI_COLOR(7) " 編號 %s 作 者 信 件 標 題\t%s ",
+ vbarf(ANSI_REVERSE " 編號 %s 作 者 信 件 標 題\t%s ",
(showmail_mode == SHOWMAIL_SUM) ? "大 小":"日 期",
buf);
}
diff --git a/mbbsd/more.c b/mbbsd/more.c
index 2a0f5009..5422c0bd 100644
--- a/mbbsd/more.c
+++ b/mbbsd/more.c
@@ -167,12 +167,12 @@ int more(const char *fpath, int promptend)
if (q1 == q2) q2 = NULL;
outs(ANSI_COLOR(34;47) " ");
- outs(buf); outs(" " ANSI_COLOR(5));
+ outs(buf); outs(" " ANSI_REVERSE);
outs(q1); prints("%*s", l, ""); q1 += strlen(q1);
if (q2) {
outs(ANSI_COLOR(0;34;47) " "); outs(q1+1);
- outs(" " ANSI_COLOR(5)); outs(q2);
+ outs(" " ANSI_REVERSE); outs(q2);
}
outs(ANSI_RESET"\n");
} else
diff --git a/mbbsd/name.c b/mbbsd/name.c
index 46d7a253..47416136 100644
--- a/mbbsd/name.c
+++ b/mbbsd/name.c
@@ -433,7 +433,7 @@ namecomplete(const char *prompt, char *data)
{
// print input field again
move(y, scrx); outc(' '); clrtoeol(); move(y, scrx);
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
prints("%-*s", IDLEN + 1, data);
outs(ANSI_RESET);
move(y, scrx + count);
@@ -559,7 +559,7 @@ namecomplete2(struct NameList *namelist, const char *prompt, char *data)
{
// print input field
move(y, scrx); outc(' '); clrtoeol(); move(y, scrx);
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
prints("%-*s", IDLEN + 1, data);
outs(ANSI_RESET);
move(y, scrx + count);
@@ -684,7 +684,7 @@ usercomplete(const char *prompt, char *data)
{
// print input field again
move(y, scrx); outc(' '); clrtoeol(); move(y, scrx);
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
prints("%-*s", IDLEN + 1, data);
outs(ANSI_RESET);
move(y, scrx + count);
@@ -906,7 +906,7 @@ generalnamecomplete(const char *prompt, char *data, int len, size_t nmemb,
{
// print input field again
move(y, scrx); outc(' '); clrtoeol(); move(y, scrx);
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
// data[ptr] = 0;
prints("%-*s", len, data);
outs(ANSI_RESET);
diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c
index d1284ec0..3eb4a16e 100644
--- a/mbbsd/pfterm.c
+++ b/mbbsd/pfterm.c
@@ -2419,7 +2419,7 @@ int main(int argc, char* argv[])
#if 0
// DBCS test
char *a1 = ANSI_COLOR(1;33) "測試" ANSI_COLOR(34) "中文"
- ANSI_COLOR(7) "測試" ANSI_RESET "測試"
+ ANSI_REVERSE "測試" ANSI_RESET "測試"
"測試a" ANSI_RESET "\n";
outstr(a1);
move(0, 2);
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index b055539d..7c4f5ec4 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -1599,7 +1599,7 @@ mf_display()
sr.cmpfunc((char*)mf.dispe,
(char*)sr.search_str, sr.len) == 0)
{
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
srlen = sr.len-1;
flResetColor = 1;
}
@@ -2832,7 +2832,7 @@ pmore_PromptBar(const char *caption, int shadow)
else
i = t_columns -2;
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
outs(caption);
for(i -= strlen(caption); i > 0; i--)
outs(" ");
diff --git a/mbbsd/register.c b/mbbsd/register.c
index 18d2b921..a0312d19 100644
--- a/mbbsd/register.c
+++ b/mbbsd/register.c
@@ -2076,7 +2076,7 @@ regform2_validate_page(int dryrun)
"%s 已顯示 %d 份註冊單 ", // "(%2d%%) ",
dryrun? "(測試模式)" : "",
tid);
- prints(ANSI_COLOR(7) "\n%78s" ANSI_RESET "\n", msg);
+ prints(ANSI_REVERSE "\n%78s" ANSI_RESET "\n", msg);
}
// handle user input
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 8622a269..013b9885 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -2283,7 +2283,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way,
BBSName);
move(2, 0);
- outs(ANSI_COLOR(7));
+ outs(ANSI_REVERSE);
vs_cols(ulist_coldef, cols, ULISTCOLS,
show_uid ? "UID" : "編號",
"P", "代號", "暱稱",
diff --git a/mbbsd/user.c b/mbbsd/user.c
index f26c99db..420a49a4 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1399,7 +1399,7 @@ u_list_CB(void *data, int num, userec_t * uentp)
if (uentp == NULL) {
move(2, 0);
clrtoeol();
- prints(ANSI_COLOR(7) " 使用者代號 %-25s 上站 文章 %s "
+ prints(ANSI_REVERSE " 使用者代號 %-25s 上站 文章 %s "
"最近光臨日期 " ANSI_COLOR(0) "\n",
"綽號暱稱",
HasUserPerm(PERM_SEEULEVELS) ? "等級" : "");
@@ -1525,7 +1525,7 @@ int u_detectDBCSAwareEvilClient()
move(14, 0);
outs("這是偵測區,您的游標會出現在"
- ANSI_COLOR(7) "這裡" ANSI_RESET);
+ ANSI_REVERSE "這裡" ANSI_RESET);
move(14, 15*2);
ch = igetch();
if(ch != KEY_LEFT && ch != KEY_RIGHT &&
diff --git a/mbbsd/var.c b/mbbsd/var.c
index a2a019fe..4d91c5bf 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -319,7 +319,7 @@ int p_lines = 20;
int t_columns = 80;
/* refer to ansi.h for *len */
-char * const strtstandout = ANSI_COLOR(7);
+char * const strtstandout = ANSI_REVERSE;
const int strtstandoutlen = 4;
char * const endstandout = ANSI_RESET;
const int endstandoutlen = 3;