SDL_SetEnvironmentVariable(3)
π SDL_SetEnvironmentVariable π
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_SetEnvironmentVariable β the girl whose whole job is putting a variable into an environment. she's giving glow-up energy for your env vars, fr fr. π
β¨ NAME β¨
SDL_SetEnvironmentVariable β set the value of a variable in the environment. literally that's it, that's the gig. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite);
β¨ FUNCTION PARAMETERS β¨
envβ the environment you wanna modify. the lil world you're editing, bestie. πnameβ the name of the variable you're setting. πvalueβ the value you're giving that variable. the whole point of the operation, honestly.overwriteβtrueif you want to overwrite the variable when it already exists;falseif you want it to just return success without setting anything when it already exists. like, "nah she's already here, we're good" energy. π
β¨ RETURN VALUE β¨
Returns true on success or false on failure. and if it's giving failure?? call SDL_GetError() for more info, she'll tell you what went wrong. π
β¨ THREAD SAFETY β¨
It is safe to call this function from any thread. no cap, go wild, every thread is invited to the party. π§
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0. vintage-ish but still iconic. β
β¨ SEE ALSO β¨
the whole friend group, obviously:
SDL_GetEnvironment(3)SDL_CreateEnvironment(3)SDL_GetEnvironmentVariable(3)SDL_GetEnvironmentVariables(3)SDL_UnsetEnvironmentVariable(3)
Simple Directmedia Layer π¦ this was SDL 3.4.18, dated with all the love, and the page you just read is SDL_SetEnvironmentVariable(3). mwah, go set some variables bestie, you're gonna ate π
β¨π«Ά
π¦ 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