SDL_SaveFile_IO(3)
β¨ SDL_SaveFile_IO β¨
okay bestie, welcome to the SDL_SaveFile_IO(3) page, straight out of the SDL3 FUNCTIONS section of the manual. this one is short, it's sweet, and it literally just yeets all your data into an SDL data stream. no cap. π
πΈ NAME πΈ
SDL_SaveFile_IO β save all the data into an SDL data stream. that's it, that's the job, and she does it flawlessly. π
π SYNOPSIS π
#include <SDL3/SDL_iostream.h>
bool SDL_SaveFile_IO(SDL_IOStream *src, const void *data, size_t datasize, bool closeio);
one function, four arguments, zero drama. β¨
π¦ FUNCTION PARAMETERS π¦
srcβ theSDL_IOStreamyou want to write all the data to. she's the destination, the main character, the place where things get written. πdataβ the actual data getting written. here's the tea though: ifdatasizeis0, this may beNULLor an invalid pointer. literally the only time an invalid pointer is allowed to vibe here. πdatasizeβ the number of bytes to be written. count 'em, bestie. π’closeioβ iftrue, it callsSDL_CloseIO()onsrcbefore returning β even in the case of an error. so like, it closes the door behind you no matter how the night went. πͺπ
π RETURN VALUE π
returns true on success or false on failure. if it flops, call SDL_GetError() for more information β she'll tell you exactly what went wrong, fr fr. π«Ά
π₯ THREAD SAFETY π₯
do not use the same SDL_IOStream from two threads at once. that's it. that's the whole rule. sharing is not caring in this specific case, bestie. π«π§΅
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on something older, sorry babe, no function for you. π
π SEE ALSO π
and that's the whole page, you ate it up. π this gem comes to you courtesy of Simple Directmedia Layer, rockin' SDL 3.4.18 β go forth and save your files, icon. πβ¨π
π¦ 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