KDK_PACKAGE_FREE_PACKAGELIST(3)

NAME
kdk_package_free_packagelist - 释放由kdk_package_get_packagelist返回的包信息结构体

SYNOPSIS
#include <libkynetinfo.h>

extern void kdk_package_free_packagelist(kdk_package_list *list);

Link with -lkynetinfo.

Detailed Description
The main function of the interface is to release the package information structure returned by the kdk_package_get_packagelist.

The argument list is the return value of the kdk_package_get_packagelist.

RETURN VALUE
No return value

EXAMPLES
    #include "libkypackages.h"
    #include <stdio.h>
    static void print_package(kdk_package_t *package)
    {
        printf("包名：%s	", package->name);
        printf("版本号：%s	", package->version);
        printf("包类型：%s	", package->section);
        printf("包状态：%s	", package->status);
        printf("包大小：%lu, package->size_kb);
    }
    int main()
    {
        kdk_package_list *list = kdk_package_get_packagelist();
        printf("系统中一共%u个软件包, list->nums);
        for (size_t i = 0; i < list->nums; i ++)
        {
            print_package(list->list[i]);
        }
        kdk_package_free_packagelist(list);
        printf("Evolution是否安装：%s, kdk_package_is_installed("evolution", NULL) == 1 ? "是" : "否");
        char *version = kdk_package_get_version("evolution");
        printf("Evolution版本号：%s, version);
        free(version);
        return 0;
    }

CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_package_get_packagelist(), kdk_package_get_version() and kdk_package_is_installed().

SEE ALSO
kdk_package_get_packagelist(3), kdk_package_get_version(3) and kdk_package_is_installed(3).