From: Jean-Philippe Orsini Date: Tue, 6 Sep 2011 20:53:27 +0000 (+0000) Subject: renamed list_add_list to list_append_list X-Git-Tag: v1.3.0~133 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ppastats.git;a=commitdiff_plain;h=4f673b9c3df300c81d8bf73635688dbc249c7a53 renamed list_add_list to list_append_list added doc --- diff --git a/src/list.c b/src/list.c index 20e1858..4157dee 100644 --- a/src/list.c +++ b/src/list.c @@ -58,7 +58,7 @@ void **list_add(void **list, void *new_item) return new_list; } -void **list_add_list(void **list1, void **list2) +void **list_append_list(void **list1, void **list2) { int n1, n2, n; void **list; diff --git a/src/list.h b/src/list.h index 69b7b25..1b66014 100644 --- a/src/list.h +++ b/src/list.h @@ -20,8 +20,26 @@ #ifndef _PPASTATS_LIST_H_ #define _PPASTATS_LIST_H_ +/* + * Convenience functions for manipulating null-terminated list of + * pointers. + */ + +/* Returns the number of items in the list. */ int list_length(void **list); + +/* + * Adds item into a list. + * + * Returns a new allocated list contains all items. + */ void **list_add(void **list, void *new_item); -void **list_add_list(void **list1, void **list2); + +/* + * Appends all items of two lists. + * + * Returns a new allocated list containing all items. + */ +void **list_append_list(void **list1, void **list2); #endif diff --git a/src/lp_ws.c b/src/lp_ws.c index d6f4087..4b51be8 100644 --- a/src/lp_ws.c +++ b/src/lp_ws.c @@ -149,8 +149,8 @@ get_binary_package_publishing_history_list(const char *archive_url, if (!o) break; - result = list_add_list(result, - (void **)json_object_to_bpph_list(o)); + result = list_append_list(result, + (void **)json_object_to_bpph_list(o)); o_next = json_object_object_get(o, "next_collection_link");