mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
Add g_input_stream_read_all_async()
Add an asynchronous version of _read_all(). This API is not fully consistent with the normal expectations of a non-asynchronous version. Consistency between the sync and async version is probably more important. The API will still bind correctly, but access to all functionality will not be available: specifically, in the case of an error, higher level languages will be unable to determine how many bytes were successfully read before the error. Most users will probably not want to use this information anyway, so this is OK -- and if they do need the information, then they can just write the loop for themselves. Heavily based on a patch from Ignacio Casal Quinteiro. https://bugzilla.gnome.org/show_bug.cgi?id=737451
This commit is contained in:
@@ -151,6 +151,21 @@ GLIB_AVAILABLE_IN_ALL
|
||||
gssize g_input_stream_read_finish (GInputStream *stream,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_44
|
||||
void g_input_stream_read_all_async (GInputStream *stream,
|
||||
void *buffer,
|
||||
gsize count,
|
||||
int io_priority,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GLIB_AVAILABLE_IN_2_44
|
||||
gboolean g_input_stream_read_all_finish (GInputStream *stream,
|
||||
GAsyncResult *result,
|
||||
gsize *bytes_read,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_34
|
||||
void g_input_stream_read_bytes_async (GInputStream *stream,
|
||||
gsize count,
|
||||
|
Reference in New Issue
Block a user