pop.h 2.62 KB
Newer Older
Richard M. Stallman's avatar
Richard M. Stallman committed
1
/* pop.h: Header file for the "pop.c" client POP3 protocol.
Paul Eggert's avatar
Paul Eggert committed
2
   Copyright (C) 1991, 1993, 2001-2020 Free Software Foundation, Inc.
3

Paul Eggert's avatar
Paul Eggert committed
4
Author: Jonathan Kamens <jik@security.ov.com>
Richard M. Stallman's avatar
Richard M. Stallman committed
5 6 7

This file is part of GNU Emacs.

8
GNU Emacs is free software: you can redistribute it and/or modify
Richard M. Stallman's avatar
Richard M. Stallman committed
9
it under the terms of the GNU General Public License as published by
10 11
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
Richard M. Stallman's avatar
Richard M. Stallman committed
12 13 14 15 16 17 18

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
19
along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
20

Richard M. Stallman's avatar
Richard M. Stallman committed
21 22 23 24 25 26 27 28 29

#include <stdio.h>

#define GETLINE_MIN 1024	/* the getline buffer starts out this */
				/* size */
#define GETLINE_INCR 1024	/* the getline buffer is grown by this */
				/* size when it needs to grow */

extern char pop_error[];
30
extern bool pop_debug;
Richard M. Stallman's avatar
Richard M. Stallman committed
31 32 33 34 35 36

struct _popserver
{
  int file, data;
  char *buffer;
  int buffer_size, buffer_index;
37 38
  bool_bf in_multi : 1;
  bool_bf trash_started : 1;
Richard M. Stallman's avatar
Richard M. Stallman committed
39 40 41 42 43 44 45 46 47 48 49 50
};

typedef struct _popserver *popserver;

/*
 * Valid flags for the pop_open function.
 */

#define POP_NO_KERBEROS	(1<<0)
#define POP_NO_HESIOD	(1<<1)
#define POP_NO_GETPASS 	(1<<2)

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
extern popserver pop_open (char *host, char *username, char *password,
                           int flags);
extern int pop_stat (popserver server, int *count, int *size);
extern int pop_list (popserver server, int message, int **IDs,
                     int **size);
extern int pop_retrieve (popserver server, int message, int markfrom,
                         char **);
extern int pop_retrieve_first (popserver server, int message,
                               char **response);
extern int pop_retrieve_next (popserver server, char **line);
extern int pop_retrieve_flush (popserver server);
extern int pop_top_first (popserver server, int message, int lines,
                          char **response);
extern int pop_top_next (popserver server, char **line);
extern int pop_top_flush (popserver server);
extern int pop_multi_first (popserver server, const char *command,
                            char **response);
extern int pop_multi_next (popserver server, char **line);
extern int pop_multi_flush (popserver server);
extern int pop_delete (popserver server, int message);
extern int pop_noop (popserver server);
extern int pop_last (popserver server);
extern int pop_reset (popserver server);
extern int pop_quit (popserver server);
extern void pop_close (popserver);