chiark / gitweb /
Initial checkin
[clg] / gio / alien / g_callback_input_stream.h
CommitLineData
aaa96f27 1#ifndef __G_CALLBACK_INPUT_STREAM_H__
2#define __G_CALLBACK_INPUT_STREAM_H__
3
4#include <gio/gio.h>
5
6G_BEGIN_DECLS
7
8#define G_TYPE_CALLBACK_INPUT_STREAM (g_callback_input_stream_get_type ())
9#define G_CALLBACK_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CALLBACK_INPUT_STREAM, GCallbackInputStream))
10#define G_CALLBACK_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CALLBACK_INPUT_STREAM, GCallbackInputStreamClass))
11#define G_IS_CALLBACK_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CALLBACK_INPUT_STREAM))
12#define G_IS_CALLBACK_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CALLBACK_INPUT_STREAM))
13#define G_CALLBACK_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CALLBACK_INPUT_STREAM, GCallbackInputStreamClass))
14
15
16typedef struct _GCallbackInputStream GCallbackInputStream;
17typedef struct _GCallbackInputStreamClass GCallbackInputStreamClass;
18typedef struct _GCallbackInputStreamPrivate GCallbackInputStreamPrivate;
19
20struct _GCallbackInputStream
21{
22 GInputStream parent_instance;
23
24 /*< private >*/
25 GCallbackInputStreamPrivate *priv;
26};
27
28struct _GCallbackInputStreamClass
29{
30 GInputStreamClass parent_class;
31};
32
33GType g_callback_input_stream_get_type (void) G_GNUC_CONST;
34
35typedef gssize (*GCallbackInputStreamReadFunc) (void *buffer,
36 gsize count,
37 GCancellable *cancellable,
38 GError **error,
39 gpointer data);
40
41typedef gboolean (*GCallbackInputStreamCloseFunc) (GCancellable *cancellable,
42 GError **error,
43 gpointer data);
44
45
46GInputStream*
47g_callback_input_stream_new (GCallbackInputStreamReadFunc read_func,
48 GCallbackInputStreamCloseFunc close_func,
49 gpointer user_data);
50
51G_END_DECLS
52
53#endif /* __G_CALLBACK_INPUT_STREAM_H__ */