/*
- Copyright (C) 2011 jeanfi@gmail.com
+ * Copyright (C) 2011-2012 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+#include "lp.h"
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA
-*/
+struct distro_series *distro_series_new(const char *name,
+ const char *version,
+ const char *title,
+ const char *displayname)
+{
+ struct distro_series *d;
+ d = malloc(sizeof(struct distro_series));
-#include <stdlib.h>
-#include <string.h>
+ d->name = strdup(name);
+ d->version = strdup(version);
+ d->title = strdup(title);
+ d->displayname = strdup(displayname);
-#include "lp.h"
+ return d;
+}
+
+void distro_series_free(struct distro_series *d)
+{
+ if (d) {
+ free(d->name);
+ free(d->version);
+ free(d->title);
+ free(d->displayname);
+
+ free(d);
+ }
+}
void
-binary_package_publishing_history_free(struct binary_package_publishing_history *b)
+binary_package_publishing_history_free \
+(struct binary_package_publishing_history *b)
{
if (b) {
free(b->binary_package_name);
binary_package_publishing_history_new(const char *binary_package_name,
const char *binary_package_version,
const char *distro_arch_series_link,
- const char *self_link)
+ const char *self_link,
+ int architecture_specific)
{
struct binary_package_publishing_history *b;
b->binary_package_version = strdup(binary_package_version);
b->distro_arch_series_link = strdup(distro_arch_series_link);
b->self_link = strdup(self_link);
+ b->architecture_specific = architecture_specific;
return b;
}
void
-binary_package_publishing_history_list_free(struct binary_package_publishing_history **list)
+binary_package_publishing_history_list_free\
+(struct binary_package_publishing_history **list)
{
struct binary_package_publishing_history **l_cur = list;
struct distro_arch_series *distro_arch_series_new(const char *display_name,
const char *title,
- const char *architecture_tag)
+ const char *architecture_tag,
+ int is_nominated_arch_indep,
+ const char *distroseries_link)
{
struct distro_arch_series *d;
d->display_name = strdup(display_name);
d->title = strdup(title);
d->architecture_tag = strdup(architecture_tag);
+ d->is_nominated_arch_indep = is_nominated_arch_indep;
+ d->distroseries_link = strdup(distroseries_link);
return d;
}
free(d->display_name);
free(d->title);
free(d->architecture_tag);
+ free(d->distroseries_link);
free(d);
}
+
void distro_arch_series_list_free(struct distro_arch_series **list)
{
if (list) {
}
}
-int list_length(void **list)
-{
- int n;
-
- n = 0;
- while (*list) {
- list++;
- n++;
- }
-
- return n;
-}