Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / imap / camel-imap-command.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-imap-command.h: IMAP command sending/parsing routines */
3
4 /* 
5  * Authors:
6  *   Dan Winship <danw@ximian.com>
7  *   Jeffrey Stedfast <fejj@ximian.com>
8  *
9  * Copyright (C) 2000, 2001 Ximian, Inc.
10  *
11  * This program is free software; you can redistribute it and/or 
12  * modify it under the terms of version 2 of the GNU Lesser General Public 
13  * License as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
23  * USA
24  */
25
26
27 #ifndef CAMEL_IMAP_COMMAND_H
28 #define CAMEL_IMAP_COMMAND_H 1
29
30 #include <glib.h>
31 #include "camel-imap-types.h"
32
33 G_BEGIN_DECLS
34
35 typedef enum {
36         CAMEL_IMAP_RESPONSE_ERROR,
37         CAMEL_IMAP_RESPONSE_CONTINUATION,
38         CAMEL_IMAP_RESPONSE_UNTAGGED,
39         CAMEL_IMAP_RESPONSE_TAGGED
40 } CamelImapResponseType;
41
42 struct _CamelImapResponse {
43         CamelFolder *folder;
44         GPtrArray *untagged;
45         char *status;
46 };
47
48 CamelImapResponse *camel_imap_command              (CamelImapStore *store,
49                                                     CamelFolder *folder,
50                                                     CamelException *ex,
51                                                     const char *fmt, ...);
52 CamelImapResponse *camel_imap_command_continuation (CamelImapStore *store,
53                                                     const char *cmd,
54                                                     size_t cmdlen,
55                                                     CamelException *ex);
56
57 void  camel_imap_response_free                     (CamelImapStore *store,
58                                                     CamelImapResponse *response);
59 void  camel_imap_response_free_without_processing  (CamelImapStore *store,
60                                                     CamelImapResponse *response);
61 char *camel_imap_response_extract                  (CamelImapStore *store,
62                                                     CamelImapResponse *response,
63                                                     const char *type,
64                                                     CamelException *ex);
65 char *camel_imap_response_extract_continuation     (CamelImapStore *store,
66                                                     CamelImapResponse *response,
67                                                     CamelException *ex);
68
69 gboolean           camel_imap_command_start        (CamelImapStore *store,
70                                                     CamelFolder *folder,
71                                                     CamelException *ex,
72                                                     const char *fmt, ...);
73 CamelImapResponseType camel_imap_command_response  (CamelImapStore *store,
74                                                     char **respbuf,
75                                                     CamelException *ex);
76
77 G_END_DECLS
78
79 #endif /* CAMEL_IMAP_COMMAND_H */