2 Copyright (C) 2011 jeanfi@gmail.com
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU 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
26 struct distro_series *distro_series_new(const char *name,
29 const char *displayname)
31 struct distro_series *d;
33 d = malloc(sizeof(struct distro_series));
35 d->name = strdup(name);
36 d->version = strdup(version);
37 d->title = strdup(title);
38 d->displayname = strdup(displayname);
43 void distro_series_free(struct distro_series *d)
54 binary_package_publishing_history_free(struct binary_package_publishing_history *b)
57 free(b->binary_package_name);
58 free(b->binary_package_version);
59 free(b->distro_arch_series_link);
65 struct binary_package_publishing_history *
66 binary_package_publishing_history_new(const char *binary_package_name,
67 const char *binary_package_version,
68 const char *distro_arch_series_link,
69 const char *self_link)
71 struct binary_package_publishing_history *b;
73 b = malloc(sizeof(struct binary_package_publishing_history));
75 b->binary_package_name = strdup(binary_package_name);
76 b->binary_package_version = strdup(binary_package_version);
77 b->distro_arch_series_link = strdup(distro_arch_series_link);
78 b->self_link = strdup(self_link);
84 binary_package_publishing_history_list_free(struct binary_package_publishing_history **list)
86 struct binary_package_publishing_history **l_cur = list;
89 binary_package_publishing_history_free(*l_cur);
96 char *get_archive_url(const char *owner, const char *ppa)
98 char *url = malloc(strlen(URL_BASE_LP)
101 +strlen("/+archive/")
105 strcpy(url, URL_BASE_LP);
108 strcat(url, "/+archive/");
114 struct distro_arch_series *distro_arch_series_new(const char *display_name,
116 const char *architecture_tag,
117 int is_nominated_arch_indep,
118 const char *distroseries_link)
120 struct distro_arch_series *d;
122 d = malloc(sizeof(struct distro_arch_series));
124 d->display_name = strdup(display_name);
125 d->title = strdup(title);
126 d->architecture_tag = strdup(architecture_tag);
127 d->is_nominated_arch_indep = is_nominated_arch_indep;
128 d->distroseries_link = strdup(distroseries_link);
133 void distro_arch_series_free(struct distro_arch_series *d)
135 free(d->display_name);
137 free(d->architecture_tag);
138 free(d->distroseries_link);
143 void distro_arch_series_list_free(struct distro_arch_series **list)
147 distro_arch_series_free(*list);
154 void daily_download_total_list_free(struct daily_download_total **list)
157 struct daily_download_total **cur = list;
168 int list_length(void **list)