]> Pileus Git - ~andy/fetchmail/blobdiff - pop2.c
Version bump.
[~andy/fetchmail] / pop2.c
diff --git a/pop2.c b/pop2.c
index e1804660a3a18e4db4ed21b140cda52b706613dc..35f69fbd87b888ac5afc06d218dcfc38c3a19bb1 100644 (file)
--- a/pop2.c
+++ b/pop2.c
 
 static int pound_arg, equal_arg;
 
-int pop2_ok (socket, argbuf)
+int pop2_ok (FILE *sockfp, char *argbuf)
 /* parse POP2 command response */
-int socket;
-char *argbuf;
 {
     int ok;
     char buf [POPBUFSIZE+1];
 
     pound_arg = equal_arg = -1;
-    if (SockGets(socket, buf, sizeof(buf)) >= 0) {
+    if (SockGets(buf, sizeof(buf), sockfp) >= 0) {
        if (outlevel == O_VERBOSE)
            fprintf(stderr,"%s\n",buf);
 
@@ -55,22 +53,16 @@ char *argbuf;
     return(ok);
 }
 
-int pop2_getauth(socket, ctl, buf)
+int pop2_getauth(FILE *sockfp, struct query *ctl, char *buf)
 /* apply for connection authorization */
-int socket;
-struct query *ctl;
-char *buf;
 {
-    return(gen_transact(socket,
+    return(gen_transact(sockfp,
                  "HELO %s %s",
                  ctl->remotename, ctl->password));
 }
 
-static int pop2_getrange(socket, ctl, countp, newp)
+static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
 /* get range of messages to be fetched */
-int socket;
-struct query *ctl;
-int *countp, *newp;
 {
     /*
      * We should have picked up a count of messages in the user's
@@ -82,7 +74,7 @@ int *countp, *newp;
     /* maybe the user wanted a non-default folder */
     if (ctl->mailbox[0])
     {
-       int     ok = gen_transact(socket, "FOLD %s", ctl->mailbox);
+       int     ok = gen_transact(sockfp, "FOLD %s", ctl->mailbox);
 
        if (ok != 0)
            return(ok);
@@ -96,32 +88,26 @@ int *countp, *newp;
     return(0);
 }
 
-static int pop2_fetch(socket, number, lenp)
+static int pop2_fetch(FILE *sockfp, int number, int *lenp)
 /* request nth message */
-int socket;
-int number;
-int *lenp; 
 {
     int        ok;
 
     *lenp = 0;
-    ok = gen_transact(socket, "READ %d", number);
+    ok = gen_transact(sockfp, "READ %d", number);
     if (ok)
        return(0);
     *lenp = equal_arg;
 
-    gen_send(socket, "RETR");
+    gen_send(sockfp, "RETR");
 
     return(ok);
 }
 
-static int pop2_trail(socket, ctl, number)
+static int pop2_trail(FILE *sockfp, struct query *ctl, int number)
 /* send acknowledgement for message data */
-int socket;
-struct query *ctl;
-int number;
 {
-    return(gen_transact(socket, ctl->keep ? "ACKS" : "ACKD"));
+    return(gen_transact(sockfp, ctl->keep ? "ACKS" : "ACKD"));
 }
 
 const static struct method pop2 =
@@ -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));
 }