SDL_GetEnvironmentVariable(3)
π SDL_GetEnvironmentVariable(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetEnvironmentVariable β she gets the value of a variable in the environment. that's it, that's the gig, and she does it flawlessly. periodt. β¨
πΈ NAME πΈ
SDL_GetEnvironmentVariable β get the value of a variable in the environment. like, you hand her a name, she hands you back the value. iconic behaviour, no notes. π«Ά
π SYNOPSIS π
#include <SDL3/SDL_stdinc.h>
const char * SDL_GetEnvironmentVariable(SDL_Environment *env, const char *name);
look at her. one function, two args, returns a const char *. she's not complicated, she's just that girl. π
π¦ FUNCTION PARAMETERS π¦
envβ the environment to query. yes, the whole environment. she's asking this specific one, so don't go handing her a random one and expecting magic, bestie. πnameβ the name of the variable to get. the lil lookup key. the name tag at the party. you give her the name, she finds the variable. π₯
π RETURN VALUE π
she returns a pointer to the value of the variable... or NULL if it can't be found. and that's the whole vibe check: found = pointer, not found = NULL. no cap, that's literally it. if you get a NULL back, don't be dramatic, the variable just isn't there. π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. any of them. all of them. go wild, thread girlies, she's built for it. β
π AVAILABILITY π
this function has been available since SDL 3.2.0. so if you're on something older... babes, upgrade. π
π SEE ALSO π
SDL_GetEnvironment(3)SDL_CreateEnvironment(3)SDL_GetEnvironmentVariables(3)SDL_SetEnvironmentVariable(3)SDL_UnsetEnvironmentVariable(3)
the whole environment friend group honestly β get one, create one, get all of them, set one, unset one. collect the set, slay. β¨
and that's the page, bestie!! π brought to you by Simple Directmedia Layer, SDL 3.4.18, and this very SDL_GetEnvironmentVariable(3) page β mwah, go read your environment, ily, bye!! π¦πΈπ
π¦ 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