2 * Copyright (C) 2011-2014 jeanfi@gmail.com
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef _PPASTATS_LP_H_
21 #define _PPASTATS_LP_H_
23 #define URL_BASE_LP "https://api.launchpad.net/1.0"
27 struct daily_download_total {
33 /* (b)inary (p)ackage (p)ublishing (h)istory */
35 char *binary_package_name;
36 char *binary_package_version;
37 char *distro_arch_series_link;
40 int architecture_specific;
45 struct distro_arch_series {
48 char *architecture_tag;
49 int is_nominated_arch_indep;
50 char *distroseries_link;
53 struct distro_series {
60 struct distro_series *distro_series_new(const char *name,
63 const char *displayname);
65 void distro_series_free(struct distro_series *distro_series);
67 void daily_download_total_list_free(struct daily_download_total **);
69 struct distro_arch_series *
70 distro_arch_series_new(const char *display_name,
72 const char *architecture_tag,
73 int is_nominated_arch_indep,
74 const char *distroseries_link);
76 void distro_arch_series_free(struct distro_arch_series *);
78 void bpph_free(struct bpph *b);
80 struct bpph *bpph_new(const char *binary_package_name,
81 const char *binary_package_version,
82 const char *distro_arch_series_link,
83 const char *self_link,
85 int architecture_specific,
88 void bpph_list_free(struct bpph **list);
90 struct bpph **bpph_list_append_list(struct bpph **list1, struct bpph **list2);
92 char *get_archive_url(const char *owner, const char *ppa);
94 char *time_to_str(time_t t);
96 time_t ddts_get_last_date(struct daily_download_total **);
98 struct daily_download_total **
99 ddts_merge(struct daily_download_total **,
100 struct daily_download_total **);