---
name: "kdk_conf_list_group"
section: "3"
platform: "linux"
package: "libkysdk-base"
version: "3.0.1.1-3"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/kdk_conf_list_group"
---

# kdk\_conf\_list\_group(3)

列举id对应配置文件的所有Group

## NAME

kdk\_conf\_list\_group - 列举id对应配置文件的所有Group

## SYNOPSIS

**#include \<libkyconf.h\>**\

### Functions

### char\*\* const kdk\_conf\_list\_group (int id)

列举id对应配置文件的所有Group，结尾以NULL指针表示

**Parameters**

*id* 由kdk\_conf\_init返回的句柄值

**Returns**

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

Link with *-lkyconf*.

## Detailed Description

接口的主要功能是列举id对应配置文件的所有Group

## EXAMPLES

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

## 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\_key**() and **kdk\_config\_freeall**().

## SEE ALSO

[**kdk\_conf\_init**(3)](/man/kdk_conf_init/3.md), [**kdk\_conf\_destroy**(3)](/man/kdk_conf_destroy/3.md), [**kdk\_conf\_reload**(3)](/man/kdk_conf_reload/3.md), [**kdk\_conf\_get\_value**(3)](/man/kdk_conf_get_value/3.md), [**kdk\_conf\_list\_key**(3)](/man/kdk_conf_list_key/3.md) and [**kdk\_config\_freeall**(3)](/man/kdk_config_freeall/3.md).

## Author

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