From 7340fb9b2e070ac90f07466212f4cc9248b0db4a Mon Sep 17 00:00:00 2001 From: morganamilo Date: Sun, 9 Jan 2022 16:58:55 +0000 Subject: [PATCH] libalpm: mark filelist_contains as taking a const filelist This is useful for bindings as it guarantees the value will not be changed. Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 2 +- lib/libalpm/filelist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 2a9200b5..6b66fa09 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -156,7 +156,7 @@ typedef struct _alpm_backup_t { * @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); +alpm_file_t *alpm_filelist_contains(const alpm_filelist_t *filelist, const char *path); /* End of libalpm_files */ /** @} */ diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c index cef6b0d3..bfccc97d 100644 --- a/lib/libalpm/filelist.c +++ b/lib/libalpm/filelist.c @@ -118,7 +118,7 @@ static int _alpm_files_cmp(const void *f1, const void *f2) return strcmp(file1->name, file2->name); } -alpm_file_t SYMEXPORT *alpm_filelist_contains(alpm_filelist_t *filelist, +alpm_file_t SYMEXPORT *alpm_filelist_contains(const alpm_filelist_t *filelist, const char *path) { alpm_file_t key;