declare smobs in alloc.c
[bpt/emacs.git] / lib-src / pop.h
CommitLineData
9c0f2dac 1/* pop.h: Header file for the "pop.c" client POP3 protocol.
ba318903 2 Copyright (C) 1991, 1993, 2001-2014 Free Software Foundation, Inc.
294981c7
GM
3
4Author: Jonathan Kamens <jik@security.ov.com>
9c0f2dac
RS
5
6This file is part of GNU Emacs.
7
294981c7 8GNU Emacs is free software: you can redistribute it and/or modify
9c0f2dac 9it under the terms of the GNU General Public License as published by
294981c7
GM
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
9c0f2dac
RS
12
13GNU Emacs is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
294981c7
GM
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20
9c0f2dac
RS
21
22#include <stdio.h>
23
24#define GETLINE_MIN 1024 /* the getline buffer starts out this */
25 /* size */
26#define GETLINE_INCR 1024 /* the getline buffer is grown by this */
27 /* size when it needs to grow */
28
29extern char pop_error[];
96c06863 30extern bool pop_debug;
9c0f2dac
RS
31
32struct _popserver
33{
34 int file, data;
35 char *buffer;
36 int buffer_size, buffer_index;
96c06863
PE
37 bool_bf in_multi : 1;
38 bool_bf trash_started : 1;
9c0f2dac
RS
39};
40
41typedef struct _popserver *popserver;
42
43/*
44 * Valid flags for the pop_open function.
45 */
46
47#define POP_NO_KERBEROS (1<<0)
48#define POP_NO_HESIOD (1<<1)
49#define POP_NO_GETPASS (1<<2)
50
988e88ab
J
51extern popserver pop_open (char *host, char *username, char *password,
52 int flags);
53extern int pop_stat (popserver server, int *count, int *size);
54extern int pop_list (popserver server, int message, int **IDs,
55 int **size);
56extern int pop_retrieve (popserver server, int message, int markfrom,
57 char **);
58extern int pop_retrieve_first (popserver server, int message,
59 char **response);
60extern int pop_retrieve_next (popserver server, char **line);
61extern int pop_retrieve_flush (popserver server);
62extern int pop_top_first (popserver server, int message, int lines,
63 char **response);
64extern int pop_top_next (popserver server, char **line);
65extern int pop_top_flush (popserver server);
66extern int pop_multi_first (popserver server, const char *command,
67 char **response);
68extern int pop_multi_next (popserver server, char **line);
69extern int pop_multi_flush (popserver server);
70extern int pop_delete (popserver server, int message);
71extern int pop_noop (popserver server);
72extern int pop_last (popserver server);
73extern int pop_reset (popserver server);
74extern int pop_quit (popserver server);
75extern void pop_close (popserver);