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
27 struct distro_series *distro_series_new(const char *name,
30 const char *displayname)
32 struct distro_series *d;
34 d = malloc(sizeof(struct distro_series));
36 d->name = strdup(name);
37 d->version = strdup(version);
38 d->title = strdup(title);
39 d->displayname = strdup(displayname);
44 void distro_series_free(struct distro_series *d)
57 binary_package_publishing_history_free \
58 (struct binary_package_publishing_history *b)
61 free(b->binary_package_name);
62 free(b->binary_package_version);
63 free(b->distro_arch_series_link);
69 struct binary_package_publishing_history *
70 binary_package_publishing_history_new(const char *binary_package_name,
71 const char *binary_package_version,
72 const char *distro_arch_series_link,
73 const char *self_link)
75 struct binary_package_publishing_history *b;
77 b = malloc(sizeof(struct binary_package_publishing_history));
79 b->binary_package_name = strdup(binary_package_name);
80 b->binary_package_version = strdup(binary_package_version);
81 b->distro_arch_series_link = strdup(distro_arch_series_link);
82 b->self_link = strdup(self_link);
88 binary_package_publishing_history_list_free\
89 (struct binary_package_publishing_history **list)
91 struct binary_package_publishing_history **l_cur = list;
94 binary_package_publishing_history_free(*l_cur);
101 char *get_archive_url(const char *owner, const char *ppa)
103 char *url = malloc(strlen(URL_BASE_LP)
106 +strlen("/+archive/")
110 strcpy(url, URL_BASE_LP);
113 strcat(url, "/+archive/");
119 struct distro_arch_series *distro_arch_series_new(const char *display_name,
121 const char *architecture_tag,
122 int is_nominated_arch_indep,
123 const char *distroseries_link)
125 struct distro_arch_series *d;
127 d = malloc(sizeof(struct distro_arch_series));
129 d->display_name = strdup(display_name);
130 d->title = strdup(title);
131 d->architecture_tag = strdup(architecture_tag);
132 d->is_nominated_arch_indep = is_nominated_arch_indep;
133 d->distroseries_link = strdup(distroseries_link);
138 void distro_arch_series_free(struct distro_arch_series *d)
140 free(d->display_name);
142 free(d->architecture_tag);
143 free(d->distroseries_link);
148 void distro_arch_series_list_free(struct distro_arch_series **list)
152 distro_arch_series_free(*list);
159 void daily_download_total_list_free(struct daily_download_total **list)
162 struct daily_download_total **cur = list;