list_config_sections(3alleg4)

✨ list_config_sections ✨

okay bestie, welcome to the Allegro manual πŸ’– this is list_config_sections(3alleg4) and it's literally the function that tells you every section name chillin' in your current configuration. it's giving backstage pass to your config file πŸŽ€


🌸 NAME 🌸

list_config_sections β€” lists the names of all sections available in the current configuration. (also: Allegro game programming library, hiii πŸ‘‹)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int list_config_sections(const char ***names);

like yes, that's a triple pointer. no, we're not gonna panic about it. it's iconic, it ate, moving on πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so the names parameter is a pointer to an array of strings. that's the whole vibe.

here's the tea πŸ“: if it points to a NULL pointer, the list gets allocated. if it doesn't, the list gets re-allocated. either way, once the function comes back, that array is gonna contain the names of all the sections in the current configuration. every single one. no crumbs left behind πŸ‘‘

and listen, when you're done being obsessed with your shiny new list, use free_config_entries to free the allocated memory again, okay? don't leave it hanging, that's rude 😭

want more info and an actual example of how to use this thing? go peek at list_config_entries. it's the sister function, they're a duo, iykyk 🫢


⭐ RETURN VALUE ⭐

returns the number of valid strings in the names array. that's your count, bestie, use it wisely ✨


🌈 SEE ALSO 🌈


and that's the whole page, no notes πŸ’… this was Allegro version 4.4.3, page list_config_sections(3alleg4) β€” go forth and list those sections, main character πŸŽ€βœ¨