free ((char *) server);
return (0);
}
-
+
server->file = sock;
server->data = 0;
server->buffer_index = 0;
strcpy (pop_error, "In multi-line query in pop_stat");
return (-1);
}
-
+
if (sendline (server, "STAT") || (pop_getline (server, &fromserver) < 0))
return (-1);
}
*count = atoi (&fromserver[4]);
-
+
fromserver = index (&fromserver[4], ' ');
if (! fromserver)
{
popserver server;
{
char *fromserver;
-
+
if (server->in_multi)
{
strcpy (pop_error, "In multi-line query in pop_last");
* Arguments:
* host The host to which to connect.
* flags Option flags.
- *
+ *
* Return value: A file descriptor indicating the connection, or -1
* indicating failure, in which case an error has been copied
* into pop_error.
strncat (pop_error, strerror (errno),
ERROR_MAX - sizeof (POP_SOCKET_ERROR));
return (-1);
-
+
}
while (*hostent->h_addr_list)
}
#define CONNECT_ERROR "Could not connect to POP server: "
-
+
if (! *hostent->h_addr_list)
{
CLOSESOCKET (sock);
strncat (pop_error, strerror (errno),
ERROR_MAX - sizeof (CONNECT_ERROR));
return (-1);
-
+
}
#ifdef KERBEROS
if ((rem = krb5_auth_con_init (kcontext, &auth_context)))
goto krb5error;
-
+
if (rem = krb5_cc_default (kcontext, &ccdef))
goto krb5error;
CLOSESOCKET (sock);
return (-1);
}
-#else /* ! KERBEROS5 */
+#else /* ! KERBEROS5 */
ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
realhost = strdup (hostent->h_name);
rem = krb_sendauth (0L, sock, ticket, "pop", realhost,
found = server->buffer_index;
data_used = (cp + 2) - server->buffer - found;
-
+
*cp = '\0'; /* terminate the string to be returned */
server->data -= data_used;
server->buffer_index += data_used;
char *cp;
server->data += ret;
server->buffer[server->data] = '\0';
-
+
cp = find_crlf (server->buffer + search_offset,
server->data - search_offset);
if (cp)
*
* Arguments:
* server The server to read from.
- *
+ *
* Returns: 0 for success, else for failure and puts error in pop_error.
*
* Side effects: On failure, may make the connection unusable.
pop_trash (server);
return (-1);
}
-}
+}
#if 0
/*
* Changes made to the maildrop since the session was started (or
* since the last pop_reset) may be lost.
*/
-void
+void
pop_close (server)
popserver server;
{
/* Give this program DOC-mm.nn.oo as standard input and it outputs to
standard output a file of texinfo input containing the doc strings.
-
+
Copyright (C) 1989, 1992, 1994, 1996, 1999, 2000, 2001
Free Software Foundation Inc.
{
"WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET"
};
-
+
int
main ()
{
DOCSTR *docs; /* chain of allocated DOCSTRS */
char buf[512]; /* line buffer */
-
+
while (1) /* process one char at a time */
{
/* this char from the DOCSTR file */
bp = buf;
state = DESC_GET;
}
-
+
/* process gets */
if (state == NAME_GET || state == DESC_GET)