SDL_WriteIO

Write to an SDL_IOStream data stream.

This function writes exactly size bytes from the area pointed at by ptr to the stream. If this fails for any reason, it'll return less than size to demonstrate how far the write progressed. On success, it returns size.

On error, this function still attempts to write as much as possible, so it might return a positive value less than the requested write size.

The caller can use SDL_GetIOStatus() to determine if the problem is recoverable, such as a non-blocking write that can simply be retried later, or a fatal error.

extern (C) nothrow @nogc extern
size_t
SDL_WriteIO
(,
const(void)* ptr
,
size_t size
)

Parameters

context SDL_IOStream*

a pointer to an SDL_IOStream structure.

ptr const(void)*

a pointer to a buffer containing data to write.

size size_t

the number of bytes to write.

Return Value

Type: size_t

The number of bytes written, which will be less than size on failure; call SDL_GetError() for more information.

Threadsafety: This function is not thread safe.

See Also

Meta