2 * Copyright (C) 2002 Ximian Inc.
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 /* This is *identical* to the camel-nntp-stream, so should probably
22 work out a way to merge them */
24 #ifndef _CAMEL_POP3_STREAM_H
25 #define _CAMEL_POP3_STREAM_H
27 #include <camel/camel-stream.h>
29 #define CAMEL_POP3_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_pop3_stream_get_type (), CamelPOP3Stream)
30 #define CAMEL_POP3_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_pop3_stream_get_type (), CamelPOP3StreamClass)
31 #define CAMEL_IS_POP3_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_pop3_stream_get_type ())
35 typedef struct _CamelPOP3StreamClass CamelPOP3StreamClass;
36 typedef struct _CamelPOP3Stream CamelPOP3Stream;
39 CAMEL_POP3_STREAM_LINE,
40 CAMEL_POP3_STREAM_DATA,
41 CAMEL_POP3_STREAM_EOD, /* end of data, acts as if end of stream */
42 } camel_pop3_stream_mode_t;
44 struct _CamelPOP3Stream {
49 camel_pop3_stream_mode_t mode;
52 unsigned char *buf, *ptr, *end;
53 unsigned char *linebuf, *lineptr, *lineend;
56 struct _CamelPOP3StreamClass {
57 CamelStreamClass parent_class;
60 CamelType camel_pop3_stream_get_type (void);
62 CamelStream *camel_pop3_stream_new (CamelStream *source);
65 void camel_pop3_stream_set_mode (CamelPOP3Stream *is, camel_pop3_stream_mode_t mode);
67 int camel_pop3_stream_line (CamelPOP3Stream *is, unsigned char **data, unsigned int *len);
68 int camel_pop3_stream_gets (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
69 int camel_pop3_stream_getd (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
73 #endif /* ! _CAMEL_POP3_STREAM_H */