--- /dev/null
+lib_LTLIBRARIES = libatom.la
+libatom_la_SOURCES = atom.c
+libatom_la_CFLAGS = $(XML_CFLAGS)
+libatom_la_LIBADD = $(XML_LIBS)
--- /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 <glib.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+
+#define ATOM_NAMESPACE "http://www.w3.org/2005/Atom"
+
+struct _atom_entry
+{
+ xmlDocPtr doc;
+};
+
+AtomEntry *
+atom_entry_new_with_prefix (char *prefix)
+{
+ AtomEntry *entry;
+ xmlDocPtr doc;
+ xmlNsPtr ns;
+ xmlNodePtr node;
+ doc = xmlNewDoc ("1.0");
+ node = xmlNewNode (ns, "entry");
+ xmlNewNs (node, ATOM_NAMESPACE, prefix);
+ xmlDocSetRootElement (doc, node);
+ entry = g_slice_new (AtomEntry);
+ entry->doc = doc;
+ return entry;
+}
+
+AtomEntry *
+atom_entry_new (void)
+{
+ return atom_entry_new_with_prefix (NULL);
+}
+
+AtomEntry *
+atom_entry_new_data_len (char *data, size_t len)
+{
+ AtomEntry *entry;
+ entry = g_slice_new (AtomEntry);
+ entry->doc = xmlParseMemory (data, len);
+ return entry;
+}
+
+void
+atom_entry_delete (AtomEntry *entry)
+{
+ if (entry->doc)
+ xmlFreeDoc (entry->doc);
+ g_slice_free (AtomEntry entry);
+}
+
+char *
+atom_entry_string (AtomEntry *entry)
+{
+ char *buffer;
+ int size;
+ xmlDocDumpMemory (entry->doc, &buffer, &size);
+ return buffer;
+}
+
+size_t
+atom_entry_len (AtomEntry *entry)
+{
+ char *buffer;
+ int size;
+ xmlDocDumpMemory (entry->doc, &buffer, &size);
+ xmlFree (buffer);
+ return size;
+}
+++ /dev/null
-lib_LTLIBRARIES = libatom.la
-libatom_la_SOURCES = atom.c
-libatom_la_CFLAGS = $(XML_CFLAGS)
-libatom_la_LIBADD = $(XML_LIBS)
+++ /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 <glib.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-
-#define ATOM_NAMESPACE "http://www.w3.org/2005/Atom"
-
-struct _atom_entry
-{
- xmlDocPtr doc;
-};
-
-AtomEntry *
-atom_entry_new_with_prefix (char *prefix)
-{
- AtomEntry *entry;
- xmlDocPtr doc;
- xmlNsPtr ns;
- xmlNodePtr node;
- doc = xmlNewDoc ("1.0");
- node = xmlNewNode (ns, "entry");
- xmlNewNs (node, ATOM_NAMESPACE, prefix);
- xmlDocSetRootElement (doc, node);
- entry = g_slice_new (AtomEntry);
- entry->doc = doc;
- return entry;
-}
-
-AtomEntry *
-atom_entry_new (void)
-{
- return atom_entry_new_with_prefix (NULL);
-}
-
-AtomEntry *
-atom_entry_new_data_len (char *data, size_t len)
-{
- AtomEntry *entry;
- entry = g_slice_new (AtomEntry);
- entry->doc = xmlParseMemory (data, len);
- return entry;
-}
-
-void
-atom_entry_delete (AtomEntry *entry)
-{
- if (entry->doc)
- xmlFreeDoc (entry->doc);
- g_slice_free (AtomEntry entry);
-}
-
-char *
-atom_entry_string (AtomEntry *entry)
-{
- char *buffer;
- int size;
- xmlDocDumpMemory (entry->doc, &buffer, &size);
- return buffer;
-}
-
-size_t
-atom_entry_len (AtomEntry *entry)
-{
- char *buffer;
- int size;
- xmlDocDumpMemory (entry->doc, &buffer, &size);
- xmlFree (buffer);
- return size;
-}