Commit 5ed77c11 authored by Philip Withnall's avatar Philip Withnall

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's avatarPhilip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=584284
parent 3a88ab6c
......@@ -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,
......
......@@ -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,
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment