diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 01:15:36 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 01:15:36 +0800 |
commit | 2ec15646e35a5a49bea7eff28963c906afc5fc16 (patch) | |
tree | 048dabd3268b70cb8e5bcd30e3425385d45b9756 /mbbsd | |
parent | 86ef8a50a0135703d54b1ed23727ee1cc739ee73 (diff) | |
download | pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar.gz pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar.bz2 pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar.lz pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar.xz pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.tar.zst pttbbs-2ec15646e35a5a49bea7eff28963c906afc5fc16.zip |
* revise brc interface: brc will not change currbid, currboard, currbrdattr
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4584 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/board.c | 15 | ||||
-rw-r--r-- | mbbsd/brc.c | 15 |
2 files changed, 13 insertions, 17 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 626e9c32..7550f709 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -74,8 +74,8 @@ inline boardheader_t *getparent(const boardheader_t *fh) * -2 permission denied * -3 error * @note enter board: - * 1. setup brc (currbid, currboard, currbrdattr) - * 2. set currbid, currBM, currmode, currdirect + * 1. setup brc + * 2. set currbid, currboard, currbrdattr, currBM, currmode, currdirect * 3. utmp brc_id */ int enter_board(const char *boardname) @@ -107,7 +107,10 @@ int enter_board(const char *boardname) /* really enter board */ brc_update(); - brc_initial_board(bname); + brc_initial_board(bid); + currbid = bid; + currboard = bcache[currbid - 1].brdname; + currbrdattr = bcache[currbid - 1].brdattr; setutmpbid(currbid); set_board(); @@ -1088,7 +1091,7 @@ unread_position(char *dirfile, boardstat_t * ptr) total = B_TOTAL(ptr); num = total + 1; if ((ptr->myattr & NBRD_UNREAD) && (fd = open(dirfile, O_RDWR)) > 0) { - if (!brc_initial_board(B_BH(ptr)->brdname)) { + if (!brc_initial_board(ptr->bid)) { num = 1; } else { num = total - 1; @@ -1702,10 +1705,10 @@ choose_board(int newflag) assert(0<=ptr->bid-1 && ptr->bid-1<MAX_BOARD); if (!(B_BH(ptr)->brdattr & BRD_GROUPBOARD)) { /* �Dsub class */ if (HasBoardPerm(B_BH(ptr))) { - brc_initial_board(B_BH(ptr)->brdname); + brc_initial_board(ptr->bid); if (newflag) { - setbdir(buf, currboard); + setbdir(buf, B_BH(ptr)->brdname); tmp = unread_position(buf, ptr); head = tmp - t_lines / 2; getkeep(buf, head > 1 ? head : 1, tmp + 1); diff --git a/mbbsd/brc.c b/mbbsd/brc.c index c7413612..15371f29 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -436,23 +436,16 @@ brc_read_record(int bid, int *num, brc_rec *list){ * @return number of records in \a boardname */ int -brc_initial_board(const char *boardname) +brc_initial_board(int bid) { brc_initialize(); - if (strcmp(currboard, boardname) == 0) { - assert(currbid == brc_currbid); + if (bid == brc_currbid) return brc_num; - } brc_update(); /* write back first */ - currbid = getbnum(boardname); - if( currbid == 0 ) - currbid = getbnum(DEFAULT_BOARD); - assert(0<=currbid-1 && currbid-1<MAX_BOARD); - brc_currbid = currbid; - currboard = bcache[currbid - 1].brdname; - currbrdattr = bcache[currbid - 1].brdattr; + assert(0<=bid-1 && bid-1<MAX_BOARD); + brc_currbid = bid; return brc_read_record(brc_currbid, &brc_num, brc_list); } |