2
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4
* Authors: Michael Zucchi <notzed@ximian.com>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of version 2 of the GNU Lesser General Public
8
* License as published by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#ifndef _CAMEL_IMAPP_STREAM_H
22
#define _CAMEL_IMAPP_STREAM_H
24
#include <camel/camel-stream.h>
26
#define CAMEL_IMAPP_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_imapp_stream_get_type (), CamelIMAPPStream)
27
#define CAMEL_IMAPP_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_stream_get_type (), CamelIMAPPStreamClass)
28
#define CAMEL_IS_IMAP_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_stream_get_type ())
32
typedef struct _CamelIMAPPStreamClass CamelIMAPPStreamClass;
33
typedef struct _CamelIMAPPStream CamelIMAPPStream;
36
IMAP_TOK_PROTOCOL = -2,
42
} camel_imapp_token_t;
44
struct _CamelIMAPPStream {
50
guchar *buf, *ptr, *end;
54
camel_imapp_token_t unget_tok;
58
guchar *tokenbuf, *tokenptr, *tokenend;
61
struct _CamelIMAPPStreamClass {
62
CamelStreamClass parent_class;
65
CamelType camel_imapp_stream_get_type (void);
67
CamelStream *camel_imapp_stream_new (CamelStream *source);
69
camel_imapp_token_t camel_imapp_stream_token (CamelIMAPPStream *is, guchar **start, guint *len); /* throws IO,PARSE exception */
70
void camel_imapp_stream_ungettoken (CamelIMAPPStream *is, camel_imapp_token_t tok, guchar *token, guint len);
72
void camel_imapp_stream_set_literal (CamelIMAPPStream *is, guint literal);
73
gint camel_imapp_stream_gets (CamelIMAPPStream *is, guchar **start, guint *len);
74
gint camel_imapp_stream_getl (CamelIMAPPStream *is, guchar **start, guint *len);
76
/* all throw IO,PARSE exceptions */
78
/* gets an atom, upper-cases */
79
gint camel_imapp_stream_atom (CamelIMAPPStream *is, guchar **start, guint *len);
80
/* gets an atom or string */
81
gint camel_imapp_stream_astring (CamelIMAPPStream *is, guchar **start);
82
/* gets a NIL or a string, start==NULL if NIL */
83
gint camel_imapp_stream_nstring (CamelIMAPPStream *is, guchar **start);
84
/* gets a NIL or string into a stream, stream==NULL if NIL */
85
gint camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream);
87
gint camel_imapp_stream_text (CamelIMAPPStream *is, guchar **text);
90
guint32 camel_imapp_stream_number(CamelIMAPPStream *is);
94
#endif /* ! _CAMEL_IMAPP_STREAM_H */