SDL_setenv_unsafe(3)
π SDL_setenv_unsafe π
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_setenv_unsafe β the little env-var setter that lowkey does exactly what it says but comes with a vibe warning, so stay with me π«Ά
β¨ NAME β¨
SDL_setenv_unsafe β sets the value of a variable in the environment. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
int SDL_setenv_unsafe(const char *name, const char *value, int overwrite);
π¦ FUNCTION PARAMETERS π¦
nameβ the name of the variable you wanna set, bestie. like the label on the jar πvalueβ the value of the variable you're setting. the contents of the jar, if you will β¨overwriteβ the drama parameter π pass1and it will overwrite the variable if it already exists; pass0and it just returns success without touching the variable if it's already there. so0is the "no thoughts, respect the existing vibe" option π
π RETURN VALUE π
- returns
0on success π - returns
-1on error π
π THREAD SAFETY π
not me warning you but⦠this function is not thread safe, periodt.
consider using SDL_SetEnvironmentVariable() instead, fr fr π«Ά
β AVAILABILITY β
this function is available since SDL 3.2.0 β¨ iconic, honestly.
π SEE ALSO π
SDL_SetEnvironmentVariable(3)β the thread-safe bestie you should probably be using π
and that's the whole page, babe, you ate it π β¨
signing off with love: this came from the Simple Directmedia Layer crew, SDL 3.4.18 edition β mwah πππ¦
π¦ 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