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);
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
/* 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);
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 =
"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));
}