From 05e52ef7967d1fc7522e43194c9a3d1a6ff9438b Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 8 Nov 2022 14:19:35 +1000 Subject: [PATCH] Document alpm_pkg_xdata_t type and accessor Also more definitions to more relevant areas in alpm.h. Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 3304ae77..681489b4 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -113,6 +113,14 @@ typedef struct _alpm_db_t alpm_db_t; */ typedef struct _alpm_pkg_t alpm_pkg_t; +/** The extended data type used to store non-standard package data fields + * @ingroup libalpm_packages + */ +typedef struct _alpm_pkg_xdata_t { + char *name; + char *value; +} alpm_pkg_xdata_t; + /** The time type used by libalpm. Represents a unix time stamp * @ingroup libalpm_misc */ typedef int64_t alpm_time_t; @@ -2291,13 +2299,6 @@ typedef enum _alpm_pkgvalidation_t { ALPM_PKG_VALIDATION_SIGNATURE = (1 << 3) } alpm_pkgvalidation_t; -typedef struct _alpm_pkg_xdata_t { - char *name; - char *value; -} alpm_pkg_xdata_t; - -alpm_list_t *alpm_pkg_get_xdata(alpm_pkg_t *pkg); - /** Create a package from a file. * If full is false, the archive is read only until all necessary * metadata is found. If it is true, the entire archive is read, which @@ -2605,6 +2606,12 @@ int alpm_pkg_get_sig(alpm_pkg_t *pkg, unsigned char **sig, size_t *sig_len); */ int alpm_pkg_get_validation(alpm_pkg_t *pkg); +/** Gets the extended data field of a package. + * @param pkg a pointer to package + * @return a reference to a list of alpm_pkg_xdata_t objects + */ +alpm_list_t *alpm_pkg_get_xdata(alpm_pkg_t *pkg); + /** Returns whether the package has an install scriptlet. * @return 0 if FALSE, TRUE otherwise */