From ab50864a758a7c3d26d5423521743c5753a6cffe Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 11 Jan 2016 09:29:22 -0500 Subject: add alpm_list_append alpm_list_add always returns the provided list making it impossible for callers to check whether or not the operation actually succeeded without manually comparing the list length before and after. alpm_list_append instead returns a pointer to the newly created list item so that success can be checked. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/alpm_list.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libalpm/alpm_list.h') diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h index 801f4a07..5af84e1a 100644 --- a/lib/libalpm/alpm_list.h +++ b/lib/libalpm/alpm_list.h @@ -57,6 +57,7 @@ void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn); /* item mutators */ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data); +alpm_list_t *alpm_list_append(alpm_list_t **list, void *data); alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn); alpm_list_t *alpm_list_join(alpm_list_t *first, alpm_list_t *second); alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn); -- cgit v1.2.3-24-g4f1b