Function
Giopollable_stream_write
since: 2.34
Declaration
gssize
g_pollable_stream_write (
GOutputStream* stream,
void* buffer,
gsize count,
gboolean blocking,
GCancellable* cancellable,
GError** error
)
Description
Tries to write to stream, as with g_output_stream_write() (if
blocking is TRUE) or g_pollable_output_stream_write_nonblocking()
(if blocking is FALSE). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
If blocking is FALSE, then stream must be a
GPollableOutputStream for which
g_pollable_output_stream_can_poll() returns TRUE or else the
behavior is undefined. If blocking is TRUE, then stream does not
need to be a GPollableOutputStream.
Available since: 2.34
Parameters
stream-
Type:
GOutputStreamA
GOutputStream.The data is owned by the caller of the function. buffer-
Type: An array of
guint8The buffer containing the data to write.
The length of the array is specified in the countargument.The data is owned by the caller of the function. count-
Type:
gsizeThe number of bytes to write.
blocking-
Type:
gbooleanWhether to do blocking I/O.
cancellable-
Type:
GCancellableOptional
GCancellableobject,NULLto ignore.The argument can be NULL.The data is owned by the caller of the function. error-
Type:
GError **The return location for a recoverable error.
The argument can be NULL.If the return location is not NULL, then you must initialize it to aNULLGError*.The argument will be left initialized to NULLby the function if there are no errors.In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.