1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-stream-buffer.h :stream which buffers another stream */
7 * Michael Zucchi <notzed@ximian.com>
9 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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.
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.
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
26 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
27 #error "Only <camel/camel.h> can be included directly."
30 #ifndef CAMEL_STREAM_BUFFER_H
31 #define CAMEL_STREAM_BUFFER_H
34 #include <camel/camel-stream.h>
36 /* Standard GObject macros */
37 #define CAMEL_TYPE_STREAM_BUFFER \
38 (camel_stream_buffer_get_type ())
39 #define CAMEL_STREAM_BUFFER(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST \
41 ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBuffer))
42 #define CAMEL_STREAM_BUFFER_CLASS(cls) \
43 (G_TYPE_CHECK_CLASS_CAST \
44 ((cls), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
45 #define CAMEL_IS_STREAM_BUFFER(obj) \
46 (G_TYPE_CHECK_INSTANCE_TYPE \
47 ((obj), CAMEL_TYPE_STREAM_BUFFER))
48 #define CAMEL_IS_STREAM_BUFFER_CLASS(cls) \
49 (G_TYPE_CHECK_CLASS_TYPE \
50 ((cls), CAMEL_TYPE_STREAM_BUFFER))
51 #define CAMEL_STREAM_BUFFER_GET_CLASS(obj) \
52 (G_TYPE_INSTANCE_GET_CLASS \
53 ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
57 typedef struct _CamelStreamBuffer CamelStreamBuffer;
58 typedef struct _CamelStreamBufferClass CamelStreamBufferClass;
59 typedef struct _CamelStreamBufferPrivate CamelStreamBufferPrivate;
62 CAMEL_STREAM_BUFFER_BUFFER = 0,
63 CAMEL_STREAM_BUFFER_NONE,
64 CAMEL_STREAM_BUFFER_READ = 0x00,
65 CAMEL_STREAM_BUFFER_WRITE = 0x80,
66 CAMEL_STREAM_BUFFER_MODE = 0x80
67 } CamelStreamBufferMode;
69 struct _CamelStreamBuffer {
71 CamelStreamBufferPrivate *priv;
74 struct _CamelStreamBufferClass {
75 CamelStreamClass parent_class;
77 void (*init) (CamelStreamBuffer *stream_buffer,
79 CamelStreamBufferMode mode);
80 void (*init_vbuf) (CamelStreamBuffer *stream_buffer,
82 CamelStreamBufferMode mode,
87 GType camel_stream_buffer_get_type (void);
88 CamelStream * camel_stream_buffer_new (CamelStream *stream,
89 CamelStreamBufferMode mode);
90 CamelStream * camel_stream_buffer_new_with_vbuf
92 CamelStreamBufferMode mode,
95 gint camel_stream_buffer_gets (CamelStreamBuffer *sbf,
98 GCancellable *cancellable,
100 gchar * camel_stream_buffer_read_line (CamelStreamBuffer *sbf,
101 GCancellable *cancellable,
106 #endif /* CAMEL_STREAM_BUFFER_H */