回精華區
作者Dinsam.bbs@whshs.cs.nccu.edu.tw (前世.. o.O) 看板: plan
標題[功能]Announce/Class自動排序
時間政大狂狷年少 (Tue, 19 Aug 2003 14:47:11 +0800) Updated: 2005/05/19
這不是新的功能

在

07/29 itoc.        ◇ [功能] 開板後自動加入 Class

其實就有這個功能

不過僅在開板自動加入Class才會自動排序

底下只是把這個功能變成一個指令


: gem.c  gem_state()底下新增

static int
hdr_cmp(a, b)
  HDR *a;
  HDR *b;
{
  /* 先比對分類,再比對板名 */
  int k = strncmp(a->title + BNLEN + 1, b->title + BNLEN + 1, BCLEN);
  return k ? k : str_cmp(a->xname, b->xname);
}


static int
gem_sort(xo)
  XO *xo;
{
  if (!HAS_PERM(PERM_ALLBOARD))
    return XO_NONE;

  if (xo->key == GEM_VISIT)         /* 在 gopher 中 */
    return XO_NONE;

  rec_sync(xo->dir, sizeof(HDR), hdr_cmp, NULL);

  return gem_init(xo);
}


: gem.c  gem_cb[]


'S', gem_state,
+Ctrl('S'),gem_sort, /*按鍵自訂*/


--
There's no love like your love And no other could give more love             
There's nowhere unless you're there All the time all the way                 
Oh you can't tell me it's not worth tryin' for I can't help it               
there's nothin' I want more I would fight for you  I'd lie for you           
Walk the wire for you ya I'd die for you Ya know it's true Everything I do     
                                                     I do it for you~~~~~~     
--
   ╔═══╗  ┼────────────────────────╮
   狂狷  Origin:[ 狂 狷 年 少 ] whshs.cs.nccu.edu.tw ╰─╮
   年少  ┼╮                         < IP:140.119.164.16 >   ╰─╮
   ╚╦═╦╝   From:218-171-107-244.HINET-IP.hinet.net        
   ─╨─╨─ KGBBS 遨翔"BBS"的狂狷不馴;屬於年少的輕狂色彩 
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻