summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-20 16:23:21 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-20 16:23:21 +0800
commitfd51845386c6fd2d5459e9ae96a8cad0d3985a5f (patch)
treecc445fae058d75fbc36b8e52e1c4547063550828 /util
parent8294fd6dd4aacd6eede9df476ee65bd3703c844e (diff)
downloadpttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar.gz
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar.bz2
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar.lz
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar.xz
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.tar.zst
pttbbs-fd51845386c6fd2d5459e9ae96a8cad0d3985a5f.zip
add boardlist.all
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1553 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/boardlist.c25
1 files changed, 25 insertions, 0 deletions
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;
}