SDL_SeekIO(3)
π« SDL_SeekIO β the glow-up guide π«
okay bestie, this one lives in the SDL3 FUNCTIONS corner of the SDL_SeekIO(3) manual, and it's literally just "teleport around inside a data stream." no cap.
β¨ NAME β¨
SDL_SeekIO β seek within an SDL_IOStream data stream. yes girl, we're moving the cursor. slay.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_iostream.h>
Sint64 SDL_SeekIO(SDL_IOStream *context, Sint64 offset, SDL_IOWhence whence);
π¦ DESCRIPTION π¦
so the whole vibe is: this function seeks to byte offset, relative to whence. that's it, that's the function. it's giving "jump to wherever I point." π
whence can be any of these iconic little values:
SDL_IO_SEEK_SETβ seek from the beginning of dataSDL_IO_SEEK_CURβ seek relative to current read pointSDL_IO_SEEK_ENDβ seek relative to the end of data
β οΈ and listen β if this stream can not seek, it will return -1. no drama, just facts. not every stream can do this move and that's okay.
π FUNCTION PARAMETERS π
contextβ a pointer to anSDL_IOStreamstructure. that's your stream, your main character. π«Άoffsetβ an offset in bytes, relative to whence location; can be negative. yes, negative. we go backwards sometimes, it's a whole thing. πwhenceβ any ofSDL_IO_SEEK_SET,SDL_IO_SEEK_CUR,SDL_IO_SEEK_END. pick your starting point, queen. π
β RETURN VALUE β
returns the final offset in the data stream after the seek, or -1 on failure. and if it fails? call SDL_GetError() for more information β that's your gossip source, fr fr. π
π₯ THREAD SAFETY π₯
do not use the same SDL_IOStream from two threads at once. that's a red flag, bestie. one stream, one thread, periodt. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something olderβ¦ no it isn't. π
π SEE ALSO π
SDL_TellIO(3)β the "where am I rn" counterpart. they're a duo, iykyk.
and that's the whole page, mwah. this was the SDL_SeekIO(3) page from Simple Directmedia Layer, SDL 3.4.18 era β go forth and seek responsibly, angel π§π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms