X-Git-Url: https://git.wpitchoune.net/gitweb/?p=ppastats.git;a=blobdiff_plain;f=src%2Flp.c;h=bd9ba5d95fd1aa11162e51e2e975ba8eeb4145f0;hp=9ba2eec7c50f401c440228afb9b995646c3d398f;hb=a9435991d03d0bd9e81d6cb6003013bec4b2e6e9;hpb=48adae7cac47f09a5ac0ce7c3b53359b340a1110 diff --git a/src/lp.c b/src/lp.c index 9ba2eec..bd9ba5d 100644 --- a/src/lp.c +++ b/src/lp.c @@ -21,6 +21,7 @@ #include #include +#include "list.h" #include "lp.h" struct distro_series *distro_series_new(const char *name, @@ -169,3 +170,30 @@ void daily_download_total_list_free(struct daily_download_total **list) } } +struct bpph **bpph_list_add(struct bpph **list, struct bpph *new) +{ + struct bpph **cur, *bpph; + + if (list) + for (cur = list; *cur; cur++) { + bpph = *cur; + + if (!strcmp(bpph->self_link, new->self_link)) + return list; + } + + return (struct bpph **)list_add((void **)list, new); +} + +struct bpph **bpph_list_append_list(struct bpph **list1, struct bpph **list2) +{ + struct bpph **cur; + + if (!list2) + return list1; + + for (cur = list2; *cur; cur++) + list1 = bpph_list_add(list1, *cur); + + return list1; +}