get_datafile_property(3alleg4)

✨ get_datafile_property ✨

okay bestie, welcome to the Allegro manual page for get_datafile_property β€” it's the one that pulls a property string off your object πŸ’– (yes, that's 3alleg4, the section 3 Allegro library girlies, we're all here 🫢)

🌸 NAME 🌸

get_datafile_property β€” returns the property string for the object. Part of the Allegro game programming library, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

const char *get_datafile_property(const DATAFILE *dat, int type);

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, this function finds the property type of a DATAFILE object. The type parameter must be a value that was created with the DAT_ID() macro β€” do not freestyle that, bestie, it has to come from DAT_ID() periodt πŸ’…

Example, because I know you love a visual:

const char *name;
...
name = get_datafile_property(game_data,
                             DAT_ID('N','A','M','E'));
if (name == empty_string)
   abort_on_error("Object doesn't have a name!");

see how we check against empty_string right after? that's the move πŸ‘‘


⭐ RETURN VALUE ⭐

It hands you back a pointer to the text string for the object. But if the property isn't present? You get a pointer to the variable empty_string instead. that's the whole vibe check πŸ’€


🌈 SEE ALSO 🌈


okay that's the page, mwah 😘 this was the Allegro manual, version 4.4.3, and you're officially a get_datafile_property girlie now β€” go get those properties, bestie πŸŽ€βœ¨πŸ’œ