SDL_getenv_unsafe(3)
π SDL_getenv_unsafe(3) π
okay bestie, we're in the SDL3 FUNCTIONS section of the SDL3 manual, and today's episode is all about SDL_getenv_unsafe β yes the name is a little ominous, we'll get to that, breathe π«Ά
β¨ NAME β¨
SDL_getenv_unsafe β grab the value of a variable out of the environment πΈ
π¦ SYNOPSIS π¦
#include <SDL3/SDL_stdinc.h>
const char * SDL_getenv_unsafe(const char *name);
π DESCRIPTION π
so like, this function bypasses SDL's cached copy of the environment, and it is not thread-safe. that's the whole vibe of it, no cap π
on some platforms, this may make case-insensitive matches, while other platforms are case-sensitive. so the move is: be precise with the strings you use for queries through this interface, fr fr. meanwhile SDL_getenv is always case-sensitive, periodt. β¨
π FUNCTION PARAMETERS π
nameβ the name of the variable to get. like, the name. of the variable. iconic of it π
π RETURN VALUE π
returns a pointer to the value of the variable or NULL if it can't be found π
π THREAD SAFETY π
this function is not thread safe, so bestie... consider using SDL_getenv() instead π«Ά
β AVAILABILITY β
this function has been available since SDL 3.2.0 β¨
π SEE ALSO π
and that's the page!! slay π this lil' slice of the manual comes to you from Simple Directmedia Layer, version SDL 3.4.18, and yeah the footer still says SDL_getenv_unsafe(3) down there because it's her page and she's the main character π bye bestie, hydrate and check your env vars ππ§πΈ
π¦ 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