summaryrefslogtreecommitdiffstats
path: root/mbbsd/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r--mbbsd/board.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 63b77752..55b1f450 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -444,9 +444,9 @@ get_fav_type(boardstat_t *ptr)
static void
brdlist_foot(void)
{
- prints("\033[34;46m ¿ï¾Ü¬ÝªO \033[31;47m (c)\033[30m·s¤å³¹¼Ò¦¡ "
- "\033[31m(v/V)\033[30m¼Ð°O¤wŪ/¥¼Åª \033[31m(y)\033[30m¿z¿ï%s"
- " \033[31m(m)\033[30m¤Á´«³Ì·R \033[m",
+ prints(ANSI_COLOR(34;46) " ¿ï¾Ü¬ÝªO " ANSI_COLOR(31;47) " (c)" ANSI_COLOR(30) "·s¤å³¹¼Ò¦¡ "
+ ANSI_COLOR(31) "(v/V)" ANSI_COLOR(30) "¼Ð°O¤wŪ/¥¼Åª " ANSI_COLOR(31) "(y)" ANSI_COLOR(30) "¿z¿ï%s"
+ " " ANSI_COLOR(31) "(m)" ANSI_COLOR(30) "¤Á´«³Ì·R " ANSI_RESET,
IS_LISTING_FAV() ? "³Ì·R" : IS_LISTING_BRD() ? "³¡¥÷" : "¥þ³¡");
}
@@ -454,16 +454,16 @@ brdlist_foot(void)
static inline char *
make_class_color(char *name)
{
- char *colorset[8] = {"", "\033[32m",
- "\033[33m", "\033[36m", "\033[34m", "\033[1m",
- "\033[1;32m", "\033[1;33m"};
+ char *colorset[8] = {"", ANSI_COLOR(32),
+ ANSI_COLOR(33), ANSI_COLOR(36), ANSI_COLOR(34), ANSI_COLOR(1),
+ ANSI_COLOR(1;32), ANSI_COLOR(1;33)};
return colorset[(unsigned int)
(name[0] + name[1] +
name[2] + name[3]) & 07];
}
-#define HILIGHT_COLOR "\033[1;36m"
+#define HILIGHT_COLOR ANSI_COLOR(1;36)
static void
show_brdlist(int head, int clsflag, int newflag)
@@ -477,22 +477,22 @@ show_brdlist(int head, int clsflag, int newflag)
move(1, 0);
outs(
" "
- "¢© ¢~¡X\033[33m¡´\n"
- " ùá¡X \033[m "
- "¢¨¢i\033[47m¡ó\033[40m¢i¢i¢©ùç\n"
- " \033[44m ¡s¡s¡s¡s¡s¡s¡s¡s "
- "\033[33mùø\033[m\033[44m ¢©¢¨¢i¢i¢i¡¿¡¿¡¿ùø \033[m\n"
- " \033[44m "
- "\033[33m \033[m\033[44m ¢«¢ª¢i¢i¢i¡¶¡¶¡¶ ùø\033[m\n"
- " ¡s¡s¡s¡s¡s¡s¡s¡s \033[33m"
- "¢x\033[m ¢ª¢i¢i¢i¢i¢« ùø\n"
- " \033[33mùó"
- "¡X¡X\033[m ¢« ¡X¡Ï\033[m");
+ "¢© ¢~¡X" ANSI_COLOR(33) "¡´\n"
+ " ùá¡X " ANSI_RESET " "
+ "¢¨¢i" ANSI_COLOR(47) "¡ó" ANSI_COLOR(40) "¢i¢i¢©ùç\n"
+ " " ANSI_COLOR(44) " ¡s¡s¡s¡s¡s¡s¡s¡s "
+ ANSI_COLOR(33) "ùø" ANSI_RESET ANSI_COLOR(44) " ¢©¢¨¢i¢i¢i¡¿¡¿¡¿ùø " ANSI_RESET "\n"
+ " " ANSI_COLOR(44) " "
+ ANSI_COLOR(33) " " ANSI_RESET ANSI_COLOR(44) " ¢«¢ª¢i¢i¢i¡¶¡¶¡¶ ùø" ANSI_RESET "\n"
+ " ¡s¡s¡s¡s¡s¡s¡s¡s " ANSI_COLOR(33)
+ "¢x" ANSI_RESET " ¢ª¢i¢i¢i¢i¢« ùø\n"
+ " " ANSI_COLOR(33) "ùó"
+ "¡X¡X" ANSI_RESET " ¢« ¡X¡Ï" ANSI_RESET);
} else if (clsflag) {
showtitle("¬ÝªO¦Cªí", BBSName);
prints("[¡ö]¥D¿ï³æ [¡÷]¾\\Ū [¡ô¡õ]¿ï¾Ü [y]¸ü¤J [S]±Æ§Ç [/]·j´M "
"[TAB]¤åºK¡E¬ÝªO [h]¨D§U\n"
- "\033[7m%-20s Ãþ§O Âà«H%-31s¤H®ð ªO ¥D \033[m",
+ ANSI_COLOR(7) "%-20s Ãþ§O Âà«H%-31s¤H®ð ªO ¥D " ANSI_RESET,
newflag ? "Á`¼Æ ¥¼Åª ¬Ý ªO" : " ½s¸¹ ¬Ý ªO",
" ¤¤ ¤å ±Ô ­z");
move(b_lines, 0);
@@ -500,10 +500,10 @@ show_brdlist(int head, int clsflag, int newflag)
}
if (brdnum > 0) {
boardstat_t *ptr;
- char *color[8] = {"", "\033[32m",
- "\033[33m", "\033[36m", "\033[34m", "\033[1m",
- "\033[1;32m", "\033[1;33m"};
- char *unread[2] = {"\33[37m \033[m", "\033[1;31m£¾\033[m"};
+ char *color[8] = {"", ANSI_COLOR(32),
+ ANSI_COLOR(33), ANSI_COLOR(36), ANSI_COLOR(34), ANSI_COLOR(1),
+ ANSI_COLOR(1;32), ANSI_COLOR(1;33)};
+ char *unread[2] = {ANSI_COLOR(37) " " ANSI_RESET, ANSI_COLOR(1;31) "£¾" ANSI_RESET};
if (IS_LISTING_FAV() && get_data_number(get_current_fav()) == 0){
// brdnum > 0 ???
@@ -519,26 +519,26 @@ show_brdlist(int head, int clsflag, int newflag)
ptr = &nbrd[head++];
if (ptr->myattr & NBRD_LINE){
if( !newflag )
- prints("%5d %c %s------------ ------------------------------------------\033[m",
+ prints("%5d %c %s------------ ------------------------------------------" ANSI_RESET,
head,
ptr->myattr & NBRD_TAG ? 'D' : ' ',
- ptr->myattr & NBRD_FAV ? "" : "\033[1;30m");
+ ptr->myattr & NBRD_FAV ? "" : ANSI_COLOR(1;30));
else
- prints(" %s------------ ------------------------------------------\033[m", ptr->myattr & NBRD_FAV ? "" : "\033[1;30m");
+ prints(" %s------------ ------------------------------------------" ANSI_RESET, ptr->myattr & NBRD_FAV ? "" : ANSI_COLOR(1;30));
continue;
}
else if (ptr->myattr & NBRD_FOLDER){
char *title = get_folder_title(ptr->bid);
if( !newflag )
- prints("%5d %c %sMyFavFolder\033[m ¥Ø¿ý ¡¼%-34s\033[m",
+ prints("%5d %c %sMyFavFolder" ANSI_RESET " ¥Ø¿ý ¡¼%-34s" ANSI_RESET,
head,
ptr->myattr & NBRD_TAG ? 'D' : ' ',
- !(cuser.uflag2 & FAVNOHILIGHT) ? "\033[1;36m" : "",
+ !(cuser.uflag2 & FAVNOHILIGHT) ? ANSI_COLOR(1;36) : "",
title);
else
- prints("%6d %sMyFavFolder\033[m ¥Ø¿ý ¡¼%-34s\033[m",
+ prints("%6d %sMyFavFolder" ANSI_RESET " ¥Ø¿ý ¡¼%-34s" ANSI_RESET,
get_data_number(get_fav_folder(getfolder(ptr->bid))),
- !(cuser.uflag2 & FAVNOHILIGHT) ? "\033[1;36m" : "",
+ !(cuser.uflag2 & FAVNOHILIGHT) ? ANSI_COLOR(1;36) : "",
title);
continue;
}
@@ -567,10 +567,10 @@ show_brdlist(int head, int clsflag, int newflag)
unread[ptr->myattr & NBRD_UNREAD ? 1 : 0]);
}
if (!IN_CLASSROOT()) {
- prints("%s%-13s\033[m%s%5.5s\033[0;37m%2.2s\033[m"
+ prints("%s%-13s" ANSI_RESET "%s%5.5s" ANSI_COLOR(0;37) "%2.2s" ANSI_RESET
"%-34.34s",
((!(cuser.uflag2 & FAVNOHILIGHT) &&
- getboard(ptr->bid) != NULL))? "\033[1;36m" : "",
+ getboard(ptr->bid) != NULL))? ANSI_COLOR(1;36) : "",
B_BH(ptr)->brdname,
color[(unsigned int)
(B_BH(ptr)->title[1] + B_BH(ptr)->title[2] +
@@ -591,19 +591,19 @@ show_brdlist(int head, int clsflag, int newflag)
else if (B_BH(ptr)->nuser <= 10)
prints("%2d ", B_BH(ptr)->nuser);
else if (B_BH(ptr)->nuser <= 50)
- prints("\033[1;33m%2d\033[m ", B_BH(ptr)->nuser);
+ prints(ANSI_COLOR(1;33) "%2d" ANSI_RESET " ", B_BH(ptr)->nuser);
else if (B_BH(ptr)->nuser >= 5000)
- outs("\033[1;34mÃz!\033[m");
+ outs(ANSI_COLOR(1;34) "Ãz!" ANSI_RESET);
else if (B_BH(ptr)->nuser >= 2000)
- outs("\033[1;31mÃz!\033[m");
+ outs(ANSI_COLOR(1;31) "Ãz!" ANSI_RESET);
else if (B_BH(ptr)->nuser >= 1000)
- outs("\033[1mÃz!\033[m");
+ outs(ANSI_COLOR(1) "Ãz!" ANSI_RESET);
else if (B_BH(ptr)->nuser >= 100)
- outs("\033[1mHOT\033[m");
+ outs(ANSI_COLOR(1) "HOT" ANSI_RESET);
else //if (B_BH(ptr)->nuser > 50)
- prints("\033[1;31m%2d\033[m ", B_BH(ptr)->nuser);
- prints("%.*s\033[K", t_columns - 67, B_BH(ptr)->BM);
+ prints(ANSI_COLOR(1;31) "%2d" ANSI_RESET " ", B_BH(ptr)->nuser);
+ prints("%.*s" ANSI_CLRTOEND, t_columns - 67, B_BH(ptr)->BM);
} else {
prints("%-40.40s %.*s", B_BH(ptr)->title + 7,
t_columns - 67, B_BH(ptr)->BM);
@@ -836,7 +836,7 @@ choose_board(int newflag)
if(IS_LISTING_FAV()){
move(b_lines - 2, 0);
outs("­«·s±Æ§Ç¬ÝªO "
- "\033[1;33m(ª`·N, ³o­Ó°Ê§@·|Âмg­ì¨Ó³]©w)\033[m \n");
+ ANSI_COLOR(1;33) "(ª`·N, ³o­Ó°Ê§@·|Âмg­ì¨Ó³]©w)" ANSI_RESET " \n");
tmp = getans("±Æ§Ç¤è¦¡ (1)«ö·ÓªO¦W±Æ§Ç (2)«ö·ÓÃþ§O±Æ§Ç ==> [0]¨ú®ø ");
if( tmp == '1' )
fav_sort_by_name();
@@ -1098,7 +1098,7 @@ choose_board(int newflag)
move(0, 0);
clrtoeol();
/* use CompleteBoard or CompleteBoardAndGroup ? */
- CompleteBoard("\033[7m¡i ¼W¥[§Úªº³Ì·R ¡j\033[m\n"
+ CompleteBoard(ANSI_COLOR(7) "¡i ¼W¥[§Úªº³Ì·R ¡j" ANSI_RESET "\n"
"½Ð¿é¤J±ý¥[¤Jªº¬ÝªO¦WºÙ(«öªÅ¥ÕÁä¦Û°Ê·j´M)¡G",
bname);