[glib] gdatainputstream: Deprecate read_until() in favour of read_upto()



commit 5ed77c1104c974a02c927c4a2006b00b52b5593e
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Feb 1 16:50:46 2018 +0000

    gdatainputstream: Deprecate read_until() in favour of read_upto()
    
    g_data_input_stream_read_upto() was introduced in 2.26; now it’s GLib
    2.56, we can probably deprecate the old versions (since the handling of
    consuming the stop character differs between the sync and async versions
    of it).
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=584284

 gio/gdatainputstream.c        |    6 ++++++
 gio/gdatainputstream.h        |    6 +++---
 gio/tests/data-input-stream.c |    4 ++++
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
index 348ce44..78a9b7d 100644
--- a/gio/gdatainputstream.c
+++ b/gio/gdatainputstream.c
@@ -915,6 +915,8 @@ scan_for_chars (GDataInputStream *stream,
  *     before encountering any of the stop characters. Set @length to
  *     a #gsize to get the length of the string. This function will
  *     return %NULL on an error.
+ * Deprecated: 2.56: Use g_data_input_stream_read_upto() instead, which has more
+ *     consistent behaviour regarding the stop character.
  */
 char *
 g_data_input_stream_read_until (GDataInputStream  *stream,
@@ -1170,6 +1172,8 @@ g_data_input_stream_read_line_async (GDataInputStream    *stream,
  * g_data_input_stream_read_upto_async() instead.
  *
  * Since: 2.20
+ * Deprecated: 2.56: Use g_data_input_stream_read_upto_async() instead, which
+ *     has more consistent behaviour regarding the stop character.
  */
 void
 g_data_input_stream_read_until_async (GDataInputStream    *stream,
@@ -1277,6 +1281,8 @@ g_data_input_stream_read_line_finish_utf8 (GDataInputStream  *stream,
  *     before encountering any of the stop characters. Set @length to
  *     a #gsize to get the length of the string. This function will
  *     return %NULL on an error.
+ * Deprecated: 2.56: Use g_data_input_stream_read_upto_finish() instead, which
+ *     has more consistent behaviour regarding the stop character.
  */
 gchar *
 g_data_input_stream_read_until_finish (GDataInputStream  *stream,
diff --git a/gio/gdatainputstream.h b/gio/gdatainputstream.h
index c37b797..3ad3b82 100644
--- a/gio/gdatainputstream.h
+++ b/gio/gdatainputstream.h
@@ -135,20 +135,20 @@ char *                 g_data_input_stream_read_line_finish_utf8(GDataInputStrea
                                                                  GAsyncResult            *result,
                                                                  gsize                   *length,
                                                                  GError                 **error);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto)
 char *                 g_data_input_stream_read_until           (GDataInputStream        *stream,
                                                                  const gchar             *stop_chars,
                                                                  gsize                   *length,
                                                                  GCancellable            *cancellable,
                                                                  GError                 **error);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_async)
 void                   g_data_input_stream_read_until_async     (GDataInputStream        *stream,
                                                                  const gchar             *stop_chars,
                                                                  gint                     io_priority,
                                                                  GCancellable            *cancellable,
                                                                  GAsyncReadyCallback      callback,
                                                                  gpointer                 user_data);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_56_FOR (g_data_input_stream_read_upto_finish)
 char *                 g_data_input_stream_read_until_finish    (GDataInputStream        *stream,
                                                                  GAsyncResult            *result,
                                                                  gsize                   *length,
diff --git a/gio/tests/data-input-stream.c b/gio/tests/data-input-stream.c
index 58a3b3a..d82b3e3 100644
--- a/gio/tests/data-input-stream.c
+++ b/gio/tests/data-input-stream.c
@@ -222,6 +222,8 @@ test_read_lines_LF_invalid_utf8 (void)
   g_object_unref (stream);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void
 test_read_until (void)
 {
@@ -268,6 +270,8 @@ test_read_until (void)
   g_object_unref (stream);
 }
 
+G_GNUC_END_IGNORE_DEPRECATIONS
+
 static void
 test_read_upto (void)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]