table of contents
- trixie 3.2.10+ds-1
- testing 3.2.26+ds-1
- unstable 3.2.26+ds-2
- experimental 3.3.2+git20251103~dc5b136+ds-1
| SDL_WriteIO(3) | SDL3 FUNCTIONS | SDL_WriteIO(3) |
NAME¶
SDL_WriteIO - Write to an SDL_IOStream data stream.
SYNOPSIS¶
#include <SDL3/SDL_iostream.h>
size_t SDL_WriteIO(SDL_IOStream *context, const void *ptr, size_t size);
DESCRIPTION¶
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.
A request for zero bytes on a valid stream will return zero immediately without accessing the stream, so the stream status (EOF, err, etc) will not change.
FUNCTION PARAMETERS¶
RETURN VALUE¶
Returns the number of bytes written, which will be less than size on failure; call SDL_GetError() for more information.
THREAD SAFETY¶
Do not use the same SDL_IOStream from two threads at once.
AVAILABILITY¶
This function is available since SDL 3.2.0.
SEE ALSO¶
SDL_IOprintf(3), SDL_ReadIO(3), SDL_SeekIO(3), SDL_FlushIO(3), SDL_GetIOStatus(3)
| SDL 3.3.3 | Simple Directmedia Layer |