43
39
#define G_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_OUTPUT_STREAM, GOutputStreamClass))
46
* GOutputStreamSpliceFlags:
47
* @G_OUTPUT_STREAM_SPLICE_NONE: Do not close either stream.
48
* @G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE: Close the source stream after the splice.
49
* @G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET: Close the target stream after the splice.
51
* GOutputStreamSpliceFlags determine how streams should be spliced.
54
G_OUTPUT_STREAM_SPLICE_NONE = 0,
55
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = 1 << 0,
56
G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = 1 << 1
57
} GOutputStreamSpliceFlags;
62
* Base class for writing output.
64
* All classes derived from GOutputStream should implement synchronous
44
* Base class for writing output.
46
* All classes derived from GOutputStream should implement synchronous
65
47
* writing, splicing, flushing and closing streams, but may implement
66
48
* asynchronous versions.
68
typedef struct _GOutputStream GOutputStream;
69
50
typedef struct _GOutputStreamClass GOutputStreamClass;
70
51
typedef struct _GOutputStreamPrivate GOutputStreamPrivate;
72
53
struct _GOutputStream
74
55
GObject parent_instance;
77
58
GOutputStreamPrivate *priv;
83
64
GObjectClass parent_class;
87
gssize (* write_fn)(GOutputStream *stream,
90
GCancellable *cancellable,
92
gssize (* splice) (GOutputStream *stream,
94
GOutputStreamSpliceFlags flags,
95
GCancellable *cancellable,
97
gboolean (* flush) (GOutputStream *stream,
98
GCancellable *cancellable,
100
gboolean (* close_fn)(GOutputStream *stream,
101
GCancellable *cancellable,
68
gssize (* write_fn) (GOutputStream *stream,
71
GCancellable *cancellable,
73
gssize (* splice) (GOutputStream *stream,
75
GOutputStreamSpliceFlags flags,
76
GCancellable *cancellable,
78
gboolean (* flush) (GOutputStream *stream,
79
GCancellable *cancellable,
81
gboolean (* close_fn) (GOutputStream *stream,
82
GCancellable *cancellable,
104
85
/* Async ops: (optional in derived classes) */
106
void (* write_async) (GOutputStream *stream,
110
GCancellable *cancellable,
111
GAsyncReadyCallback callback,
113
gssize (* write_finish) (GOutputStream *stream,
114
GAsyncResult *result,
116
void (* splice_async) (GOutputStream *stream,
117
GInputStream *source,
118
GOutputStreamSpliceFlags flags,
120
GCancellable *cancellable,
121
GAsyncReadyCallback callback,
123
gssize (* splice_finish)(GOutputStream *stream,
124
GAsyncResult *result,
126
void (* flush_async) (GOutputStream *stream,
128
GCancellable *cancellable,
129
GAsyncReadyCallback callback,
131
gboolean (* flush_finish) (GOutputStream *stream,
132
GAsyncResult *result,
134
void (* close_async) (GOutputStream *stream,
136
GCancellable *cancellable,
137
GAsyncReadyCallback callback,
139
gboolean (* close_finish) (GOutputStream *stream,
140
GAsyncResult *result,
87
void (* write_async) (GOutputStream *stream,
91
GCancellable *cancellable,
92
GAsyncReadyCallback callback,
94
gssize (* write_finish) (GOutputStream *stream,
97
void (* splice_async) (GOutputStream *stream,
99
GOutputStreamSpliceFlags flags,
101
GCancellable *cancellable,
102
GAsyncReadyCallback callback,
104
gssize (* splice_finish) (GOutputStream *stream,
105
GAsyncResult *result,
107
void (* flush_async) (GOutputStream *stream,
109
GCancellable *cancellable,
110
GAsyncReadyCallback callback,
112
gboolean (* flush_finish) (GOutputStream *stream,
113
GAsyncResult *result,
115
void (* close_async) (GOutputStream *stream,
117
GCancellable *cancellable,
118
GAsyncReadyCallback callback,
120
gboolean (* close_finish) (GOutputStream *stream,
121
GAsyncResult *result,
144
125
/* Padding for future expansion */