kdk_conf_destroy(3)

kdk_conf_destroy3

销毁指定的配置文件句柄

Usage

#include <libkyconf.h>

Functions

void kdk_conf_destroy (int id)

销毁指定的配置文件句柄

Parameters

id 由kdk_conf_init返回的配置文件句柄

Link with -lkyconf.

Detailed Description

接口的主要功能是销毁指定的配置文件句柄

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_reload(), kdk_conf_get_value(), kdk_conf_list_key(), kdk_conf_list_group() and kdk_config_freeall().

Author

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

From libkysdk-base 3.0.1.1-3 in Arch Linux 2026-11-07. Parsed by carta from the page's man source.