summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-10 01:44:39 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-10 01:44:39 +0800
commitdc1e907c2cf1038a9dc24a4f4969a8403097bd85 (patch)
treead37009f7662f3204509a196b8eaa74f0586e37f /util
parent90451291f8f509d0f0e3f1c442bb3325de30d9b0 (diff)
downloadpttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar.gz
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar.bz2
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar.lz
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar.xz
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.tar.zst
pttbbs-dc1e907c2cf1038a9dc24a4f4969a8403097bd85.zip
no warning
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@16 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/BM_money.c3
-rw-r--r--util/Makefile7
-rw-r--r--util/account.c3
-rw-r--r--util/bbsmail.c3
-rw-r--r--util/birth.c2
-rw-r--r--util/buildAnnounce.c4
-rw-r--r--util/buildir.c7
-rw-r--r--util/expire.c3
-rw-r--r--util/inndBM.c10
-rw-r--r--util/jungo.c1
-rw-r--r--util/openticket.c4
-rw-r--r--util/post.c3
-rw-r--r--util/rmuid.c19
-rw-r--r--util/toplazyBBM.c1
-rw-r--r--util/toplazyBM.c2
-rw-r--r--util/uhash_loader.c4
-rw-r--r--util/util_passwd.c4
17 files changed, 48 insertions, 32 deletions
diff --git a/util/BM_money.c b/util/BM_money.c
index 51e24c38..c275b1eb 100644
--- a/util/BM_money.c
+++ b/util/BM_money.c
@@ -1,4 +1,4 @@
-/* $Id: BM_money.c,v 1.1 2002/03/07 15:13:45 in2 Exp $ */
+/* $Id: BM_money.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
/* 給版主錢的程式 */
@@ -11,6 +11,7 @@
#include "pttstruct.h"
#include "util.h"
#include "common.h"
+#include "proto.h"
#define FUNCTION (2100 - c*5)
diff --git a/util/Makefile b/util/Makefile
index 41f7326f..6f204648 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 2002/03/08 09:22:02 in2 Exp $
+# $Id: Makefile,v 1.4 2002/03/09 17:44:30 in2 Exp $
BBSHOME?=$(HOME)
OSTYPE=linux
@@ -29,7 +29,7 @@ CPROGS= bbsmail BM_money post account birth deluserfile expire mandex\
horoscope openvice parse_news openticket topusr yearsold uhash_loader\
poststat showboard antispam countalldice webgrep bbsrf\
initbbs outmail xchatd userlist tunepasswd buildir reaper shmsweep\
- merge_passwd merge_board inndBM buildAnnounce rmuid cpdeadbrd \
+ merge_passwd merge_board inndBM buildAnnounce rmuid \
toplazyBM jungo toplazyBBM
PROGS= $(CPROGS) BM_money.sh backpasswd.sh mailog.sh opendice.sh\
@@ -68,9 +68,6 @@ mandex: mandex.c $(OBJS)
rmuid: rmuid.c $(OBJS)
$(CC) $(CFLAGS) -o $@ $@.c $(OBJS)
-cpdeadbrd: cpdeadbrd.c $(OBJS)
- $(CC) $(CFLAGS) -o $@ $@.c $(OBJS)
-
horoscope: horoscope.c $(OBJS)
$(CC) $(CFLAGS) -o $@ $@.c $(OBJS)
diff --git a/util/account.c b/util/account.c
index 1be06f59..4b221df4 100644
--- a/util/account.c
+++ b/util/account.c
@@ -1,4 +1,4 @@
-/* $Id: account.c,v 1.2 2002/03/09 17:29:20 in2 Exp $ */
+/* $Id: account.c,v 1.3 2002/03/09 17:44:30 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -8,6 +8,7 @@
#include "config.h"
#include "pttstruct.h"
#include "util.h"
+#include "proto.h"
#define MAX_LINE 16
#define ADJUST_M 6 /* adjust back 5 minutes */
diff --git a/util/bbsmail.c b/util/bbsmail.c
index 48f74c63..0afcdf7e 100644
--- a/util/bbsmail.c
+++ b/util/bbsmail.c
@@ -1,4 +1,4 @@
-/* $Id: bbsmail.c,v 1.1 2002/03/07 15:13:45 in2 Exp $ */
+/* $Id: bbsmail.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
#define _BBS_UTIL_C_
#include <stdio.h>
@@ -13,6 +13,7 @@
#include "util.h"
#include "perm.h"
#include "common.h"
+#include "proto.h"
#define LOG_FILE (BBSHOME "/etc/mailog")
diff --git a/util/birth.c b/util/birth.c
index 899bf9ee..43840386 100644
--- a/util/birth.c
+++ b/util/birth.c
@@ -48,7 +48,7 @@ int main(argc, argv)
{
FILE *fp1;
fileheader_t mymail;
- int i, day = 0;
+ //int i, day = 0;
time_t now;
struct tm *ptime;
int j;
diff --git a/util/buildAnnounce.c b/util/buildAnnounce.c
index 3fa8a6a7..f3f75661 100644
--- a/util/buildAnnounce.c
+++ b/util/buildAnnounce.c
@@ -1,12 +1,16 @@
/* 建立所有看板精華區的連結 */
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#include <sys/stat.h>
#include "config.h"
#include "pttstruct.h"
+#include "proto.h"
#define GROUPROOT BBSHOME"/man/group"
extern bcache_t *brdshm;
diff --git a/util/buildir.c b/util/buildir.c
index 381a657d..38573e7f 100644
--- a/util/buildir.c
+++ b/util/buildir.c
@@ -1,4 +1,4 @@
-/* $Id: buildir.c,v 1.1 2002/03/07 15:13:45 in2 Exp $ */
+/* $Id: buildir.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
@@ -11,14 +11,15 @@
#include <sys/stat.h>
#include "config.h"
#include "pttstruct.h"
+#include "proto.h"
int dirselect(struct dirent *dir) {
return strchr("MDSGH", dir->d_name[0]) && dir->d_name[1] == '.';
}
-int mysort(const struct dirent **a,const struct dirent **b)
+int mysort(const void *a, const void *b)
{
- return atoi(((*a)->d_name+2))-atoi(((*b)->d_name+2));
+ return atoi(((*((struct dirent **)a))->d_name+2))-atoi(((*((struct dirent **)b))->d_name+2));
}
int main(int argc, char **argv) {
diff --git a/util/expire.c b/util/expire.c
index d6f3e2b9..c0ebdd09 100644
--- a/util/expire.c
+++ b/util/expire.c
@@ -1,4 +1,4 @@
-/* $Id: expire.c,v 1.1 2002/03/07 15:13:46 in2 Exp $ */
+/* $Id: expire.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
/* 自動砍信工具程式 */
#include <stdio.h>
@@ -15,6 +15,7 @@
#include "config.h"
#include "pttstruct.h"
#include "util.h"
+#include "proto.h"
#define QCAST int (*)(const void *, const void *)
diff --git a/util/inndBM.c b/util/inndBM.c
index 426fa6f5..4f85bfd4 100644
--- a/util/inndBM.c
+++ b/util/inndBM.c
@@ -1,12 +1,16 @@
/* 依據 .BOARD檔 & newsfeeds.bbs 列出參與轉信的所有板資料 */
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#include <sys/stat.h>
#include "config.h"
#include "pttstruct.h"
+#include "proto.h"
+
#define INNDHOME BBSHOME"/innd"
#define INND_NEWSFEED INNDHOME "/newsfeeds.bbs"
@@ -39,12 +43,12 @@ newsfeed_t feedline[MAX_BOARD];
int servercount;
int feedcount;
-int newsfeed_cmp(newsfeed_t *a,newsfeed_t *b)
+int newsfeed_cmp(const void *a, const void *b)
{
int i;
- i=strcasecmp(a->server,b->server);
+ i=strcasecmp(((newsfeed_t*)a)->server,((newsfeed_t*)b)->server);
if(i) return i;
- return strcasecmp(a->board,b->board);
+ return strcasecmp(((newsfeed_t*)a)->board,((newsfeed_t*)b)->board);
}
int get_server(char *name)
diff --git a/util/jungo.c b/util/jungo.c
index 15096b30..8bc4b3a2 100644
--- a/util/jungo.c
+++ b/util/jungo.c
@@ -10,6 +10,7 @@
#include "util.h"
#include "perm.h"
#include "common.h"
+#include "proto.h"
#define OUTFILE BBSHOME "/etc/toplazyBBM"
#define FIREFILE BBSHOME "/etc/topfireBBM"
diff --git a/util/openticket.c b/util/openticket.c
index 69b9ab2a..8a5798b1 100644
--- a/util/openticket.c
+++ b/util/openticket.c
@@ -1,4 +1,4 @@
-/* $Id: openticket.c,v 1.1 2002/03/07 15:13:46 in2 Exp $ */
+/* $Id: openticket.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
/* 開獎的 utility */
#include <stdio.h>
#include <stdlib.h>
@@ -9,7 +9,7 @@
#include "pttstruct.h"
#include "common.h"
#include "util.h"
-
+#include "proto.h"
static char *betname[8] = {"Ptt", "Jaky", "Action", "Heat",
"DUNK", "Jungo", "waiting", "wofe"};
diff --git a/util/post.c b/util/post.c
index d4907096..e14a0814 100644
--- a/util/post.c
+++ b/util/post.c
@@ -1,4 +1,4 @@
-/* $Id: post.c,v 1.2 2002/03/09 17:29:20 in2 Exp $ */
+/* $Id: post.c,v 1.3 2002/03/09 17:44:30 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
@@ -6,6 +6,7 @@
#include "config.h"
#include "pttstruct.h"
#include "util.h"
+#include "proto.h"
void keeplog(FILE *fin, char *fpath, char *board, char *title, char *owner) {
fileheader_t fhdr;
diff --git a/util/rmuid.c b/util/rmuid.c
index cc6e12cb..c936d160 100644
--- a/util/rmuid.c
+++ b/util/rmuid.c
@@ -26,20 +26,21 @@ int getbidofuid(int uid)
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++)
- {
+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);
}
+ return 0;
}
diff --git a/util/toplazyBBM.c b/util/toplazyBBM.c
index 08c07448..5b2f18f3 100644
--- a/util/toplazyBBM.c
+++ b/util/toplazyBBM.c
@@ -10,6 +10,7 @@
#include "util.h"
#include "perm.h"
#include "common.h"
+#include "proto.h"
#define OUTFILE BBSHOME "/etc/toplazyBBM"
#define FIREFILE BBSHOME "/etc/topfireBBM"
diff --git a/util/toplazyBM.c b/util/toplazyBM.c
index ec9319c2..e5e8637b 100644
--- a/util/toplazyBM.c
+++ b/util/toplazyBM.c
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
} while((p=strtok(NULL,"/ "))!=NULL);
if(flag == 1){
- boardheader_t *fhp = 0;
+ //boardheader_t *fhp = 0;
printf("%s %s\n", lostbms[j-1].title, lostbms[j-1].bmname);
bmbuf[0] = '\0';
for(k = 0 , n = 0; k < index; k++){
diff --git a/util/uhash_loader.c b/util/uhash_loader.c
index 2d88dd06..1a963829 100644
--- a/util/uhash_loader.c
+++ b/util/uhash_loader.c
@@ -1,4 +1,4 @@
-/* $Id: uhash_loader.c,v 1.1 2002/03/07 15:13:47 in2 Exp $ */
+/* $Id: uhash_loader.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
/* standalone uhash loader -- jochang */
#include <stdio.h>
#include <unistd.h>
@@ -91,7 +91,7 @@ void fill_uhash(void)
for (mimage = fimage; usernumber < fd; mimage += sizeof(userec_t))
{
- add_to_uhash(usernumber, mimage);
+ add_to_uhash(usernumber, (userec_t *)mimage);
usernumber++;
}
munmap(fimage, stbuf.st_size);
diff --git a/util/util_passwd.c b/util/util_passwd.c
index 07a79351..c9fe4eac 100644
--- a/util/util_passwd.c
+++ b/util/util_passwd.c
@@ -1,8 +1,9 @@
-/* $Id: util_passwd.c,v 1.1 2002/03/07 15:13:46 in2 Exp $ */
+/* $Id: util_passwd.c,v 1.2 2002/03/09 17:44:30 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -12,6 +13,7 @@
#include "pttstruct.h"
#include "modes.h"
#include "common.h"
+#include "proto.h"
#ifndef SEM_R
#define SEM_R 0400