SDL_GetAppMetadataProperty(3)
π SDL_GetAppMetadataProperty β get the deets on ur app π
okay bestie, welcome to the SDL3 FUNCTIONS manual section, where we're about to learn how to read back all the cute little metadata vibes you already told SDL about ur app. this is the "wait, what did i say my app was called again?" function and honestly? iconic. π
β¨ NAME β¨
SDL_GetAppMetadataProperty β Get metadata about your app. π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_init.h>
const char * SDL_GetAppMetadataProperty(const char *name);
π DESCRIPTION π
so here's the tea: this function hands you back metadata that you already set earlier using SDL_SetAppMetadata() or SDL_SetAppMetadataProperty(). it's literally the read-back to your write. π
and if you wanna know the full list of properties you can get and what each one actually means, go peek at SDL_SetAppMetadataProperty() β that's where all the lore lives. πβ¨
π§ FUNCTION PARAMETERS π§
nameβ the name of the metadata property to get. that's it, that's the whole job. lowkey the easiest parameter ever. π
β RETURN VALUE β
returns the current value of the metadata property. and if it hasn't been set? you get the default instead. π
and if the property has no default at all, you get NULL. so like, check for that, bestie. fr fr. π
π₯ THREAD SAFETY π₯
good news: it is safe to call this function from any thread. periodt. π
BUT β and this is the important part β the string it returns is not protected. so if you go call SDL_SetAppMetadataProperty() to set that same property from another thread, that string could potentially get freed out from under you. π
β οΈ so likeβ¦ don't be out here casually freeing the thing you're reading. that's giving undefined chaos energy and we do NOT want that. π
π¦ AVAILABILITY π¦
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, you gotta upgrade. β¨
π SEE ALSO π
and that's the whole page, bestie!! go forth and read ur metadata responsibly π
this lil gem comes to you straight from Simple Directmedia Layer, version SDL 3.4.18, and it's the SDL_GetAppMetadataProperty(3) page. no cap, thanks for reading the whole thing. 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