Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 10:13:04

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2006-2007 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Christian Kellner <gicmo@gnome.org>
0021  */
0022 
0023 #ifndef __G_BUFFERED_INPUT_STREAM_H__
0024 #define __G_BUFFERED_INPUT_STREAM_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/gfilterinputstream.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 #define G_TYPE_BUFFERED_INPUT_STREAM         (g_buffered_input_stream_get_type ())
0035 #define G_BUFFERED_INPUT_STREAM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStream))
0036 #define G_BUFFERED_INPUT_STREAM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStreamClass))
0037 #define G_IS_BUFFERED_INPUT_STREAM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_BUFFERED_INPUT_STREAM))
0038 #define G_IS_BUFFERED_INPUT_STREAM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_BUFFERED_INPUT_STREAM))
0039 #define G_BUFFERED_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStreamClass))
0040 
0041 typedef struct _GBufferedInputStreamClass    GBufferedInputStreamClass;
0042 typedef struct _GBufferedInputStreamPrivate  GBufferedInputStreamPrivate;
0043 
0044 struct _GBufferedInputStream
0045 {
0046   GFilterInputStream parent_instance;
0047 
0048   /*< private >*/
0049   GBufferedInputStreamPrivate *priv;
0050 };
0051 
0052 struct _GBufferedInputStreamClass
0053 {
0054   GFilterInputStreamClass parent_class;
0055 
0056   gssize   (* fill)        (GBufferedInputStream *stream,
0057                 gssize                count,
0058                 GCancellable         *cancellable,
0059                 GError              **error);
0060 
0061   /* Async ops: (optional in derived classes) */
0062   void     (* fill_async)  (GBufferedInputStream *stream,
0063                 gssize                count,
0064                 int                   io_priority,
0065                 GCancellable         *cancellable,
0066                 GAsyncReadyCallback   callback,
0067                 gpointer              user_data);
0068   gssize   (* fill_finish) (GBufferedInputStream *stream,
0069                 GAsyncResult         *result,
0070                 GError              **error);
0071 
0072   /*< private >*/
0073   /* Padding for future expansion */
0074   void (*_g_reserved1) (void);
0075   void (*_g_reserved2) (void);
0076   void (*_g_reserved3) (void);
0077   void (*_g_reserved4) (void);
0078   void (*_g_reserved5) (void);
0079 };
0080 
0081 
0082 GIO_AVAILABLE_IN_ALL
0083 GType         g_buffered_input_stream_get_type        (void) G_GNUC_CONST;
0084 GIO_AVAILABLE_IN_ALL
0085 GInputStream* g_buffered_input_stream_new             (GInputStream          *base_stream);
0086 GIO_AVAILABLE_IN_ALL
0087 GInputStream* g_buffered_input_stream_new_sized       (GInputStream          *base_stream,
0088                                gsize                  size);
0089 
0090 GIO_AVAILABLE_IN_ALL
0091 gsize         g_buffered_input_stream_get_buffer_size (GBufferedInputStream  *stream);
0092 GIO_AVAILABLE_IN_ALL
0093 void          g_buffered_input_stream_set_buffer_size (GBufferedInputStream  *stream,
0094                                gsize                  size);
0095 GIO_AVAILABLE_IN_ALL
0096 gsize         g_buffered_input_stream_get_available   (GBufferedInputStream  *stream);
0097 GIO_AVAILABLE_IN_ALL
0098 gsize         g_buffered_input_stream_peek            (GBufferedInputStream  *stream,
0099                                void                  *buffer,
0100                                gsize                  offset,
0101                                gsize                  count);
0102 GIO_AVAILABLE_IN_ALL
0103 const void*   g_buffered_input_stream_peek_buffer     (GBufferedInputStream  *stream,
0104                                gsize                 *count);
0105 
0106 GIO_AVAILABLE_IN_ALL
0107 gssize        g_buffered_input_stream_fill            (GBufferedInputStream  *stream,
0108                                gssize                 count,
0109                                GCancellable          *cancellable,
0110                                GError               **error);
0111 GIO_AVAILABLE_IN_ALL
0112 void          g_buffered_input_stream_fill_async      (GBufferedInputStream  *stream,
0113                                gssize                 count,
0114                                int                    io_priority,
0115                                GCancellable          *cancellable,
0116                                GAsyncReadyCallback    callback,
0117                                gpointer               user_data);
0118 GIO_AVAILABLE_IN_ALL
0119 gssize        g_buffered_input_stream_fill_finish     (GBufferedInputStream  *stream,
0120                                GAsyncResult          *result,
0121                                GError               **error);
0122 
0123 GIO_AVAILABLE_IN_ALL
0124 int           g_buffered_input_stream_read_byte       (GBufferedInputStream  *stream,
0125                                GCancellable          *cancellable,
0126                                GError               **error);
0127 
0128 G_END_DECLS
0129 
0130 #endif /* __G_BUFFERED_INPUT_STREAM_H__ */