作者LHD.bbs@YoMin.twbbs.org (我快被搞瘋了||) 看板: plan
標題[功能] 整行光棒(7)-favor.c 我的最愛
時間遊民之家 (Mon, 14 Jul 2003 19:45:37 +0800 (CST)) Updated: 2005/10/06
要先做完board.c的class_item_bar()哦
: favor.c:mf_item_bar() 加在 mf_item() 之後
#ifdef HAVE_LIGHTBAR
static int
mf_item_bar(xo, mode)
XO *xo;
int mode;
{
int num;
MF *mf;
int mftype, brdpost, invalid;
num = xo->pos + 1;
mf = (MF *) xo_pool + xo->pos - xo->top;
mftype = mf->mftype;
brdpost = cuser.ufo & UFO_BRDPOST;
if (mftype & MF_FOLDER)
{
if (brdpost)
{
struct stat st;
char fpath[64];
mf_fpath(fpath, cuser.userid, mf->xname);
stat(fpath, &st);
num = st.st_size / sizeof(MF);
}
prints("%s%6d%c %s %-66.54s\033[m", mode ? "\033[1;42m" : "",
num, mftype & MF_MARK ? ')' : ' ', "◆", mf->title);
}
else if (mftype & MF_BOARD)
{
BRD *bhead, *btail;
int chn;
chn = 0;
invalid = 1;
bhead = bshm->bcache;
btail = bhead + bshm->number;
do
{
if (!strcmp(mf->xname, bhead->brdname))
{
if (mode)
class_item_bar(bhead, num, chn, brdpost);
else
class_item(num, chn, brdpost);
invalid = 0;
break;
}
chn++;
} while (++bhead < btail);
if (invalid) /* itoc.010821: 被砍的看板要另外印 */
{
prints("%s \033[36m%-13s%-56s\033[m", mode ?
"\033[1;42m" : "", mf->xname, "<已改名或被刪除,請將本捷徑刪除>");
} /* 長度好難調 乾脆自己改了= =*/
}
else /* if (mftype & MF_GEM) */
{
prints("%s%6d%c %s %-66.54s\033[m",
mode ? "\033[1;42m" : "",
brdpost ? 0 : num,
mftype & MF_MARK ? ')' : ' ', "■", mf->title);
}
return XO_NONE;
}
#endif
: favor.c:mf_cb[]
static KeyFunc mf_cb[] =
{
#ifdef HAVE_LIGHTBAR
XO_ITEM, mf_item_bar,
#endif
...
--
▃▄▅▆▇▅▄▃▂▁ ◣ ◢ █◣◢█ ● bbs.cis95.net
▇▅▄▂▁ˍ▃▅▆ 居無定所的雲 ◥█◤ ◤◥ █◥◤█ ▲ █▇◣ 遊民之家
飄自 cismpc19.cis.nctu.edu.tw █ ◣◢ █ █ █ █ █‧twbbs‧org