| 1 | #ifndef __G_CALLBACK_INPUT_STREAM_H__ |
| 2 | #define __G_CALLBACK_INPUT_STREAM_H__ |
| 3 | |
| 4 | #include <gio/gio.h> |
| 5 | |
| 6 | G_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 | |
| 16 | typedef struct _GCallbackInputStream GCallbackInputStream; |
| 17 | typedef struct _GCallbackInputStreamClass GCallbackInputStreamClass; |
| 18 | typedef struct _GCallbackInputStreamPrivate GCallbackInputStreamPrivate; |
| 19 | |
| 20 | struct _GCallbackInputStream |
| 21 | { |
| 22 | GInputStream parent_instance; |
| 23 | |
| 24 | /*< private >*/ |
| 25 | GCallbackInputStreamPrivate *priv; |
| 26 | }; |
| 27 | |
| 28 | struct _GCallbackInputStreamClass |
| 29 | { |
| 30 | GInputStreamClass parent_class; |
| 31 | }; |
| 32 | |
| 33 | GType g_callback_input_stream_get_type (void) G_GNUC_CONST; |
| 34 | |
| 35 | typedef gssize (*GCallbackInputStreamReadFunc) (void *buffer, |
| 36 | gsize count, |
| 37 | GCancellable *cancellable, |
| 38 | GError **error, |
| 39 | gpointer data); |
| 40 | |
| 41 | typedef gboolean (*GCallbackInputStreamCloseFunc) (GCancellable *cancellable, |
| 42 | GError **error, |
| 43 | gpointer data); |
| 44 | |
| 45 | |
| 46 | GInputStream* |
| 47 | g_callback_input_stream_new (GCallbackInputStreamReadFunc read_func, |
| 48 | GCallbackInputStreamCloseFunc close_func, |
| 49 | gpointer user_data); |
| 50 | |
| 51 | G_END_DECLS |
| 52 | |
| 53 | #endif /* __G_CALLBACK_INPUT_STREAM_H__ */ |