summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-21 21:06:49 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-21 21:06:49 +0800
commit0c43fcb81c11e2987a9210a3187a58029be0f699 (patch)
tree6c769b128ef23a5071be43dd3af5a32b86ed87a9
parente5be5e3eec947d28807c8ba40fe92ab07e5bb248 (diff)
downloadpttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar.gz
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar.bz2
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar.lz
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar.xz
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.tar.zst
pttbbs-0c43fcb81c11e2987a9210a3187a58029be0f699.zip
use isvisiableboard()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1258 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/hotboard.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/hotboard.c b/util/hotboard.c
index ff4c0e88..3a895e5f 100644
--- a/util/hotboard.c
+++ b/util/hotboard.c
@@ -13,6 +13,13 @@ struct bs {
boardheader_t *b;
} *brd;
+#define isvisiableboard(bptr) \
+ ((bptr)->brdname[0] && \
+ !(((bptr)->brdattr & (BRD_HIDE | BRD_TOP)) || \
+ ((bptr)->level && !((bptr)->brdattr & BRD_POSTMASK) && \
+ ((bptr)->level & \
+ ~(PERM_BASIC|PERM_CHAT|PERM_PAGE|PERM_POST|PERM_LOGINOK)))))
+
int main(int argc, char **argv)
{
int ch, topn = 20, i, nbrds, j, k, nusers;
@@ -40,8 +47,8 @@ int main(int argc, char **argv)
nbrds = 1;
for( i = 1 ; i < MAX_BOARD ; ++i )
- if( nbrds != topn ||
- (SHM->bcache[i].brdname[0] &&
+ if( (isvisiableboard(&SHM->bcache[i])) &&
+ (nbrds != topn ||
SHM->bcache[i].nuser > brd[nbrds - 1].nusers) ){
nusers = SHM->bcache[i].nuser; // no race ?