mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
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
This commit is contained in:
parent
3a88ab6c25
commit
5ed77c1104
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user