KDK_CONF_LIST_GROUP(3)

📦 version 3.0.1.3, in arch rolling, ubuntu resolute, ubuntu stonking

💖 KDK_CONF_LIST_GROUP 💖 — the manual page, but make it make sense

okay bestie, so this is KDK_CONF_LIST_GROUP(3) — it lives in the Library Functions Manual and it's here to hand you every single Group in a config file. no cap. let's get into it. 🦋


✨ NAME ✨

kdk_conf_list_group — lists all the Groups in the config file that id points at. that's it, that's the whole job. 💅


✨ SYNOPSIS ✨

#include <libkyconf.h>

🌸 Functions 🌸

char** const kdk_conf_list_group (int id)

Lists every Group in the config file belonging to id, and the list ends with a NULL pointer to say "that's all of them, we're done here."</purl> like a little goodbye at the end. so polite. 🎀

🌸 Parameters 🌸

  • id — the handle value that kdk_conf_init gave you. you gotta have one of these first, fr fr.

🌸 Returns 🌸

  • const char** const — a NULL-terminated list of strings. 🫶
Link with -lkyconf. don't forget it or nothing works, and you'll be sad. 😭

🎀 DETAILED DESCRIPTION 🎀

the main character function here is simple: it lists all the Groups in the config file that corresponds to id. that's the vibe. that's the whole vibe. ✨


🔥 EXAMPLES 🔥

okay so here's the whole thing in action — walk through it, it's lowkey satisfying:

#include <libkyconf.h>
#include <stdio.h>
#include <string.h>

int main()
{
    char **keylist = NULL;
    int id = kdk_conf_init("struct.conf");
    ASSERT_NOT_NULL(id, -1);

    char **grouplist = kdk_conf_list_group(id);
    ASSERT_NOT_NULL(grouplist, -1);

    char *tmpgroup;
    int index = 0;
    while ((tmpgroup = grouplist[index]))
    {
        printf("Group: %s0, tmpgroup);
        keylist = kdk_conf_list_key(id, tmpgroup);
        ASSERT_NOT_NULL(keylist, -1);
        char *tmpkey;
        int k_index = 0;
        while ((tmpkey = keylist[k_index]))
        {
            const char *tmpval = kdk_conf_get_value(id, tmpgroup, tmpkey);
            printf("%s = %s0, tmpkey , tmpval);
            k_index ++;
        }
        kdk_config_freeall(keylist);

        index ++;
    }

    kdk_conf_destroy(id);
    kdk_config_freeall(grouplist);

    return 0;
}
🫶 that example is verbatim, bestie — every character exactly as it came. don't "fix" it. i said what i said.

⭐ CONFORMING TO ⭐

  • these functions are as per the withdrawn POSIX.1e draft specification. yeah. withdrawn. we don't talk about it. 💀
  • the following functions are Linux extensions: kdk_conf_init(), kdk_conf_destroy(), kdk_conf_reload(), kdk_conf_get_value(), kdk_conf_list_key() and kdk_config_freeall().

👑 SEE ALSO 👑

go read these next, they're the squad: 🧚


💜 Author 💜

Generated automatically by Doxygen for libkyconf.h from the source code. not me getting my whole bio written by a doc generator 😭 iconic honestly.


and that's the page!! thank you for coming to my ted talk. 💖

this was brought to you by My Project, dated Fri Sep 22 2023 — mwah, slay, periodt. 💅✨

📦 where this page comes from