KDK_CONF_LIST_GROUP(3)
💖 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 thatkdk_conf_initgave you. you gotta have one of these first, fr fr.
🌸 Returns 🌸
const char** const— aNULL-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()andkdk_config_freeall().
👑 SEE ALSO 👑
go read these next, they're the squad: 🧚
kdk_conf_init(3)kdk_conf_destroy(3)kdk_conf_reload(3)kdk_conf_get_value(3)kdk_conf_list_key(3)kdk_config_freeall(3)
💜 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
- arch rolling: libkysdk-base 3.0.1.1-1 · Apache-2.0 AND LGPL-3.0-or-later AND MIT
- ubuntu resolute: libkysdk-base-dev 3.0.1.2-0ubuntu1 · LGPL-3.0-or-later
- ubuntu stonking: libkysdk-base-dev 3.0.1.3-1build1 · LGPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms