diff options
Diffstat (limited to 'innbbsd')
-rw-r--r-- | innbbsd/bbslib.c | 26 | ||||
-rw-r--r-- | innbbsd/bbslib.h | 2 | ||||
-rw-r--r-- | innbbsd/bbslink.c | 48 | ||||
-rw-r--r-- | innbbsd/bbsnnrp.c | 28 | ||||
-rw-r--r-- | innbbsd/connectsock.c | 14 | ||||
-rw-r--r-- | innbbsd/ctlinnbbsd.c | 6 | ||||
-rw-r--r-- | innbbsd/daemon.c | 1 | ||||
-rw-r--r-- | innbbsd/dbz.c | 3 | ||||
-rw-r--r-- | innbbsd/dbztool.c | 15 | ||||
-rw-r--r-- | innbbsd/echobbslib.c | 23 | ||||
-rw-r--r-- | innbbsd/his.c | 12 | ||||
-rw-r--r-- | innbbsd/innbbsd.c | 25 | ||||
-rw-r--r-- | innbbsd/inndchannel.c | 23 | ||||
-rw-r--r-- | innbbsd/inntobbs.c | 14 | ||||
-rw-r--r-- | innbbsd/mkhistory.c | 3 | ||||
-rw-r--r-- | innbbsd/nocem.c | 9 | ||||
-rw-r--r-- | innbbsd/pmain.c | 2 | ||||
-rw-r--r-- | innbbsd/receive_article.c | 19 |
18 files changed, 161 insertions, 112 deletions
diff --git a/innbbsd/bbslib.c b/innbbsd/bbslib.c index ad171bf6..f16d77ba 100644 --- a/innbbsd/bbslib.c +++ b/innbbsd/bbslib.c @@ -1,3 +1,4 @@ +#include <stdlib.h> #if defined( LINUX ) #include "innbbsconf.h" #include "bbslib.h" @@ -41,6 +42,7 @@ static char * verboseFilename = NULL; static char verbosename[MAXPATHLEN]; +void verboseon(filename) char *filename; { @@ -53,21 +55,25 @@ verboseon(filename) } verboseFilename = filename; } +void verboseoff() { verboseFlag = 0; } +void setverboseon() { verboseFlag = 1; } +int isverboselog() { return verboseFlag; } +void setverboseoff() { verboseoff(); @@ -77,6 +83,7 @@ setverboseoff() } } +void verboselog(char *fmt,...) { va_list ap; @@ -107,6 +114,7 @@ verboselog(char *fmt,...) va_end(ap); } +void #ifdef PalmBBS xbbslog(char *fmt,...) #else @@ -135,14 +143,10 @@ bbslog(char *fmt,...) va_end(ap); } +int initial_bbs(outgoing) char *outgoing; { - FILE *FN; - struct stat st; - int fd, i; - char *bbsnameptr = NULL; - /* reopen bbslog */ if (bbslogfp != NULL) { fclose(bbslogfp); @@ -297,6 +301,7 @@ nl_bynodecmp(a, b) } /* read in newsfeeds.bbs and nodelist.bbs */ +int readnlfile(inndhome, outgoing) char *inndhome; char *outgoing; @@ -304,9 +309,9 @@ readnlfile(inndhome, outgoing) FILE *fp; char buff[1024]; struct stat st; - int i, count, j; + int i, count; char *ptr, *nodelistptr; - static lastcount = 0; + static int lastcount = 0; sprintf(buff, "%s/nodelist.bbs", inndhome); fp = fopen(buff, "r"); @@ -347,7 +352,7 @@ readnlfile(inndhome, outgoing) lastcount = count; NLCOUNT = 0; for (ptr = NODELIST_BUF; (nodelistptr = (char *)strchr(ptr, '\n')) != NULL; ptr = nodelistptr + 1, NLCOUNT++) { - char *nptr, *bptr, *pptr, *tptr; + char *nptr, *tptr; *nodelistptr = '\0'; NODELIST[NLCOUNT].host = ""; NODELIST[NLCOUNT].exclusion = ""; @@ -421,6 +426,7 @@ readnlfile(inndhome, outgoing) return 0; } +int readnffile(inndhome) char *inndhome; { @@ -465,7 +471,7 @@ readnffile(inndhome) } NFCOUNT = 0; for (ptr = NEWSFEEDS_BUF; (newsfeedsptr = (char *)strchr(ptr, '\n')) != NULL; ptr = newsfeedsptr + 1, NFCOUNT++) { - char *nptr, *bptr, *pptr; + char *nptr; *newsfeedsptr = '\0'; NEWSFEEDS[NFCOUNT].newsgroups = ""; NEWSFEEDS[NFCOUNT].board = ""; @@ -502,6 +508,7 @@ readnffile(inndhome) } qsort(NEWSFEEDS, NFCOUNT, sizeof(newsfeeds_t), nfcmp); qsort(NEWSFEEDS_BYBOARD, NFCOUNT, sizeof(newsfeeds_t *), nf_byboardcmp); + return 0; } newsfeeds_t * @@ -627,6 +634,7 @@ myrealloc(optr, size) return ptr; } +void testandmkdir(dir) char *dir; { diff --git a/innbbsd/bbslib.h b/innbbsd/bbslib.h index ed595389..20f7cfb9 100644 --- a/innbbsd/bbslib.h +++ b/innbbsd/bbslib.h @@ -51,7 +51,7 @@ int initial_bbs ARG((char *)); char *restrdup ARG((char *, char *)); nodelist_t *search_nodelist ARG((char *, char *)); newsfeeds_t *search_group ARG((char *)); -int bbslog(char *fmt,...); +void bbslog(char *fmt,...); void *mymalloc ARG((int)); void *myrealloc ARG((void *, int)); diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c index 9bd2059f..52d734c8 100644 --- a/innbbsd/bbslink.c +++ b/innbbsd/bbslink.c @@ -165,7 +165,7 @@ is_outgo_post(board, filename, userid, nickname, subject) /* * woju Cross-fs rename() */ - +int Rename(const char *src, const char *dst) { char cmd[200]; @@ -178,7 +178,7 @@ Rename(const char *src, const char *dst) } - +void bbslink_un_lock(file) char *file; { @@ -188,6 +188,7 @@ bbslink_un_lock(file) unlink(lockfile); } +int bbslink_get_lock(file) char *file; { @@ -219,7 +220,6 @@ bbslink_get_lock(file) return 0; } else { char buf[10]; - int pid; sprintf(buf, "%-.8d\n", getpid()); write(lockfd, buf, strlen(buf)); @@ -262,16 +262,15 @@ tcpmessage() return NNTPbuffer; } +int read_article(lover, filename, userid) linkoverview_t *lover; char *filename, *userid; { - FILE *fp; int fd; struct stat st; - time_t mtime; char *buffer; - char *artptr, *artend, *artback; + char *artend, *artback; if (stat(filename, &st) != 0) return 0; @@ -297,8 +296,6 @@ read_article(lover, filename, userid) artback = strchr(buffer, '\n') ) { /* while( fgets(buffer, sizeof buffer, fp) != NULL) { */ - char *m, *n; - char *ptr; if (artback != NULL) *artback = '\0'; @@ -340,13 +337,13 @@ read_article(lover, filename, userid) return 1; } +void save_outgoing(sover, filename, userid, poster, mtime) soverview_t *sover, *filename, *userid, *poster; time_t mtime; { newsfeeds_t *nf; char *group, *server, *serveraddr; - char *subject, *path; char *board; char *ptr1, *ptr2; @@ -445,10 +442,11 @@ save_article(board, filename, sover) /* process_article() read_article() save_outgoing() save_article() */ +void process_article(board, filename, userid, nickname, subject) char *board, *filename, *userid, *nickname, *subject; { - char *n, *filepath; + char *filepath; char poster[MAXBUFLEN]; soverview_t sover; @@ -493,9 +491,8 @@ char * baseN(val, base, len) int val, base, len; { - int n, ans; + int n; static char str[MAXBUFLEN]; - char *pstr = str; int index; for (index = len - 1; index >= 0; index--) { @@ -539,13 +536,13 @@ hash_value(str) /* process_cancel() save_outgoing() hash_value(); baseN(); ascii_date(); */ +int read_outgoing(sover) soverview_t *sover; { char *board, *filename, *group, *from, *subject, *outgoingtype, *msgid, *path; char *buffer, *bufferp; - FILE *ECHOMAIL, *FN; char *hash; char times[MAXBUFLEN]; time_t mtime; @@ -720,6 +717,7 @@ read_outgoing(sover) #ifdef TEST #endif +void openfeed(node) nodelist_t *node; { @@ -728,6 +726,7 @@ openfeed(node) } } +void queuefeed(node, textline) nodelist_t *node; char *textline; @@ -741,6 +740,7 @@ queuefeed(node, textline) } } +int post_article(node, site, sover, textline) nodelist_t *node; char *site; @@ -885,6 +885,7 @@ post_article(node, site, sover, textline) return 1; } +void process_cancel(board, filename, userid, nickname, subject) char *board, *filename, *userid, *nickname, *subject; { @@ -906,6 +907,7 @@ process_cancel(board, filename, userid, nickname, subject) save_outgoing(&sover, filename, userid, userid, -1); } +int open_link(hostname, hostprot, hostport) char *hostname, *hostprot, *hostport; { @@ -994,6 +996,7 @@ open_link(hostname, hostprot, hostport) return 1; } +int send_outgoing(node, site, hostname, sover, textline) nodelist_t *node; soverview_t *sover; @@ -1071,6 +1074,7 @@ send_outgoing(node, site, hostname, sover, textline) return returnstatus; } +int save_nntplink(node, overview) nodelist_t *node; char *overview; @@ -1115,10 +1119,11 @@ get_tmpfile(tmpfile) /* cancel moderating posts */ +int cancel_outgoing(board, filename, from, subject) char *board, *filename, *from, *subject; { - char *base, filepath[MAXPATHLEN]; + char filepath[MAXPATHLEN]; FILE *FN; char *result; char TMPFILE[MAXPATHLEN]; @@ -1185,6 +1190,7 @@ cancel_outgoing(board, filename, from, subject) * send_nntplink open_link read_outgoing send_outgoing post_article * cancel_outgoing */ +int send_nntplink(node, site, hostname, hostprot, hostport, overview, nlcount) nodelist_t *node; char *site, *hostname, *hostprot, *hostport, *overview; @@ -1193,8 +1199,6 @@ send_nntplink(node, site, hostname, hostprot, hostport, overview, nlcount) FILE *POSTS; char textline[1024]; char baktextline[1024]; - char *filepath; - int status; if (Verbose) { printf("<send nntplink> %s %s %s %s\n", site, hostname, hostprot, hostport); @@ -1335,8 +1339,10 @@ try_read_outgoing: printf("<Unlinking> %s\n", overview); if (!NoAction) unlink(overview); + return 0; } +void close_link() { int status; @@ -1362,9 +1368,10 @@ close_link() * */ +void send_article() { - char *site, *addr, *protocol, *port, *op; + char *site, *op; char *nntphost; int nlcount; @@ -1471,6 +1478,7 @@ send_article() /* bntplink() bbspost() process_article() process_cancel() send_article() */ +void show_usage(argv) char *argv; { @@ -1489,13 +1497,13 @@ show_usage(argv) } +int bntplink(argc, argv) int argc; char **argv; { static char *OUTING = ".outing"; nodelist_t *nl; - int linkport; char result[4096]; char cancelfile[MAXPATHLEN], cancelpost[MAXPATHLEN]; char bbslink_lockfile[MAXPATHLEN]; @@ -1621,7 +1629,7 @@ bntplink(argc, argv) while (fgets(result, sizeof result, CANCELFILE) != NULL) { /* chop( $_ ); */ char *board, *filename, *userid, *nickname, *subject; - char *ptr, **sptr; + char *ptr; ptr = strchr(result, '\n'); if (ptr) @@ -1722,6 +1730,7 @@ char *REMOTEHOSTNAME = ""; extern char *optarg; extern int opterr, optind; +int main(argc, argv) int argc; char **argv; @@ -1783,6 +1792,7 @@ main(argc, argv) return 0; } +void readNCMfile() { } diff --git a/innbbsd/bbsnnrp.c b/innbbsd/bbsnnrp.c index 6aeeeb86..ef6423b5 100644 --- a/innbbsd/bbsnnrp.c +++ b/innbbsd/bbsnnrp.c @@ -10,6 +10,7 @@ * group each time) -t stdin|nntp (default=nntp) */ +#include <stdlib.h> #include "innbbsconf.h" #include "osdep.h" #include <sys/mman.h> @@ -112,6 +113,7 @@ char DefaultModerator[MAXBUFLEN]; char DefaultTrustfrom[MAXBUFLEN]; char DefaultTrustFrom[MAXBUFLEN]; +void usage(arg) char *arg; { @@ -144,6 +146,7 @@ static char *NntpInputType = "nntp"; static char *NntpIhaveProtocol = "ihave"; static char *NntpPostProtocol = "post"; static char *DefaultNntpProtocol; +int main(argc, argv) int argc; char **argv; @@ -270,7 +273,6 @@ main(argc, argv) exit(1); } else { char buf[10]; - int pid; sprintf(buf, "%-.8d\n", getpid()); write(lockfd, buf, strlen(buf)); close(lockfd); @@ -322,6 +324,7 @@ main(argc, argv) return 0; } +int headbegin(buffer) char *buffer; { @@ -336,12 +339,11 @@ headbegin(buffer) return 0; } +void stdinreadnews(bbsnnrp) nnrp_t *bbsnnrp; { - int i; char buffer[4096]; - ULONG low, high; char tmpfilename[MAXPATHLEN]; FILE *tmpfp = NULL; char mid[1024]; @@ -534,12 +536,11 @@ stdinreadnews(bbsnnrp) static char *ACT_BUF, *RC_BUF; int ACT_COUNT; +void initrcfiles(bbsnnrp) nnrp_t *bbsnnrp; { - FILE *actfp, *rcfp; - char buff[1024]; - int actfd, i, count, actcount = 0, rcount = 0, maxcount; + int actfd, i, count; struct stat st; char *actlistptr, *ptr; @@ -644,6 +645,7 @@ initrcfiles(bbsnnrp) } } +void initsockets(server, bbsnnrp, type) char *server; nnrp_t *bbsnnrp; @@ -708,6 +710,7 @@ initsockets(server, bbsnnrp, type) } } +void closesockets() { fclose(BBSNNRP.nnrpin); @@ -718,6 +721,7 @@ closesockets() close(BBSNNRP.innbbsfd); } +void updaterc(actptr, len, value) char *actptr; int len; @@ -744,6 +748,7 @@ myrename(old, new) return rename(old, new); } +void flushrc(bbsnnrp) nnrp_t *bbsnnrp; { @@ -780,6 +785,7 @@ flushrc(bbsnnrp) bbsnnrp->actdirty = 0; } +void writerc(bbsnnrp) nnrp_t *bbsnnrp; { @@ -854,8 +860,7 @@ NNRPxhdr(pattern, bbsnnrp, i, low, high) int i; ULONG low, high; { - newsrc_t *rcptr = &bbsnnrp->newsrc[i]; - int size, code; + int code; Xhdrfp = bbsnnrp->nnrpin; fprintf(bbsnnrp->nnrpout, "XHDR %s %d-%d\r\n", pattern, low, high); @@ -908,8 +913,6 @@ INNBBSstat(bbsnnrp, i, mid) int i; char *mid; { - newsrc_t *rcptr = &bbsnnrp->newsrc[i]; - int size, code; fprintf(bbsnnrp->innbbsout, "STAT %s\r\n", mid); fflush(bbsnnrp->innbbsout); @@ -925,7 +928,7 @@ INNBBSihave(bbsnnrp, artno, mid) ULONG artno; char *mid; { - int size, code; + int code; int header = 1; if (DefaultNntpProtocol == NntpPostProtocol) { @@ -1050,6 +1053,7 @@ NNRPgroup(bbsnnrp, i, low, high) } +void readnews(server, bbsnnrp) char *server; nnrp_t *bbsnnrp; @@ -1108,7 +1112,6 @@ readnews(server, bbsnnrp) for (i = 0; i < ACT_COUNT; i++) { int code = NNRPgroup(bbsnnrp, i, &low, &high); newsrc_t *rcptr = &bbsnnrp->newsrc[i]; - int j; ULONG artno; char *mid; int artcount; @@ -1230,6 +1233,7 @@ readnews(server, bbsnnrp) */ } +void INNBBSDhalt() { } diff --git a/innbbsd/connectsock.c b/innbbsd/connectsock.c index 45796d0c..4b9382b5 100644 --- a/innbbsd/connectsock.c +++ b/innbbsd/connectsock.c @@ -1,3 +1,4 @@ +#include <stdlib.h> #include "osdep.h" #include "innbbsconf.h" #include "daemon.h" @@ -31,15 +32,15 @@ dokill(s) kill(0, SIGKILL); } -static INETDstart = 0; -int +static int INETDstart = 0; +void startfrominetd(flag) { INETDstart = flag; } -int +void standalonesetup(fd) int fd; { @@ -55,6 +56,7 @@ standalonesetup(fd) static char *UNIX_SERVER_PATH; static int (*halt) (); +void sethaltfunction(haltfunc) int (*haltfunc) (); { @@ -84,6 +86,7 @@ doremove(s) } +int initunixserver(path, protocol) char *path; char *protocol; @@ -92,7 +95,6 @@ initunixserver(path, protocol) /* unix endpoint address */ struct protoent *pe; /* protocol information entry */ int s; - char *ptr; bzero((char *)&s_un, sizeof(s_un)); s_un.sun_family = AF_UNIX; @@ -130,12 +132,12 @@ initunixserver(path, protocol) return s; } +int initinetserver(service, protocol) char *service; char *protocol; { struct servent *se; /* service information entry */ - struct hostent *he; /* host information entry */ struct protoent *pe; /* protocol information entry */ struct sockaddr_in sin; /* Internet endpoint address */ int port, s; @@ -309,7 +311,7 @@ inetserver(service, protocol, serverfunc) char *protocol; int (*serverfunc) ARG((int)); { - int port, s; + int s; if (!INETDstart) s = initinetserver(service, protocol); diff --git a/innbbsd/ctlinnbbsd.c b/innbbsd/ctlinnbbsd.c index d7f6f36f..45830dc4 100644 --- a/innbbsd/ctlinnbbsd.c +++ b/innbbsd/ctlinnbbsd.c @@ -1,9 +1,11 @@ +#include <stdlib.h> #include "innbbsconf.h" #include "bbslib.h" extern char *optarg; extern int opterr, optind; +void usage(name) char *name; { @@ -33,6 +35,7 @@ char INNBBSbuffer[4096]; FILE *innbbsin, *innbbsout; int innbbsfd; +void ctlinnbbsd(argc, argv) int argc; char **argv; @@ -104,6 +107,7 @@ ctlinnbbsd(argc, argv) } } +void initsocket() { innbbsfd = unixclient(DefaultPath, "tcp"); @@ -118,6 +122,7 @@ initsocket() } } +void closesocket() { if (innbbsin != NULL) @@ -128,6 +133,7 @@ closesocket() close(innbbsfd); } +int main(argc, argv) int argc; char **argv; diff --git a/innbbsd/daemon.c b/innbbsd/daemon.c index a60d7d73..b764fda1 100644 --- a/innbbsd/daemon.c +++ b/innbbsd/daemon.c @@ -1,3 +1,4 @@ +#include <string.h> #include "daemon.h" /* * typedef struct daemoncmd { char *cmdname; char *usage; int argc; int diff --git a/innbbsd/dbz.c b/innbbsd/dbz.c index 58616968..bc6d5b76 100644 --- a/innbbsd/dbz.c +++ b/innbbsd/dbz.c @@ -1321,9 +1321,6 @@ static of_t * /* pointer to copy, or NULL */ getcore(f) FILE *f; { - register of_t *p; - register size_t i; - register size_t nread; register char *it; #ifdef MMAP struct stat st; diff --git a/innbbsd/dbztool.c b/innbbsd/dbztool.c index a0a35c94..34fc4046 100644 --- a/innbbsd/dbztool.c +++ b/innbbsd/dbztool.c @@ -1,13 +1,14 @@ +#include <string.h> +#include <unistd.h> #include <sys/file.h> #include "his.h" #define DEBUG 1 #undef DEBUG -static datum content, inputkey, inputvalue; +static datum content, inputkey; static char dboutput[1025]; static char dbinput[1025]; -static char valueinput[100]; enum { SUBJECT, FROM, NAME @@ -16,8 +17,7 @@ char * DBfetch(key) char *key; { - int i; - char *tail, *ptr; + char *ptr; if (key == NULL) return NULL; sprintf(dbinput, "%.510s", key); @@ -31,12 +31,11 @@ DBfetch(key) return ptr; } +int DBstore(key, paths) char *key; char *paths; { - int i; - char *tail; time_t now; time(&now); if (key == NULL) @@ -56,8 +55,7 @@ storeDB(mid, paths) char *mid; char *paths; { - char *key, *ptr; - int rel; + char *ptr; ptr = DBfetch(mid); if (ptr != NULL) { return 0; @@ -66,6 +64,7 @@ storeDB(mid, paths) } } +int my_mkdir(idir, mode) char *idir; int mode; diff --git a/innbbsd/echobbslib.c b/innbbsd/echobbslib.c index 667c30ab..7efc00d4 100644 --- a/innbbsd/echobbslib.c +++ b/innbbsd/echobbslib.c @@ -1,3 +1,4 @@ +#include <stdlib.h> #if defined( LINUX ) #include "innbbsconf.h" #include "bbslib.h" @@ -41,6 +42,7 @@ static char * verboseFilename = NULL; static char verbosename[MAXPATHLEN]; +void verboseon(filename) char *filename; { @@ -53,21 +55,25 @@ verboseon(filename) } verboseFilename = filename; } +void verboseoff() { verboseFlag = 0; } +void setverboseon() { verboseFlag = 1; } +int isverboselog() { return verboseFlag; } +void setverboseoff() { verboseoff(); @@ -77,6 +83,7 @@ setverboseoff() } } +void verboselog(char *fmt,...) { va_list ap; @@ -107,6 +114,7 @@ verboselog(char *fmt,...) va_end(ap); } +void #ifdef PalmBBS xbbslog(char *fmt,...) #else @@ -135,12 +143,11 @@ bbslog(char *fmt,...) va_end(ap); } +int initial_bbs(outgoing) char *outgoing; { FILE *FN; - struct stat st; - int fd, i; char *bbsnameptr = NULL; /* reopen bbslog */ @@ -296,6 +303,7 @@ nl_bynodecmp(a, b) } /* read in newsfeeds.bbs and nodelist.bbs */ +int readnlfile(inndhome, outgoing) char *inndhome; char *outgoing; @@ -303,9 +311,9 @@ readnlfile(inndhome, outgoing) FILE *fp; char buff[1024]; struct stat st; - int i, count, j; + int i, count; char *ptr, *nodelistptr; - static lastcount = 0; + static int lastcount = 0; sprintf(buff, "%s/nodelist.bbs", inndhome); fp = fopen(buff, "r"); @@ -346,7 +354,7 @@ readnlfile(inndhome, outgoing) lastcount = count; NLCOUNT = 0; for (ptr = NODELIST_BUF; (nodelistptr = (char *)strchr(ptr, '\n')) != NULL; ptr = nodelistptr + 1, NLCOUNT++) { - char *nptr, *bptr, *pptr, *tptr; + char *nptr, *tptr; *nodelistptr = '\0'; NODELIST[NLCOUNT].host = ""; NODELIST[NLCOUNT].exclusion = ""; @@ -420,6 +428,7 @@ readnlfile(inndhome, outgoing) return 0; } +int readnffile(inndhome) char *inndhome; { @@ -464,7 +473,7 @@ readnffile(inndhome) } NFCOUNT = 0; for (ptr = NEWSFEEDS_BUF; (newsfeedsptr = (char *)strchr(ptr, '\n')) != NULL; ptr = newsfeedsptr + 1, NFCOUNT++) { - char *nptr, *bptr, *pptr; + char *nptr; *newsfeedsptr = '\0'; NEWSFEEDS[NFCOUNT].newsgroups = ""; NEWSFEEDS[NFCOUNT].board = ""; @@ -502,6 +511,7 @@ readnffile(inndhome) } qsort(NEWSFEEDS, NFCOUNT, sizeof(newsfeeds_t), nfcmp); qsort(NEWSFEEDS_BYBOARD, NFCOUNT, sizeof(newsfeeds_t *), nf_byboardcmp); + return 0; } newsfeeds_t * @@ -627,6 +637,7 @@ myrealloc(optr, size) return ptr; } +void testandmkdir(dir) char *dir; { diff --git a/innbbsd/his.c b/innbbsd/his.c index ac9a3285..6ab68627 100644 --- a/innbbsd/his.c +++ b/innbbsd/his.c @@ -3,6 +3,7 @@ * * History file routines. */ +#include <stdlib.h> #include "innbbsconf.h" #include "bbslib.h" #include "his.h" @@ -23,12 +24,14 @@ STATIC char *LogName = "xindexchan"; #define DEFAULT_HIST_SIZE 100000 #endif +void hisincore(flag) int flag; { HISincore = flag; } +void makedbz(histpath, entry) char *histpath; long entry; @@ -47,7 +50,6 @@ mkhistory(srchist) char *srchist; { FILE *hismaint; - time_t lasthist, now; char maintbuff[256]; char *ptr; hismaint = fopen(srchist, "r"); @@ -89,7 +91,7 @@ time_t gethisinfo() { FILE *hismaint; - time_t lasthist, now; + time_t lasthist; char maintbuff[4096]; char *ptr; hismaint = fopen(HISTORY, "r"); @@ -177,7 +179,7 @@ HISsetup() myHISsetup(HISTORY); } -int +void myHISsetup(histpath) char *histpath; { @@ -384,6 +386,7 @@ HISslashify(p) } +void IOError(error) char *error; { @@ -391,11 +394,11 @@ IOError(error) } /* BOOL */ +int myHISwrite(key, remain) datum *key; char *remain; { - static char NOPATHS[] = ""; long offset; datum val; int i; @@ -440,7 +443,6 @@ HISwrite(key, date, paths) char *paths; long date; { - static char NOPATHS[] = ""; long offset; datum val; int i; diff --git a/innbbsd/innbbsd.c b/innbbsd/innbbsd.c index f782e8da..88209bf6 100644 --- a/innbbsd/innbbsd.c +++ b/innbbsd/innbbsd.c @@ -72,12 +72,14 @@ static daemoncmd_t cmds[] = {NULL, NULL, 0, 0, 99, 100, NULL} }; +void installinnbbsd() { installdaemon(cmds, 100, NULL); } #ifdef OLDLIBINBBSINND +void testandmkdir(dir) char *dir; { @@ -217,6 +219,7 @@ CMDtnrpd(client) return 0; } +int islocalconnect(client) ClientType *client; { @@ -226,7 +229,8 @@ islocalconnect(client) return 1; } -static shutdownflag = 0; +static int shutdownflag = 0; +void INNBBSDhalt() { shutdownflag = 1; @@ -243,7 +247,6 @@ CMDshutdown(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (!islocalconnect(client)) { fprintf(argv->out, "%d shutdown access denied\r\n", p->errorcode); @@ -265,7 +268,6 @@ CMDmode(client) /* char cwdpath[MAXPATHLEN+1]; */ argv_t *argv = &client->Argv; extern ClientType INNBBSD_STAT; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; time_t uptime, now; int i, j; @@ -336,7 +338,6 @@ CMDlistnodelist(client) { int nlcount; argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (!islocalconnect(client)) { fprintf(argv->out, "%d listnodelist access denied\r\n", p->errorcode); @@ -361,7 +362,6 @@ CMDlistnewsfeeds(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; int nfcount; if (!islocalconnect(client)) { @@ -417,7 +417,6 @@ CMDgetrusage(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; struct rusage ru; if (!islocalconnect(client)) { @@ -456,7 +455,6 @@ CMDhismaint(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (!islocalconnect(client)) { fprintf(argv->out, "%d hismaint access denied\r\n", p->errorcode); @@ -477,7 +475,6 @@ CMDreload(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (!islocalconnect(client)) { fprintf(argv->out, "%d reload access denied\r\n", p->errorcode); @@ -497,7 +494,6 @@ CMDverboselog(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (!islocalconnect(client)) { fprintf(argv->out, "%d verboselog access denied\r\n", p->errorcode); @@ -526,7 +522,6 @@ CMDmidcheck(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (client->mode == 0) { if (argv->argc > 1) { @@ -549,7 +544,6 @@ CMDgrephist(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; if (client->mode == 0) { if (argv->argc > 1) { @@ -580,7 +574,6 @@ CMDaddhist(client) ClientType *client; { argv_t *argv = &client->Argv; - buffer_t *in = &client->in; daemoncmd_t *p = argv->dc; /* * if (strcmp(client->username,"localuser") != 0 || @@ -624,9 +617,7 @@ CMDstat(client) ClientType *client; { argv_t *argv = &client->Argv; - char *ptr, *frontptr; - buffer_t *in = &client->in; - daemoncmd_t *p; + char *ptr; if (client->mode == 0) { client->statcount++; if (argv->argc > 1) { @@ -661,9 +652,7 @@ CMDihave(client) ClientType *client; { argv_t *argv = &client->Argv; - char *ptr = NULL, *frontptr; - buffer_t *in = &client->in; - daemoncmd_t *p; + char *ptr = NULL; if (client->mode == 0) { client->ihavecount++; if (argv->argc > 1) { diff --git a/innbbsd/inndchannel.c b/innbbsd/inndchannel.c index 62638001..ddbb7aac 100644 --- a/innbbsd/inndchannel.c +++ b/innbbsd/inndchannel.c @@ -1,3 +1,4 @@ +#include <stdlib.h> #include "innbbsconf.h" #include "daemon.h" #include "bbslib.h" @@ -42,13 +43,14 @@ char *REMOTEUSERNAME, *REMOTEHOSTNAME; static fd_set rfd, wfd, efd, orfd, owfd, oefd; +void clearfdset(fd) int fd; { FD_CLR(fd, &rfd); } -static +static void channelcreate(client) ClientType *client; { @@ -74,6 +76,7 @@ channelcreate(client) client->begin = time(NULL); } +void channeldestroy(client) ClientType *client; { @@ -101,6 +104,7 @@ channeldestroy(client) #endif } +void inndchannel(port, path) char *port, *path; { @@ -108,7 +112,6 @@ inndchannel(port, path) int i; int bbsinnd; int localbbsinnd; - char obuf[4096]; struct timeval tout; ClientType *client = (ClientType *) mymalloc(sizeof(ClientType) * Maxclient); int localdaemonready = 0; @@ -198,8 +201,7 @@ inndchannel(port, path) continue; } if (localdaemonready && FD_ISSET(localbbsinnd, &orfd)) { - int ns, length; - int cc; + int ns; ns = tryaccept(localbbsinnd); if (ns < 0) continue; @@ -245,7 +247,6 @@ inndchannel(port, path) struct sockaddr_in there; char *name; struct hostent *hp; - int cc; if (ns < 0) continue; for (i = 0; i < Maxclient; ++i) { @@ -267,7 +268,6 @@ inndchannel(port, path) FD_SET(ns, &rfd); /* FD_SET(ns,&wfd); */ length = sizeof(there); if (getpeername(ns, (struct sockaddr *) & there, &length) >= 0) { - time_t now = time((time_t *) 0); name = (char *)my_rfc931_name(ns, &there); strncpy(client[i].username, name, 20); hp = (struct hostent *) gethostbyaddr((char *)&there.sin_addr, sizeof(struct in_addr), there.sin_family); @@ -343,8 +343,7 @@ int channelreader(client) ClientType *client; { - int len, clientlen; - char buffer1[8192], buffer2[4096]; + int len; char *ptr; buffer_t *in = &client->in; @@ -380,6 +379,7 @@ channelreader(client) return len; } +void commandparse(client) ClientType *client; { @@ -387,7 +387,6 @@ commandparse(client) argv_t *Argv = &client->Argv; int (*Main) (); char *buffer = client->in.data; - int fd = client->fd; buffer_t *in = &client->in; int dataused; int dataleft; @@ -493,6 +492,7 @@ commandparse(client) } } +void do_command() { } @@ -534,11 +534,13 @@ standaloneinit(port) fprintf(pf, "%d\n", getpid()); fclose(pf); } + return 0; } extern char *optarg; extern int opterr, optind; +void innbbsusage(name) char *name; { @@ -569,11 +571,13 @@ main() #endif static time_t INNBBSDstartup; +int innbbsdstartup() { return INNBBSDstartup; } +int main(argc, argv) int argc; char **argv; @@ -666,4 +670,5 @@ main(argc, argv) signal(SIGPIPE, dopipesig); inndchannel(port, path); HISclose(); + return 0; } diff --git a/innbbsd/inntobbs.c b/innbbsd/inntobbs.c index fb1211ee..7ac54a22 100644 --- a/innbbsd/inntobbs.c +++ b/innbbsd/inntobbs.c @@ -79,12 +79,13 @@ isexcluded(path1, nl) return 0; } +void feedfplog(nf, filepath, type) newsfeeds_t *nf; char *filepath; int type; { - char *path1, *path2, *hostptr; + char *path1; nodelist_t *nl; if (nf == NULL) return; @@ -144,8 +145,9 @@ feedfplog(nf, filepath, type) } static FILE *bbsfeedsfp = NULL; -static bbsfeedson = -1; +static int bbsfeedson = -1; +void init_bbsfeedsfp() { if (bbsfeedsfp != NULL) { @@ -155,6 +157,7 @@ init_bbsfeedsfp() bbsfeedson = -1; } +void bbsfeedslog(filepath, type) char *filepath; int type; @@ -186,8 +189,9 @@ bbsfeedslog(filepath, type) } static FILE *echomailfp = NULL; -static echomaillogon = -1; +static int echomaillogon = -1; +void init_echomailfp() { if (echomailfp != NULL) { @@ -197,6 +201,7 @@ init_echomailfp() echomaillogon = -1; } +void echomaillog() { @@ -234,8 +239,6 @@ int readlines(client) ClientType *client; { - int fd = client->fd; - char *buffer = client->buffer; buffer_t *in = &client->in; char *front = in->data, *ptr, *hptr; int i; @@ -306,6 +309,7 @@ headervalue(inputheader) return -1; } +void article_init() { int i; diff --git a/innbbsd/mkhistory.c b/innbbsd/mkhistory.c index fb400adf..cc986b03 100644 --- a/innbbsd/mkhistory.c +++ b/innbbsd/mkhistory.c @@ -1,6 +1,8 @@ +#include <stdlib.h> #include "innbbsconf.h" #include "bbslib.h" +int main(argc, argv) int argc; char *argv[]; @@ -11,4 +13,5 @@ main(argc, argv) } initial_bbs(NULL); mkhistory(argv[1]); + return 0; } diff --git a/innbbsd/nocem.c b/innbbsd/nocem.c index a57834ed..cea4e088 100644 --- a/innbbsd/nocem.c +++ b/innbbsd/nocem.c @@ -3,6 +3,7 @@ * NCMverify(), NCMcancel(): return 0 success, otherwise fail; */ +#include <stdlib.h> #include "nocem.h" #define PGP5 #undef PGP2 @@ -64,7 +65,7 @@ ncmperm_t * search_issuer(issuer) char *issuer; { - ncmperm_t ncmt, *find; + ncmperm_t *find; int i; for (i = 0; i < NCMCOUNT; i++) { @@ -82,7 +83,7 @@ ncmperm_t * search_issuer_type(issuer, type) char *issuer, *type; { - ncmperm_t ncmt, *find; + ncmperm_t *find; int i; for (i = 0; i < NCMCOUNT; i++) { @@ -193,6 +194,7 @@ readNCMfile(inndhome) return 0; } +int NCMupdate(char *issuer, char *type) { FILE *fp; @@ -228,6 +230,7 @@ NCMupdate(char *issuer, char *type) sleep(1); if (readNCMfile(INNDHOME) == -1) bbslog("fail to readNCMfile\n"); + return 0; } int tcpcommand(char *fmt, ...) @@ -578,6 +581,7 @@ NCMcancel() /* NoCeM-innbbsd */ /* ------------------------------------------------------------------ */ +void initial_nocem() { bzero(SPAMMID[0], strlen(SPAMMID[0]) * num_spammid); @@ -589,7 +593,6 @@ int receive_nocem() { int rel; - ncmperm_t *ncmt; if (ncmdebug) bbslog("NCM: receive %s\n", MSGID); diff --git a/innbbsd/pmain.c b/innbbsd/pmain.c index d86dc88e..2f7e8c91 100644 --- a/innbbsd/pmain.c +++ b/innbbsd/pmain.c @@ -7,6 +7,7 @@ #define INNBBSDPATH1 ".innbbsd1" #define INNBBSDPATH2 ".innbbsd2" +int pmain(port) char *port; { @@ -31,6 +32,7 @@ pmain(port) } } +int p_unix_main(path) char *path; { diff --git a/innbbsd/receive_article.c b/innbbsd/receive_article.c index 940f94a3..16c3d9a2 100644 --- a/innbbsd/receive_article.c +++ b/innbbsd/receive_article.c @@ -63,6 +63,7 @@ report() #endif /* process post write */ +int bbspost_write_post(fh, board, filename) int fh; char *board; @@ -180,6 +181,7 @@ bbspost_write_cancel(fh, board, filename) #endif +int bbspost_write_control(fh, board, filename) int fh; char *board; @@ -230,11 +232,11 @@ time_t datevalue; /* process cancel write */ +int receive_article() { - int i; char *user, *userptr; - char *ngptr, *nngptr, *pathptr; + char *ngptr, *pathptr; char **splitptr; static char userid[32]; static char xdate[32]; @@ -244,7 +246,6 @@ receive_article() char hispaths[4096]; char firstpath[MAXPATHLEN], *firstpathbase; char *lesssym, *nameptrleft, *nameptrright; - static char sitebuf[80]; #ifdef HMM_USE_ANTI_SPAM char *notitle[] = @@ -462,6 +463,7 @@ receive_article() return 0; } +int receive_control() { char *boardhome, *fname; @@ -500,6 +502,7 @@ receive_control() return 0; } +int cancel_article_front(msgid) char *msgid; { @@ -538,7 +541,7 @@ cancel_article_front(msgid) if (isfile(filename)) { FILE *fp = fopen(filename, "r"); char buffer[1024]; - char xfrom0[100], xfrom[100], xpath[1024], *boardhome; + char xfrom0[100], xfrom[100], xpath[1024]; if (fp == NULL) continue; @@ -675,13 +678,11 @@ post_article(homepath, userid, board, writebody, pathname, firstpath) int (*writebody) (); char *pathname, *firstpath; { - struct userec_t record; struct fileheader_t header; char *subject = SUBJECT; char index[MAXPATHLEN]; static char name[MAXPATHLEN]; char article[MAXPATHLEN]; - char buf[MAXPATHLEN], *ptr; FILE *fidx; int fh, bid; time_t now; @@ -782,6 +783,7 @@ post_article(homepath, userid, board, writebody, pathname, firstpath) * woju Cross-fs rename() */ +int Rename(const char *src, const char *dst) { char cmd[200]; @@ -795,6 +797,7 @@ Rename(const char *src, const char *dst) } +void cancelpost(fileheader_t * fhdr, char *boardname) { int fd; @@ -914,6 +917,7 @@ delete_record(const char *fpath, int size, int id) return 0; } +int cancel_article(homepath, board, file) char *homepath; char *board, *file; @@ -921,8 +925,7 @@ cancel_article(homepath, board, file) struct fileheader_t header; struct stat state; char dirname[MAXPATHLEN]; - char buf[MAXPATHLEN]; - long numents, size, time, now; + long size, time, now; int fd, lower, ent; |