--- /dev/null
+/*
+ * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.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.
+ */
+
+
+#include <atompub/atom.h>
+#include <atompub/atom-xml.h>
+
+#include <glib.h>
+#include <libxml/tree.h>
+
+struct _atom_feed
+{
+ GList *entries;
+};
+
+AtomFeed *
+atom_feed_new (void)
+{
+ AtomFeed *feed;
+ feed = g_slice_new (AtomFeed);
+ feed->entries = NULL;
+ return feed;
+}
+
+void
+atom_feed_delete (AtomFeed *feed)
+{
+ GList *l;
+ for (l = g_list_first (feed->entries); l != NULL; l = l->next)
+ {
+ atom_entry_delete (l->data);
+ }
+ g_slice_free (AtomFeed, feed);
+}
+
+void
+atom_feed_entry_append (AtomFeed *feed, AtomEntry *entry)
+{
+ feed->entries = g_list_prepend (feed->entries, entry);
+}
+
+void
+atom_feed_entry_append_array (AtomFeed *feed, AtomEntry **entries, size_t len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ feed->entries = g_list_prepend (feed->entries, entries[i]);
+ }
+}
+
+xmlNodePtr
+atom_feed_to_xmlnode (AtomFeed *feed)
+{
+ xmlNodePtr node;
+ xmlNodePtr entry;
+ GList *l;
+ node = xmlNewNode (NULL, "feed");
+ for (l = g_list_last (feed->entries); l != NULL; l = l->prev)
+ {
+ entry = atom_entry_to_xmlnode (l->data);
+ xmlAddChild (node, entry);
+ }
+ return node;
+}
--- /dev/null
+/*
+ * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.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.
+ */
+
+
+#ifndef ATOM_FEED_XML_H
+#define ATOM_FEED_XML_H
+
+#include <atompub/feed.h>
+
+#include <libxml/tree.h>
+
+xmlNodePtr atom_feed_to_xmlnode (AtomFeed *);
+
+#endif
#define ATOMPUB_FEED_H
#include <atompub/ctx.h>
+#include <atompub/entry.h>
typedef struct _atom_feed AtomFeed;
+AtomFeed * atom_feed_new (void);
+void atom_feed_delete (AtomFeed *);
+void atom_feed_entry_append (AtomFeed *, AtomEntry *);
+void atom_feed_entry_append_array (AtomFeed *, AtomEntry **, size_t);
+
#endif