Fix getauxval error at qemu
[platform/upstream/glib.git] / gio / giostream.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright © 2008, 2009 Codethink Limited
4  * Copyright © 2009 Red Hat, Inc.
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * See the included COPYING file for more information.
14  *
15  * Authors: Ryan Lortie <desrt@desrt.ca>
16  *          Alexander Larsson <alexl@redhat.com>
17  */
18
19 #ifndef __G_IO_STREAM_H__
20 #define __G_IO_STREAM_H__
21
22 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
23 #error "Only <gio/gio.h> can be included directly."
24 #endif
25
26 #include <gio/ginputstream.h>
27 #include <gio/goutputstream.h>
28 #include <gio/gcancellable.h>
29 #include <gio/gioerror.h>
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_IO_STREAM         (g_io_stream_get_type ())
34 #define G_IO_STREAM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_IO_STREAM, GIOStream))
35 #define G_IO_STREAM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_IO_STREAM, GIOStreamClass))
36 #define G_IS_IO_STREAM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_IO_STREAM))
37 #define G_IS_IO_STREAM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_IO_STREAM))
38 #define G_IO_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_IO_STREAM, GIOStreamClass))
39
40 typedef struct _GIOStreamPrivate                            GIOStreamPrivate;
41 typedef struct _GIOStreamClass                              GIOStreamClass;
42
43 /**
44  * GIOStream:
45  *
46  * Base class for read-write streams.
47  **/
48 struct _GIOStream
49 {
50   GObject parent_instance;
51
52   /*< private >*/
53   GIOStreamPrivate *priv;
54 };
55
56 struct _GIOStreamClass
57 {
58   GObjectClass parent_class;
59
60   GInputStream *  (*get_input_stream)  (GIOStream *stream);
61   GOutputStream * (*get_output_stream) (GIOStream *stream);
62
63   gboolean (* close_fn)     (GIOStream           *stream,
64                              GCancellable        *cancellable,
65                              GError             **error);
66   void     (* close_async)  (GIOStream           *stream,
67                              int                  io_priority,
68                              GCancellable        *cancellable,
69                              GAsyncReadyCallback  callback,
70                              gpointer             user_data);
71   gboolean (* close_finish) (GIOStream           *stream,
72                              GAsyncResult        *result,
73                              GError             **error);
74   /*< private >*/
75   /* Padding for future expansion */
76   void (*_g_reserved1) (void);
77   void (*_g_reserved2) (void);
78   void (*_g_reserved3) (void);
79   void (*_g_reserved4) (void);
80   void (*_g_reserved5) (void);
81   void (*_g_reserved6) (void);
82   void (*_g_reserved7) (void);
83   void (*_g_reserved8) (void);
84   void (*_g_reserved9) (void);
85   void (*_g_reserved10) (void);
86 };
87
88 GIO_AVAILABLE_IN_ALL
89 GType          g_io_stream_get_type          (void)  G_GNUC_CONST;
90
91 GIO_AVAILABLE_IN_ALL
92 GInputStream * g_io_stream_get_input_stream  (GIOStream            *stream);
93 GIO_AVAILABLE_IN_ALL
94 GOutputStream *g_io_stream_get_output_stream (GIOStream            *stream);
95
96 GIO_AVAILABLE_IN_ALL
97 void           g_io_stream_splice_async      (GIOStream            *stream1,
98                                               GIOStream            *stream2,
99                                               GIOStreamSpliceFlags  flags,
100                                               int                   io_priority,
101                                               GCancellable         *cancellable,
102                                               GAsyncReadyCallback   callback,
103                                               gpointer              user_data);
104
105 GIO_AVAILABLE_IN_ALL
106 gboolean       g_io_stream_splice_finish     (GAsyncResult         *result,
107                                               GError              **error);
108
109 GIO_AVAILABLE_IN_ALL
110 gboolean       g_io_stream_close             (GIOStream            *stream,
111                                               GCancellable         *cancellable,
112                                               GError              **error);
113
114 GIO_AVAILABLE_IN_ALL
115 void           g_io_stream_close_async       (GIOStream            *stream,
116                                               int                   io_priority,
117                                               GCancellable         *cancellable,
118                                               GAsyncReadyCallback   callback,
119                                               gpointer              user_data);
120 GIO_AVAILABLE_IN_ALL
121 gboolean       g_io_stream_close_finish      (GIOStream            *stream,
122                                               GAsyncResult         *result,
123                                               GError              **error);
124
125 GIO_AVAILABLE_IN_ALL
126 gboolean       g_io_stream_is_closed         (GIOStream            *stream);
127 GIO_AVAILABLE_IN_ALL
128 gboolean       g_io_stream_has_pending       (GIOStream            *stream);
129 GIO_AVAILABLE_IN_ALL
130 gboolean       g_io_stream_set_pending       (GIOStream            *stream,
131                                               GError              **error);
132 GIO_AVAILABLE_IN_ALL
133 void           g_io_stream_clear_pending     (GIOStream            *stream);
134
135 G_END_DECLS
136
137 #endif /* __G_IO_STREAM_H__ */