From d0e5cd2c7faef6159ab353714fa5227739994b2f Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 12 Aug 2012 16:28:42 +1000 Subject: Add "Optional for" to package information output Much like packages that require a give package are displayed in the "Required by" field of its information output, alos display packages that optionally require the package. Inspired-by: Benedikt Morbach Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index bf726fc2..8d6edb81 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -712,6 +712,14 @@ int alpm_pkg_vercmp(const char *a, const char *b); */ alpm_list_t *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg); +/** Computes the list of packages optionally requiring a given package. + * The return value of this function is a newly allocated + * list of package names (char*), it should be freed by the caller. + * @param pkg a package + * @return the list of packages optionally requiring pkg + */ +alpm_list_t *alpm_pkg_compute_optionalfor(alpm_pkg_t *pkg); + /** @name Package Property Accessors * Any pointer returned by these functions points to internal structures * allocated by libalpm. They should not be freed nor modified in any -- cgit v1.2.3-24-g4f1b