aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
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 /pop3.c
parent7b11f0ff9972d8046e69f98948fdab26b5199caf (diff)
downloadfetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.tar.gz
fetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.tar.bz2
fetchmail-cb236290e267f17d5f81a18d742b81f1b74b05a2.zip
Prototypes everywhere.
svn path=/trunk/; revision=515
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c99
1 files changed, 39 insertions, 60 deletions
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");