2 * Copyright (C) 2001 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 #ifndef _CAMEL_NNTP_STREAM_H
22 #define _CAMEL_NNTP_STREAM_H
24 #include <camel/camel-stream.h>
26 #define CAMEL_NNTP_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_nntp_stream_get_type (), CamelNNTPStream)
27 #define CAMEL_NNTP_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_stream_get_type (), CamelNNTPStreamClass)
28 #define CAMEL_IS_NNTP_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_stream_get_type ())
32 typedef struct _CamelNNTPStreamClass CamelNNTPStreamClass;
33 typedef struct _CamelNNTPStream CamelNNTPStream;
36 CAMEL_NNTP_STREAM_LINE,
37 CAMEL_NNTP_STREAM_DATA,
38 CAMEL_NNTP_STREAM_EOD, /* end of data, acts as if end of stream */
39 } camel_nntp_stream_mode_t;
41 struct _CamelNNTPStream {
46 camel_nntp_stream_mode_t mode;
49 unsigned char *buf, *ptr, *end;
50 unsigned char *linebuf, *lineptr, *lineend;
53 struct _CamelNNTPStreamClass {
54 CamelStreamClass parent_class;
57 CamelType camel_nntp_stream_get_type (void);
59 CamelStream *camel_nntp_stream_new (CamelStream *source);
62 void camel_nntp_stream_set_mode (CamelNNTPStream *is, camel_nntp_stream_mode_t mode);
64 int camel_nntp_stream_line (CamelNNTPStream *is, unsigned char **data, unsigned int *len);
65 int camel_nntp_stream_gets (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
66 int camel_nntp_stream_getd (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
70 #endif /* ! _CAMEL_NNTP_STREAM_H */