summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/filelist.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2016-12-09 17:14:06 +0100
committerAllan McRae <allan@archlinux.org>2017-01-04 04:59:15 +0100
commit6444ccbaf0c2ff566217eb32e32397868088812f (patch)
tree9405b1b579cab92b67a45a2399d6746cd948e8e8 /lib/libalpm/filelist.c
parent585bd89803a37380f51d625115b58db4012f4df3 (diff)
downloadpacman-6444ccbaf0c2ff566217eb32e32397868088812f.tar.gz
pacman-6444ccbaf0c2ff566217eb32e32397868088812f.tar.xz
add _alpm_filelist_sort
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/filelist.c')
-rw-r--r--lib/libalpm/filelist.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c
index e360b1e9..46fb4b8d 100644
--- a/lib/libalpm/filelist.c
+++ b/lib/libalpm/filelist.c
@@ -111,7 +111,7 @@ alpm_list_t *_alpm_filelist_intersection(alpm_filelist_t *filesA,
/* Helper function for comparing files list entries
*/
-int _alpm_files_cmp(const void *f1, const void *f2)
+static int _alpm_files_cmp(const void *f1, const void *f2)
{
const alpm_file_t *file1 = f1;
const alpm_file_t *file2 = f2;
@@ -133,4 +133,10 @@ alpm_file_t SYMEXPORT *alpm_filelist_contains(alpm_filelist_t *filelist,
sizeof(alpm_file_t), _alpm_files_cmp);
}
+void _alpm_filelist_sort(alpm_filelist_t *filelist)
+{
+ qsort(filelist->files, filelist->count,
+ sizeof(alpm_file_t), _alpm_files_cmp);
+}
+
/* vim: set noet: */