From 72d3713cc7865af5f4d91410ad56ed4287be6109 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 12 Jul 2012 15:29:59 -0500 Subject: Move filelist functions into separate source file We have a few of these and might as well gather them together. This also cleans up the code a bit by using an enum instead of integer values, as well as makes a "search for file in filelist" function public so frontends can do better than straight linear search of the filelists. Signed-off-by: Dan McGee --- lib/libalpm/alpm.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index dd01a416..1d6a8c6c 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -871,7 +871,7 @@ alpm_filelist_t *alpm_pkg_get_files(alpm_pkg_t *pkg); * "\t", where the given md5sum is that of * the file as provided by the package. * @param pkg a pointer to package - * @return a reference to an internal list of strings. + * @return a reference to a list of alpm_backup_t objects */ alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg); @@ -949,6 +949,20 @@ int alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason); /* End of alpm_pkg */ /** @} */ +/* + * Filelists + */ + +/** Determines whether a package filelist contains a given path. + * The provided path should be relative to the install root with no leading + * slashes, e.g. "etc/localtime". When searching for directories, the path must + * have a trailing slash. + * @param filelist a pointer to a package filelist + * @param path the path to search for in the package + * @return a pointer to the matching file or NULL if not found + */ +alpm_file_t *alpm_filelist_contains(alpm_filelist_t *filelist, const char *path); + /* * Signatures */ -- cgit v1.2.3-24-g4f1b