From fd51845386c6fd2d5459e9ae96a8cad0d3985a5f Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 20 Feb 2004 08:23:21 +0000 Subject: add boardlist.all git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1553 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/boardlist.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'util') diff --git a/util/boardlist.c b/util/boardlist.c index 7847697c..a37de82f 100644 --- a/util/boardlist.c +++ b/util/boardlist.c @@ -113,6 +113,29 @@ void dumpclass(int bid) } } +void dumpallbrdname(void) +{ + int i; + boardheader_t *bptr; + FILE *fp; + + if( !(fp = fopen("boardlist.all", "wt")) ) + return; + + for( i = 0 ; i < MAX_BOARD ; ++i ){ + bptr = &bcache[i]; + + if( !bptr->brdname[0] || + (bptr->brdattr & (BRD_HIDE | BRD_TOP | BRD_GROUPBOARD)) || + (bptr->level && !(bptr->brdattr & BRD_POSTMASK) && + (bptr->level & + ~(PERM_BASIC|PERM_CHAT|PERM_PAGE|PERM_POST|PERM_LOGINOK))) ) + continue; + fprintf(fp, "%s\n", bptr->brdname); + } + fclose(fp); +} + int main(int argc, char **argv) { attach_SHM(); @@ -125,11 +148,13 @@ int main(int argc, char **argv) "use DB_File;\n" "use Data::Serializer;\n" "\n" + "unlink 'boardlist.db', 'boardlist.list';\n" "$serializer = Data::Serializer->new(serializer => 'Storable', digester => 'MD5',compress => 0,);\n" "tie %%db, 'DB_File', 'boardlist.db', (O_RDWR | O_CREAT), 0666, $DB_HASH;\n" ); dumpclass(0); dumpdetail(); + dumpallbrdname(); printf("untie %%db;\n"); return 0; } -- cgit v1.2.3