aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-08 17:51:52 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-08 17:51:52 +0000
commitcb236290e267f17d5f81a18d742b81f1b74b05a2 (patch)
treee6c74acdaa0881bb8accab285d77f146381b2f81
parent7b11f0ff9972d8046e69f98948fdab26b5199caf (diff)
downloadfetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.tar.gz
fetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.tar.bz2
fetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.zip
Prototypes everywhere.
svn path=/trunk/; revision=515
-rw-r--r--configure.in11
-rw-r--r--daemon.c6
-rw-r--r--driver.c20
-rw-r--r--fetchmail.c30
-rw-r--r--fetchmail.h14
-rw-r--r--imap.c42
-rw-r--r--md5global.h2
-rw-r--r--mx.h2
-rw-r--r--mxget.c3
-rw-r--r--options.c2
-rw-r--r--pop2.c27
-rw-r--r--pop3.c99
-rw-r--r--rcfile_y.y13
-rw-r--r--smtp.h2
-rw-r--r--socket.c14
-rw-r--r--socket.h3
-rw-r--r--uid.c46
-rw-r--r--xmalloc.c30
18 files changed, 112 insertions, 254 deletions
diff --git a/configure.in b/configure.in
index 01424b2e..a7414204 100644
--- a/configure.in
+++ b/configure.in
@@ -76,17 +76,6 @@ AC_TRY_COMPILE([],
[AC_DEFINE(HAVE_VOIDPOINTER) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
-dnl Check for usable function prototypes
-AC_MSG_CHECKING(use of function prototypes);
-AC_TRY_COMPILE([],
- [int x;
- int myProtoFn (int arg);
- x = 0;
- x = myProtoFn(x);
- ],
- [AC_DEFINE(HAVE_PROTOTYPES) AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
-
dnl Check out the wait reality. We have to assume sys/wait.h is present.
AC_CHECK_FUNCS(waitpid wait3)
AC_MSG_CHECKING(for union wait);
diff --git a/daemon.c b/daemon.c
index 622b01e7..cda435d1 100644
--- a/daemon.c
+++ b/daemon.c
@@ -34,7 +34,7 @@
#include "fetchmail.h"
RETSIGTYPE
-sigchld_handler ()
+sigchld_handler (int sig)
/* process SIGCHLD/SIGCLD to obtain the exit code of the terminating process */
{
pid_t pid;
@@ -58,10 +58,8 @@ sigchld_handler ()
}
int
-daemonize (logfile, termhook)
+daemonize (const char *logfile, void (*termhook)(int))
/* detach from control TTY, become process group leader, catch SIGCHLD */
-const char *logfile;
-void (*termhook)(int);
{
int fd;
pid_t childpid;
diff --git a/driver.c b/driver.c
index dd65f5e7..13752cf4 100644
--- a/driver.c
+++ b/driver.c
@@ -76,9 +76,8 @@ int count; /* length of src */
return len;
}
-static void vtalarm(timeleft)
+static void vtalarm(int timeleft)
/* reset the nonresponse-timeout */
-int timeleft;
{
struct itimerval ntimeout;
@@ -97,10 +96,8 @@ static void vtalarm_handler (int signal)
#ifdef HAVE_RES_SEARCH
#define MX_RETRIES 3
-static int is_host_alias(name, ctl)
+static int is_host_alias(const char *name, struct query *ctl)
/* determine whether name is a DNS alias of the hostname */
-const char *name;
-struct query *ctl;
{
struct hostent *he;
int i;
@@ -202,9 +199,8 @@ struct idlist **xmit_names; /* list of recipient names parsed out */
}
#endif /* HAVE_RES_SEARCH */
-static FILE *smtp_open(ctl)
+static FILE *smtp_open(struct query *ctl)
/* try to open a socket to the appropriate SMTP server for this query */
-struct query *ctl;
{
ctl = ctl->leader; /* go to the SMTP leader for this query */
@@ -234,9 +230,9 @@ struct query *ctl;
static int gen_readmsg (sockfp, len, delimited, ctl)
/* read message content and ship to SMTP or MDA */
-FILE *sockfp; /* to which the server is connected */
-long len; /* length of message */
-int delimited; /* does the protocol use a message delimiter? */
+FILE *sockfp; /* to which the server is connected */
+long len; /* length of message */
+int delimited; /* does the protocol use a message delimiter? */
struct query *ctl; /* query control record */
{
char buf [MSGBUFSIZE+1];
@@ -535,10 +531,10 @@ struct query *ctl; /* query control record */
#ifdef KERBEROS_V4
int
-kerberos_auth (socket, canonical)
+kerberos_auth (int socket, canonical)
/* authenticate to the server host using Kerberos V4 */
int socket; /* socket to server host */
-char *canonical; /* server name */
+const char *canonical; /* server name */
{
char * host_primary;
KTEXT ticket;
diff --git a/fetchmail.c b/fetchmail.c
index 9e88dce7..47620dfe 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -27,13 +27,11 @@
#define DROPDEAD 6 /* maximum bad socket opens */
-#ifdef HAVE_PROTOTYPES
/* prototypes for internal functions */
static int load_params(int, char **, int);
static void dump_params (struct query *);
static int query_host(struct query *);
static char *visbuf(const char *);
-#endif
/* controls the detail level of status/progress messages written to stderr */
int outlevel; /* see the O_.* constants above */
@@ -59,16 +57,14 @@ static int lastsig;
RETSIGTYPE donothing(sig) int sig; {signal(sig, donothing); lastsig = sig;}
-static void unlockit()
+static void unlockit(void)
/* must-do actions for exit (but we can't count on being able to do malloc) */
{
unlink(lockfile);
}
-int main (argc,argv)
-int argc;
-char **argv;
-{
+int main (int argc, char **argv)
+{
int st, bkgd = FALSE;
int parsestatus, implicitmode;
char *home, *tmpdir, tmpbuf[BUFSIZ];
@@ -384,10 +380,7 @@ char **argv;
exit(popstatus);
}
-static int load_params(argc, argv, optind)
-int argc;
-char **argv;
-int optind;
+static int load_params(int argc, char **argv, int optind)
{
int implicitmode, st;
struct passwd *pw;
@@ -588,9 +581,8 @@ void termhook(int sig)
exit(popstatus);
}
-static char *showproto(proto)
+static char *showproto(int proto)
/* protocol index to protocol name mapping */
-int proto;
{
switch (proto)
{
@@ -608,9 +600,8 @@ int proto;
*/
static const int autoprobe[] = {P_IMAP, P_POP3, P_POP2};
-static int query_host(ctl)
+static int query_host(struct query *ctl)
/* perform fetch transaction with single host */
-struct query *ctl;
{
int i, st;
@@ -649,9 +640,8 @@ struct query *ctl;
}
}
-void dump_params (ctl)
+void dump_params (struct query *ctl)
/* display query parameters in English */
-struct query *ctl; /* query parameter block */
{
printf("Options for retrieving from %s@%s:\n",
ctl->remotename, visbuf(ctl->servername));
@@ -755,9 +745,8 @@ struct query *ctl; /* query parameter block */
}
}
-int openmailpipe (argv)
+int openmailpipe (char **argv)
/* open a one-way pipe to a mail delivery agent */
-char *argv[];
{
int pipefd [2];
int childpid;
@@ -884,9 +873,8 @@ char *tp; /* target buffer for digested string */
*tp = '\0';
}
-static char *visbuf(buf)
+static char *visbuf(const char *buf)
/* visibilize a given string */
-const char *buf;
{
static char vbuf[BUFSIZ];
char *tp = vbuf;
diff --git a/fetchmail.h b/fetchmail.h
index 785d7e17..9bdc6e96 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -148,8 +148,6 @@ extern int linelimit; /* limit # lines retrieved per site */
extern int versioninfo; /* emit only version info */
extern char *user; /* name of invoking user */
-#ifdef HAVE_PROTOTYPES
-
/* prototypes for globally callable functions */
#if defined(HAVE_STDARG_H)
void gen_send (FILE *sockfp, char *, ... );
@@ -198,16 +196,8 @@ char *getpassword(char *);
void escapes(const char *, char *);
-void yyerror(char *);
-int yylex();
-
-#else
-
-struct query *hostinit();
-char *MD5Digest ();
-void optmerge();
-
-#endif
+void yyerror(const char *);
+int yylex(void);
#define FALSE 0
#define TRUE 1
diff --git a/imap.c b/imap.c
index d3814038..ec529cf1 100644
--- a/imap.c
+++ b/imap.c
@@ -18,10 +18,8 @@
static int count, seen, recent, unseen;
-int imap_ok (sockfp, argbuf)
+int imap_ok (FILE *sockfp, char *argbuf)
/* parse command response */
-char *argbuf;
-FILE *sockfp;
{
char buf [POPBUFSIZE+1];
@@ -72,11 +70,8 @@ FILE *sockfp;
}
}
-int imap_getauth(sockfp, ctl, buf)
+int imap_getauth(FILE *sockfp, struct query *ctl, char *buf)
/* apply for connection authorization */
-FILE *sockfp;
-struct query *ctl;
-char *buf;
{
/* try to get authorized */
return(gen_transact(sockfp,
@@ -84,11 +79,8 @@ char *buf;
ctl->remotename, ctl->password));
}
-static int imap_getrange(sockfp, ctl, countp, newp)
+static int imap_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
/* get range of messages to be fetched */
-FILE *sockfp;
-struct query *ctl;
-int *countp, *newp;
{
int ok;
@@ -112,11 +104,8 @@ int *countp, *newp;
return(0);
}
-static int imap_getsizes(sockfp, count, sizes)
+static int imap_getsizes(FILE *sockfp, int count, int *sizes)
/* capture the sizes of all messages */
-FILE *sockfp;
-int count;
-int *sizes;
{
char buf [POPBUFSIZE+1];
@@ -138,11 +127,8 @@ int *sizes;
return(0);
}
-static int imap_is_old(sockfp, ctl, num)
+static int imap_is_old(FILE *sockfp, struct query *ctl, int num)
/* is the given message old? */
-FILE *sockfp;
-struct query *ctl;
-int num;
{
int ok;
@@ -152,11 +138,8 @@ int num;
return(seen);
}
-static int imap_fetch(sockfp, number, lenp)
+static int imap_fetch(FILE *sockfp, int number, int *lenp)
/* request nth message */
-FILE *sockfp;
-int number;
-int *lenp;
{
char buf [POPBUFSIZE+1];
int num;
@@ -176,11 +159,8 @@ int *lenp;
return(0);
}
-static int imap_trail(sockfp, ctl, number)
+static int imap_trail(FILE *sockfp, struct query *ctl, int number)
/* discard tail of FETCH response after reading message text */
-FILE *sockfp;
-struct query *ctl;
-int number;
{
char buf [POPBUFSIZE+1];
@@ -190,11 +170,8 @@ int number;
return(0);
}
-static int imap_delete(sockfp, ctl, number)
+static int imap_delete(FILE *sockfp, struct query *ctl, int number)
/* set delete flag for given message */
-FILE *sockfp;
-struct query *ctl;
-int number;
{
return(gen_transact(sockfp, "STORE %d +FLAGS (\\Deleted)", number));
}
@@ -217,9 +194,8 @@ const static struct method imap =
"LOGOUT", /* the IMAP exit command */
};
-int doIMAP(ctl)
+int doIMAP(struct query *ctl)
/* retrieve messages using IMAP Version 2bis or Version 4 */
-struct query *ctl;
{
return(do_protocol(ctl, &imap));
}
diff --git a/md5global.h b/md5global.h
index bde8db06..2be7a842 100644
--- a/md5global.h
+++ b/md5global.h
@@ -17,7 +17,7 @@ The following makes PROTOTYPES default to 0 if it has not already
*/
#ifndef PROTOTYPES
-#define PROTOTYPES HAVE_PROTOTYPES
+#define PROTOTYPES 1
#endif
/* POINTER defines a generic pointer type */
diff --git a/mx.h b/mx.h
index 30da95b5..57c23cdc 100644
--- a/mx.h
+++ b/mx.h
@@ -6,8 +6,6 @@ struct mxentry
int pref;
};
-#ifdef HAVE_PROTOTYPES
extern struct mxentry * getmxrecords(const char *);
-#endif /* HAVE_PROTOTYPES */
/* mx.h ends here */
diff --git a/mxget.c b/mxget.c
index 484d7aad..3f266c01 100644
--- a/mxget.c
+++ b/mxget.c
@@ -40,9 +40,8 @@
/* minimum possible size of MX record in packet */
#define MIN_MX_SIZE 8 /* corresp to "a.com 0" w/ terminating space */
-struct mxentry *getmxrecords(name)
+struct mxentry *getmxrecords(const char *name)
/* get MX records for given host */
-const char *name;
{
unsigned char answer[PACKETSZ], *eom, *cp, *bp;
int n, ancount, qdcount, buflen, type, pref, ind;
diff --git a/options.c b/options.c
index 0c7d4434..fd6be6f2 100644
--- a/options.c
+++ b/options.c
@@ -82,7 +82,7 @@ static struct option longoptions[] = {
{(char *) 0, no_argument, (int *) 0, 0 }
};
-int parsecmdline (argc,argv,ctl)
+int parsecmdline (argc, argv,ctl)
/* parse and validate the command line options */
int argc; /* argument count */
char **argv; /* argument strings */
diff --git a/pop2.c b/pop2.c
index a501c624..35f69fbd 100644
--- a/pop2.c
+++ b/pop2.c
@@ -16,10 +16,8 @@
static int pound_arg, equal_arg;
-int pop2_ok (sockfp, argbuf)
+int pop2_ok (FILE *sockfp, char *argbuf)
/* parse POP2 command response */
-FILE *sockfp;
-char *argbuf;
{
int ok;
char buf [POPBUFSIZE+1];
@@ -55,22 +53,16 @@ char *argbuf;
return(ok);
}
-int pop2_getauth(sockfp, ctl, buf)
+int pop2_getauth(FILE *sockfp, struct query *ctl, char *buf)
/* apply for connection authorization */
-FILE *sockfp;
-struct query *ctl;
-char *buf;
{
return(gen_transact(sockfp,
"HELO %s %s",
ctl->remotename, ctl->password));
}
-static int pop2_getrange(sockfp, ctl, countp, newp)
+static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
/* get range of messages to be fetched */
-FILE *sockfp;
-struct query *ctl;
-int *countp, *newp;
{
/*
* We should have picked up a count of messages in the user's
@@ -96,11 +88,8 @@ int *countp, *newp;
return(0);
}
-static int pop2_fetch(sockfp, number, lenp)
+static int pop2_fetch(FILE *sockfp, int number, int *lenp)
/* request nth message */
-FILE *sockfp;
-int number;
-int *lenp;
{
int ok;
@@ -115,11 +104,8 @@ int *lenp;
return(ok);
}
-static int pop2_trail(sockfp, ctl, number)
+static int pop2_trail(FILE *sockfp, struct query *ctl, int number)
/* send acknowledgement for message data */
-FILE *sockfp;
-struct query *ctl;
-int number;
{
return(gen_transact(sockfp, ctl->keep ? "ACKS" : "ACKD"));
}
@@ -142,9 +128,8 @@ const static struct method pop2 =
"QUIT", /* the POP2 exit command */
};
-int doPOP2 (ctl)
+int doPOP2 (struct query *ctl)
/* retrieve messages using POP2 */
-struct query *ctl;
{
return(do_protocol(ctl, &pop2));
}
diff --git a/pop3.c b/pop3.c
index 4df8473a..01a14e51 100644
--- a/pop3.c
+++ b/pop3.c
@@ -22,50 +22,45 @@
static int last;
-int pop3_ok (sockfp, argbuf)
+int pop3_ok (FILE *sockfp, char *argbuf)
/* parse command response */
-FILE *sockfp;
-char *argbuf;
{
- int ok;
- char buf [POPBUFSIZE+1];
- char *bufp;
-
- if (SockGets(buf, sizeof(buf), sockfp) >= 0) {
- if (outlevel == O_VERBOSE)
- fprintf(stderr,"%s\n",buf);
-
- bufp = buf;
- if (*bufp == '+' || *bufp == '-')
- bufp++;
- else
- return(PS_PROTOCOL);
-
- while (isalpha(*bufp))
- bufp++;
- *(bufp++) = '\0';
-
- if (strcmp(buf,"+OK") == 0)
- ok = 0;
- else if (strcmp(buf,"-ERR") == 0)
- ok = PS_ERROR;
- else
- ok = PS_PROTOCOL;
-
- if (argbuf != NULL)
- strcpy(argbuf,bufp);
- }
- else
- ok = PS_SOCKET;
+ int ok;
+ char buf [POPBUFSIZE+1];
+ char *bufp;
+
+ if (SockGets(buf, sizeof(buf), sockfp) >= 0) {
+ if (outlevel == O_VERBOSE)
+ fprintf(stderr,"%s\n",buf);
+
+ bufp = buf;
+ if (*bufp == '+' || *bufp == '-')
+ bufp++;
+ else
+ return(PS_PROTOCOL);
+
+ while (isalpha(*bufp))
+ bufp++;
+ *(bufp++) = '\0';
+
+ if (strcmp(buf,"+OK") == 0)
+ ok = 0;
+ else if (strcmp(buf,"-ERR") == 0)
+ ok = PS_ERROR;
+ else
+ ok = PS_PROTOCOL;
+
+ if (argbuf != NULL)
+ strcpy(argbuf,bufp);
+ }
+ else
+ ok = PS_SOCKET;
- return(ok);
+ return(ok);
}
-int pop3_getauth(sockfp, ctl, greeting)
+int pop3_getauth(FILE *sockfp, struct query *ctl, char *greeting)
/* apply for connection authorization */
-FILE *sockfp;
-struct query *ctl;
-char *greeting;
{
/* build MD5 digest from greeting timestamp + password */
if (ctl->protocol == P_APOP)
@@ -122,11 +117,8 @@ char *greeting;
return(0);
}
-static int pop3_getrange(sockfp, ctl, countp, newp)
+static int pop3_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
/* get range of messages to be fetched */
-FILE *sockfp;
-struct query *ctl;
-int *countp, *newp;
{
int ok;
char buf [POPBUFSIZE+1];
@@ -191,11 +183,8 @@ int *countp, *newp;
return(0);
}
-static int pop3_getsizes(sockfp, count, sizes)
+static int pop3_getsizes(FILE *sockfp, int count, int *sizes)
/* capture the sizes of all messages */
-FILE *sockfp;
-int count;
-int *sizes;
{
int ok;
@@ -223,11 +212,8 @@ int *sizes;
}
}
-static int pop3_is_old(sockfp, ctl, num)
+static int pop3_is_old(FILE *sockfp, struct query *ctl, int num)
/* is the given message old? */
-FILE *sockfp;
-struct query *ctl;
-int num;
{
if (!ctl->oldsaved)
return (num <= last);
@@ -236,11 +222,8 @@ int num;
uid_find (&ctl->newsaved, num)));
}
-static int pop3_fetch(sockfp, number, lenp)
+static int pop3_fetch(FILE *sockfp, int number, int *lenp)
/* request nth message */
-FILE *sockfp;
-int number;
-int *lenp;
{
int ok;
char buf [POPBUFSIZE+1], *cp;
@@ -260,11 +243,8 @@ int *lenp;
return(0);
}
-static int pop3_delete(sockfp, ctl, number)
+static int pop3_delete(FILE *sockfp, struct query *ctl, int number)
/* delete a given message */
-FILE *sockfp;
-struct query *ctl;
-int number;
{
return(gen_transact(sockfp, "DELE %d", number));
}
@@ -287,9 +267,8 @@ const static struct method pop3 =
"QUIT", /* the POP3 exit command */
};
-int doPOP3 (ctl)
+int doPOP3 (struct query *ctl)
/* retrieve messages using POP3 */
-struct query *ctl;
{
if (ctl->mailbox[0]) {
fprintf(stderr,"Option --remote is not supported with POP3\n");
diff --git a/rcfile_y.y b/rcfile_y.y
index 5cbbc331..ea95dfad 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -153,9 +153,8 @@ extern FILE *yyin;
static struct query *hosttail; /* where to add new elements */
-void yyerror (s)
+void yyerror (const char *s)
/* report a syntax error */
-char *s; /* error string */
{
fprintf(stderr,"%s line %d: %s at %s\n", rcfile, prc_lineno, s, yytext);
prc_errflag++;
@@ -231,7 +230,7 @@ const char *pathname; /* pathname for the configuration file */
return(0);
}
-static void prc_reset()
+static void prc_reset(void)
/* clear the global current record (server parameters) used by the parser */
{
char savename[HOSTLEN+1];
@@ -278,7 +277,7 @@ struct query *init; /* pointer to block containing initial values */
return(node);
}
-static void prc_register()
+static void prc_register(void)
/* register current parameters and append to the host list */
{
#define STR_FORCE(fld, len) if (cmd_opts.fld[0]) \
@@ -306,10 +305,8 @@ static void prc_register()
(void) hostalloc(&current);
}
-void optmerge(h2, h1)
+void optmerge(struct query *h2, struct query *h1)
/* merge two options records; empty fields in h2 are filled in from h1 */
-struct query *h1;
-struct query *h2;
{
append_uid_list(&h2->localnames, &h1->localnames);
@@ -337,6 +334,6 @@ struct query *h2;
}
/* easier to do this than cope with variations in where the library lives */
-int yywrap() {return 1;}
+int yywrap(void) {return 1;}
/* rcfile_y.y ends here */
diff --git a/smtp.h b/smtp.h
index dfc96c66..96b3e44b 100644
--- a/smtp.h
+++ b/smtp.h
@@ -14,7 +14,6 @@
#define SM_ERROR 128
#define SM_UNRECOVERABLE 129
-#ifdef HAVE_PROTOTYPES
int SMTP_helo(FILE *sockfp,char *host);
int SMTP_from(FILE *sockfp,char *from);
int SMTP_rcpt(FILE *sockfp,char *to);
@@ -23,6 +22,5 @@ int SMTP_eom(FILE *sockfp);
int SMTP_quit(FILE *sockfp);
int SMTP_ok(FILE *sockfp,char *argbuf);
void SMTP_rset(FILE *sockfp);
-#endif /* HAVE_PROTOTYPES */
#endif
diff --git a/socket.c b/socket.c
index ea0b5919..f21cf1fa 100644
--- a/socket.c
+++ b/socket.c
@@ -34,9 +34,7 @@
#endif
#endif
-FILE *Socket(host, clientPort)
-char *host;
-int clientPort;
+FILE *Socket(char *host, int clientPort)
{
int sock;
unsigned long inaddr;
@@ -116,10 +114,7 @@ va_dcl {
*
*/
-int SockWrite(buf,len,sockfp)
-char *buf;
-int len;
-FILE *sockfp;
+int SockWrite(char *buf, int len, FILE *sockfp)
{
int n, wrlen = 0;
@@ -135,10 +130,7 @@ FILE *sockfp;
return wrlen;
}
-int SockGets(buf, len, sockfp)
-char *buf;
-int len;
-FILE *sockfp;
+int SockGets(char *buf, int len, FILE *sockfp)
{
int rdlen = 0;
diff --git a/socket.h b/socket.h
index 31689aa0..10a0a974 100644
--- a/socket.h
+++ b/socket.h
@@ -9,7 +9,6 @@
#ifndef SOCKET__
#define SOCKET__
-#if defined(HAVE_PROTOTYPES)
/*
Create a new client socket
returns (FILE *)NULL on error
@@ -41,6 +40,4 @@ int SockPrintf(FILE *sockfp, char *format, ...) ;
int SockPrintf();
#endif
-#endif /* defined(HAVE_PROTOTYPES) */
-
#endif /* SOCKET__ */
diff --git a/uid.c b/uid.c
index 25730390..7b983384 100644
--- a/uid.c
+++ b/uid.c
@@ -62,10 +62,8 @@
/* UIDs associated with un-queried hosts */
static struct idlist *scratchlist;
-void initialize_saved_lists(hostlist, idfile)
+void initialize_saved_lists(struct query *hostlist, char *idfile)
/* read file of saved IDs and attach to each host */
-struct query *hostlist;
-char *idfile;
{
int st;
FILE *tmpfp;
@@ -101,11 +99,8 @@ char *idfile;
}
}
-void save_uid(idl, num, str)
+void save_uid(struct idlist **idl, int num, char *str)
/* save a number/UID pair on the given UID list */
-struct idlist **idl;
-int num;
-char *str;
{
struct idlist *new;
@@ -116,9 +111,8 @@ char *str;
*idl = new;
}
-void free_uid_list(idl)
+void free_uid_list(struct idlist **idl)
/* free the given UID list */
-struct idlist **idl;
{
if (*idl == (struct idlist *)NULL)
return;
@@ -129,10 +123,8 @@ struct idlist **idl;
*idl = (struct idlist *)NULL;
}
-void save_id_pair(idl, str1, str2)
+void save_id_pair(struct idlist **idl, char *str1, char *str2)
/* save an ID pair on the given list */
-struct idlist **idl;
-char *str1, *str2;
{
struct idlist *new;
@@ -147,9 +139,8 @@ char *str1, *str2;
}
#ifdef __UNUSED__
-void free_idpair_list(idl)
+void free_idpair_list(struct idlist **idl)
/* free the given ID pair list */
-struct idlist **idl;
{
if (*idl == (struct idlist *)NULL)
return;
@@ -162,10 +153,8 @@ struct idlist **idl;
}
#endif
-int uid_in_list(idl, str)
+int uid_in_list(struct idlist **idl, char *str)
/* is a given ID in the given list? */
-struct idlist **idl;
-char *str;
{
if (*idl == (struct idlist *)NULL || str == (char *) NULL)
return(0);
@@ -175,10 +164,8 @@ char *str;
return(uid_in_list(&(*idl)->next, str));
}
-char *uid_find(idl, number)
+char *uid_find(struct idlist **idl, int number)
/* return the id of the given number in the given list. */
-struct idlist **idl;
-int number;
{
if (*idl == (struct idlist *) 0)
return((char *) 0);
@@ -188,10 +175,8 @@ int number;
return(uid_find(&(*idl)->next, number));
}
-char *idpair_find(idl, id)
+char *idpair_find(struct idlist **idl, char *id)
/* return the id of the given number in the given list. */
-struct idlist **idl;
-char *id;
{
if (*idl == (struct idlist *) 0)
return((char *) 0);
@@ -201,10 +186,8 @@ char *id;
return(idpair_find(&(*idl)->next, id));
}
-int delete_uid(idl, num)
+int delete_uid(struct idlist **idl, int num)
/* delete given message from given list */
-struct idlist **idl;
-int num;
{
if (*idl == (struct idlist *)NULL)
return(0);
@@ -222,10 +205,8 @@ int num;
return(0);
}
-void append_uid_list(idl, nidl)
+void append_uid_list(struct idlist **idl, struct idlist **nidl)
/* append nidl to idl (does not copy *) */
-struct idlist **idl;
-struct idlist **nidl;
{
if ((*idl) == (struct idlist *)NULL)
*idl = *nidl;
@@ -235,19 +216,16 @@ struct idlist **nidl;
append_uid_list(&(*idl)->next, nidl);
}
-void update_uid_lists(hostp)
+void update_uid_lists(struct query *hostp)
/* perform end-of-query actions on UID lists */
-struct query *hostp;
{
free_uid_list(&hostp->oldsaved);
hostp->oldsaved = hostp->newsaved;
hostp->newsaved = (struct idlist *) NULL;
}
-void write_saved_lists(hostlist, idfile)
+void write_saved_lists(struct query *hostlist, char *idfile)
/* perform end-of-run write of seen-messages list */
-struct query *hostlist;
-char *idfile;
{
int idcount;
FILE *tmpfp;
diff --git a/xmalloc.c b/xmalloc.c
index a58748a4..7bdd5303 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -19,26 +19,24 @@
#endif
XMALLOCTYPE *
-xmalloc (n)
-int n;
+xmalloc (int n)
{
- XMALLOCTYPE *p;
+ XMALLOCTYPE *p;
- p = (XMALLOCTYPE *) malloc(n);
- if (p == (XMALLOCTYPE *) 0) {
- fputs("fetchmail: malloc failed\n",stderr);
- exit(PS_UNDEFINED);
- }
- return(p);
+ p = (XMALLOCTYPE *) malloc(n);
+ if (p == (XMALLOCTYPE *) 0) {
+ fputs("fetchmail: malloc failed\n",stderr);
+ exit(PS_UNDEFINED);
+ }
+ return(p);
}
-char *xstrdup(s)
-char *s;
-{
- char *p;
- p = (char *) xmalloc(strlen(s)+1);
- strcpy(p,s);
- return p;
+char *xstrdup(char *s)
+{
+ char *p;
+ p = (char *) xmalloc(strlen(s)+1);
+ strcpy(p,s);
+ return p;
}
/* xmalloc.c ends here */