回精華區
作者itoc (咕嚕為什麼這麼多人), 信區: plan
標題[修正] 廣播用其他顏色
時間Fri Dec 6 02:24:18 2002 Updated: 2002/12/06
: bmw.c

#define BMW_FORMAT  "\033[1;33;46m★%s \033[37;45m %s \033[m" /* 收到的水球 */
#define BMW_FORMAT2 "\033[1;33;41m☆%s \033[34;47m %s \033[m" /* 送出的水球 */
+#define BMW_FORMAT3 "\033[1;33;45m★%s \033[37;45m %s \033[m" /* 收到的廣播 */

: bmw.c:bmw_rqst()

      /* itoc.020126: 加入 FN_AMW */
-     fprintf(fp, BMW_FORMAT " %s\n",
-       mptr->userid, mptr->msg, Btime(&(mptr->btime)));
+     fprintf(fp, mptr->userid[strlen(mptr->userid) - 2] != '>' ?
+       BMW_FORMAT " %s\n" : BMW_FORMAT3 " %s\n",
+       mptr->userid, mptr->msg, Btime(&(mptr->btime)));

  ...
  ...

-   sprintf(buf, BMW_FORMAT, mptr->userid, mptr->msg);
+   sprintf(buf, mptr->userid[strlen(mptr->userid) - 2] != '>' ?
+     BMW_FORMAT : BMW_FORMAT3, mptr->userid, mptr->msg);
    outz(buf);

--
□ 本文章由 itocitoc.Dorm-GD2.NCTU.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻