glib (2.79.0)
       1  /* GIO - GLib Input, Output and Streaming Library
       2   *
       3   * Copyright (C) 2006-2007 Red Hat, Inc.
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   *
       7   * This library is free software; you can redistribute it and/or
       8   * modify it under the terms of the GNU Lesser General Public
       9   * License as published by the Free Software Foundation; either
      10   * version 2.1 of the License, or (at your option) any later version.
      11   *
      12   * This library is distributed in the hope that it will be useful,
      13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15   * Lesser General Public License for more details.
      16   *
      17   * You should have received a copy of the GNU Lesser General
      18   * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
      19   *
      20   * Author: Alexander Larsson <alexl@redhat.com>
      21   */
      22  
      23  #ifndef __G_DATA_INPUT_STREAM_H__
      24  #define __G_DATA_INPUT_STREAM_H__
      25  
      26  #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
      27  #error "Only <gio/gio.h> can be included directly."
      28  #endif
      29  
      30  #include <gio/gbufferedinputstream.h>
      31  
      32  G_BEGIN_DECLS
      33  
      34  #define G_TYPE_DATA_INPUT_STREAM         (g_data_input_stream_get_type ())
      35  #define G_DATA_INPUT_STREAM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStream))
      36  #define G_DATA_INPUT_STREAM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
      37  #define G_IS_DATA_INPUT_STREAM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DATA_INPUT_STREAM))
      38  #define G_IS_DATA_INPUT_STREAM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DATA_INPUT_STREAM))
      39  #define G_DATA_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_DATA_INPUT_STREAM, GDataInputStreamClass))
      40  
      41  typedef struct _GDataInputStreamClass    GDataInputStreamClass;
      42  typedef struct _GDataInputStreamPrivate  GDataInputStreamPrivate;
      43  
      44  struct _GDataInputStream
      45  {
      46    GBufferedInputStream parent_instance;
      47  
      48    /*< private >*/
      49    GDataInputStreamPrivate *priv;
      50  };
      51  
      52  struct _GDataInputStreamClass
      53  {
      54    GBufferedInputStreamClass parent_class;
      55  
      56    /*< private >*/
      57    /* Padding for future expansion */
      58    void (*_g_reserved1) (void);
      59    void (*_g_reserved2) (void);
      60    void (*_g_reserved3) (void);
      61    void (*_g_reserved4) (void);
      62    void (*_g_reserved5) (void);
      63  };
      64  
      65  GIO_AVAILABLE_IN_ALL
      66  GType                  g_data_input_stream_get_type             (void) G_GNUC_CONST;
      67  GIO_AVAILABLE_IN_ALL
      68  GDataInputStream *     g_data_input_stream_new                  (GInputStream            *base_stream);
      69  
      70  GIO_AVAILABLE_IN_ALL
      71  void                   g_data_input_stream_set_byte_order       (GDataInputStream        *stream,
      72                                                                   GDataStreamByteOrder     order);
      73  GIO_AVAILABLE_IN_ALL
      74  GDataStreamByteOrder   g_data_input_stream_get_byte_order       (GDataInputStream        *stream);
      75  GIO_AVAILABLE_IN_ALL
      76  void                   g_data_input_stream_set_newline_type     (GDataInputStream        *stream,
      77                                                                   GDataStreamNewlineType   type);
      78  GIO_AVAILABLE_IN_ALL
      79  GDataStreamNewlineType g_data_input_stream_get_newline_type     (GDataInputStream        *stream);
      80  GIO_AVAILABLE_IN_ALL
      81  guchar                 g_data_input_stream_read_byte            (GDataInputStream        *stream,
      82                                                                   GCancellable            *cancellable,
      83                                                                   GError                 **error);
      84  GIO_AVAILABLE_IN_ALL
      85  gint16                 g_data_input_stream_read_int16           (GDataInputStream        *stream,
      86                                                                   GCancellable            *cancellable,
      87                                                                   GError                 **error);
      88  GIO_AVAILABLE_IN_ALL
      89  guint16                g_data_input_stream_read_uint16          (GDataInputStream        *stream,
      90                                                                   GCancellable            *cancellable,
      91                                                                   GError                 **error);
      92  GIO_AVAILABLE_IN_ALL
      93  gint32                 g_data_input_stream_read_int32           (GDataInputStream        *stream,
      94                                                                   GCancellable            *cancellable,
      95                                                                   GError                 **error);
      96  GIO_AVAILABLE_IN_ALL
      97  guint32                g_data_input_stream_read_uint32          (GDataInputStream        *stream,
      98                                                                   GCancellable            *cancellable,
      99                                                                   GError                 **error);
     100  GIO_AVAILABLE_IN_ALL
     101  gint64                 g_data_input_stream_read_int64           (GDataInputStream        *stream,
     102                                                                   GCancellable            *cancellable,
     103                                                                   GError                 **error);
     104  GIO_AVAILABLE_IN_ALL
     105  guint64                g_data_input_stream_read_uint64          (GDataInputStream        *stream,
     106                                                                   GCancellable            *cancellable,
     107                                                                   GError                 **error);
     108  GIO_AVAILABLE_IN_ALL
     109  char *                 g_data_input_stream_read_line            (GDataInputStream        *stream,
     110                                                                   gsize                   *length,
     111                                                                   GCancellable            *cancellable,
     112                                                                   GError                 **error);
     113  GIO_AVAILABLE_IN_2_30
     114  char *                 g_data_input_stream_read_line_utf8       (GDataInputStream        *stream,
     115  								 gsize                   *length,
     116  								 GCancellable            *cancellable,
     117  								 GError                 **error);
     118  GIO_AVAILABLE_IN_ALL
     119  void                   g_data_input_stream_read_line_async      (GDataInputStream        *stream,
     120                                                                   gint                     io_priority,
     121                                                                   GCancellable            *cancellable,
     122                                                                   GAsyncReadyCallback      callback,
     123                                                                   gpointer                 user_data);
     124  GIO_AVAILABLE_IN_ALL
     125  char *                 g_data_input_stream_read_line_finish     (GDataInputStream        *stream,
     126                                                                   GAsyncResult            *result,
     127                                                                   gsize                   *length,
     128                                                                   GError                 **error);
     129  GIO_AVAILABLE_IN_2_30
     130  char *                 g_data_input_stream_read_line_finish_utf8(GDataInputStream        *stream,
     131                                                                   GAsyncResult            *result,
     132                                                                   gsize                   *length,
     133                                                                   GError                 **error);
     134  GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto)
     135  char *                 g_data_input_stream_read_until           (GDataInputStream        *stream,
     136                                                                   const gchar             *stop_chars,
     137                                                                   gsize                   *length,
     138                                                                   GCancellable            *cancellable,
     139                                                                   GError                 **error);
     140  GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_async)
     141  void                   g_data_input_stream_read_until_async     (GDataInputStream        *stream,
     142                                                                   const gchar             *stop_chars,
     143                                                                   gint                     io_priority,
     144                                                                   GCancellable            *cancellable,
     145                                                                   GAsyncReadyCallback      callback,
     146                                                                   gpointer                 user_data);
     147  GIO_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_finish)
     148  char *                 g_data_input_stream_read_until_finish    (GDataInputStream        *stream,
     149                                                                   GAsyncResult            *result,
     150                                                                   gsize                   *length,
     151                                                                   GError                 **error);
     152  
     153  GIO_AVAILABLE_IN_ALL
     154  char *                 g_data_input_stream_read_upto            (GDataInputStream        *stream,
     155                                                                   const gchar             *stop_chars,
     156                                                                   gssize                   stop_chars_len,
     157                                                                   gsize                   *length,
     158                                                                   GCancellable            *cancellable,
     159                                                                   GError                 **error);
     160  GIO_AVAILABLE_IN_ALL
     161  void                   g_data_input_stream_read_upto_async      (GDataInputStream        *stream,
     162                                                                   const gchar             *stop_chars,
     163                                                                   gssize                   stop_chars_len,
     164                                                                   gint                     io_priority,
     165                                                                   GCancellable            *cancellable,
     166                                                                   GAsyncReadyCallback      callback,
     167                                                                   gpointer                 user_data);
     168  GIO_AVAILABLE_IN_ALL
     169  char *                 g_data_input_stream_read_upto_finish     (GDataInputStream        *stream,
     170                                                                   GAsyncResult            *result,
     171                                                                   gsize                   *length,
     172                                                                   GError                 **error);
     173  
     174  G_END_DECLS
     175  
     176  #endif /* __G_DATA_INPUT_STREAM_H__ */