KDK_PACKAGE_GET_PACKAGELIST(3) Library Functions Manual NAME kdk_package_get_packagelist - SYNOPSIS #include extern kdk_package_list* kdk_package_get_packagelist(); Link with -lkypackage. Detailed Description The main function of the interface is to obtain a list of all packages in the system. RETURN VALUE On success, returns a pointer to a kdk_package_list structure containing gateway information. The kdk_package_list structure is defined in as follows: typedef struct { unsigned int nums; kdk_package_t **list; }kdk_package_list; typedef struct _kdk_package_t{ char *name; // char *version; // char *section; // char *status; // unsigned long size_kb; // struct _kdk_package_t **depends; // }kdk_package_t; On error, return NULL. EXAMPLES #include "libkypackages.h" #include 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("%lu0, package->size_kb); } int main() { kdk_package_list *list = kdk_package_get_packagelist(); printf("%u0, list->nums); for (size_t i = 0; i < list->nums; i ++) { print_package(list->list[i]); } kdk_package_free_packagelist(list); printf("Evolution%s0, kdk_package_is_installed("evolution", NULL) == 1 ? "" : ""); char *version = kdk_package_get_version("evolution"); printf("Evolution%s0, 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_free_packagelist(), kdk_package_get_version() and kdk_package_is_installed(). SEE ALSO kdk_package_free_packagelist(3), kdk_package_get_version(3) and kdk_package_is_installed(3). Linux Programmer's Manual Mon Sep 18 2023 KDK_PACKAGE_GET_PACKAGELIST(3)