KDK_CONF_LIST_KEY(3)

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

💖 KDK_CONF_LIST_KEY(3) 💖

okay so bestie, welcome to the manual page for kdk_conf_list_key — yes it lives in section 3 of the library functions manual, and yes it's gonna be a whole vibe. grab a boba, we're doing this 🧋


✨ NAME ✨

kdk_conf_list_key — 列举id对应配置文件的指定Group下的key值


🌸 SYNOPSIS 🌸

#include <libkyconf.h>

🦋 Functions

char** const kdk_conf_list_key (int id, const char * group)

列举id对应配置文件的指定Group下的key值,结尾以NULL指针表示

💅 Parameters

  • id — 由kdk_conf_init返回的句柄值
  • group — 需要列举的Group名称

🎀 Returns

const char** const 以NULL结尾的字符串列表

Link with -lkyconf.

not me making you link with -lkyconf, like obviously, it's giving "you need the library to use the library" 😭 but fr fr, don't forget it.

🔥 Detailed Description 🔥

接口的主要功能是列举id对应配置文件的指定Group下的key值


⭐ EXAMPLES ⭐

okay bestie here's a full lil main character moment of an example, no cap:

#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;
}

like, look at it. it's iterating groups, then iterating keys, then grabbing values, then freeing everything like a responsible queen 👑 we love to see it.


🌈 CONFORMING TO 🌈

These functions are as per the withdrawn POSIX.1e draft specification.

The following functions are Linux extensions: kdk_conf_init(), kdk_conf_destroy(), kdk_conf_reload(), kdk_conf_get_value(), kdk_conf_list_group() and kdk_config_freeall().

lowkey important: that POSIX.1e draft is withdrawn, bestie. and those listed ones are Linux extensions, not part of the standard. iykyk.

👑 SEE ALSO 👑

kdk_conf_init(3), kdk_conf_destroy(3), kdk_conf_reload(3), kdk_conf_get_value(3), kdk_conf_list_group(3) and kdk_config_freeall(3).


💜 Author 💜

Generated automatically by Doxygen for libkyconf.h from the source code.


and that's the whole page, bestie!! this one came from My Project and it's dated Fri Sep 22 2023 — so go forth, list those keys, free your memory, and slay 💅✨🫶

📦 where this page comes from