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