summaryrefslogtreecommitdiffstats
path: root/util/rmuid.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
commitae31e19f92e717919ac8e3db9039eb38d2b89aae (patch)
treec70164d6a1852344f44b04a653ae2815043512af /util/rmuid.c
downloadpttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.gz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.bz2
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.lz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.xz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.zst
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.zip
Initial revision
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/rmuid.c')
-rw-r--r--util/rmuid.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/util/rmuid.c b/util/rmuid.c
new file mode 100644
index 00000000..cc6e12cb
--- /dev/null
+++ b/util/rmuid.c
@@ -0,0 +1,50 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "config.h"
+#include "pttstruct.h"
+#include "util.h"
+
+extern int numboards;
+extern boardheader_t *bcache;
+
+int getbidofuid(int uid)
+{
+ register int n; boardheader_t *bh;
+ if(!uid) return 1;
+ for (n=0;n<numboards;n++)
+ {
+ bh = &bcache[n];
+ if(bh->unused == uid)
+ return n+1;
+ }
+ return 1;
+}
+
+int main(int argc, char* argv[]){
+struct stat st;
+ int n;
+ boardheader_t bh;
+ char pathname[1024];
+
+ resolve_boards();
+ for (n=0;n<numboards;n++)
+ {
+ memcpy( &bh, &bcache[n], sizeof(bh));
+ bh.gid=getbidofuid(bh.gid);
+ //printf("%14.14s%14.14s \r\n",bh.brdname, bh.title);
+ substitute_record("BOARDS.bid", &bh, sizeof(bh), n+1);
+ }
+}
+
+
+
+
+
+
+