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 binary_package_publishing_history_free(struct binary_package_publishing_history *b)
30 free(b->binary_package_name);
31 free(b->binary_package_version);
32 free(b->distro_arch_series_link);
38 struct binary_package_publishing_history *
39 binary_package_publishing_history_new(const char *binary_package_name,
40 const char *binary_package_version,
41 const char *distro_arch_series_link,
42 const char *self_link)
44 struct binary_package_publishing_history *b;
46 b = malloc(sizeof(struct binary_package_publishing_history));
48 b->binary_package_name = strdup(binary_package_name);
49 b->binary_package_version = strdup(binary_package_version);
50 b->distro_arch_series_link = strdup(distro_arch_series_link);
51 b->self_link = strdup(self_link);
57 binary_package_publishing_history_list_free(struct binary_package_publishing_history **list)
59 struct binary_package_publishing_history **l_cur = list;
62 binary_package_publishing_history_free(*l_cur);
69 char *get_archive_url(const char *owner, const char *ppa)
71 char *url = malloc(strlen(URL_BASE_LP)
78 strcpy(url, URL_BASE_LP);
81 strcat(url, "/+archive/");
87 struct distro_arch_series *distro_arch_series_new(const char *display_name,
89 const char *architecture_tag)
91 struct distro_arch_series *d;
93 d = malloc(sizeof(struct distro_arch_series));
95 d->display_name = strdup(display_name);
96 d->title = strdup(title);
97 d->architecture_tag = strdup(architecture_tag);
102 void distro_arch_series_free(struct distro_arch_series *d)
104 free(d->display_name);
106 free(d->architecture_tag);
110 void distro_arch_series_list_free(struct distro_arch_series **list)
114 distro_arch_series_free(*list);
121 void daily_download_total_list_free(struct daily_download_total **list)
124 struct daily_download_total **cur = list;
135 int list_length(void **list)