1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3 * Authors: Michael Zucchi <notzed@ximian.com>
5 * Copyright 2003 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
24 EMSyncStream - Abstract class.
25 A synchronous stream, that can be written from any thread, but whose
26 requests are always handled in the main gui thread in the correct order.
29 #ifndef EM_SYNC_STREAM_H
30 #define EM_SYNC_STREAM_H
35 #endif /* __cplusplus */
37 #define EM_SYNC_STREAM_TYPE (em_sync_stream_get_type ())
38 #define EM_SYNC_STREAM(obj) (CAMEL_CHECK_CAST((obj), EM_SYNC_STREAM_TYPE, EMSyncStream))
39 #define EM_SYNC_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), EM_SYNC_STREAM_TYPE, EMSyncStreamClass))
40 #define EM_IS_SYNC_STREAM(o) (CAMEL_CHECK_TYPE((o), EM_SYNC_STREAM_TYPE))
43 #include <camel/camel-stream.h>
45 typedef struct _EMSyncStream
{
46 CamelStream parent_stream
;
48 struct _EMSyncStreamPrivate
*priv
;
54 CamelStreamClass parent_class
;
56 ssize_t (*sync_write
) (CamelStream
*stream
, const char *buffer
, size_t n
);
57 int (*sync_close
) (CamelStream
*stream
);
58 int (*sync_flush
) (CamelStream
*stream
);
62 CamelType
em_sync_stream_get_type (void);
63 void em_sync_stream_set_buffer_size(EMSyncStream
*, size_t size
);
67 #endif /* __cplusplus */
69 #endif /* EM_SYNC_STREAM_H */