Moving atom entry implementation to merge it with atompub
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 9 Aug 2008 07:54:31 +0000 (04:54 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 9 Aug 2008 07:54:31 +0000 (04:54 -0300)
atom/Makefile.am [new file with mode: 0644]
atom/entry.c [new file with mode: 0644]
src/Makefile.am [deleted file]
src/atom.c [deleted file]

diff --git a/atom/Makefile.am b/atom/Makefile.am
new file mode 100644 (file)
index 0000000..6822b1e
--- /dev/null
@@ -0,0 +1,4 @@
+lib_LTLIBRARIES = libatom.la
+libatom_la_SOURCES = atom.c
+libatom_la_CFLAGS = $(XML_CFLAGS)
+libatom_la_LIBADD = $(XML_LIBS)
diff --git a/atom/entry.c b/atom/entry.c
new file mode 100644 (file)
index 0000000..e458ce9
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ *  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;
+}
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644 (file)
index 6822b1e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-lib_LTLIBRARIES = libatom.la
-libatom_la_SOURCES = atom.c
-libatom_la_CFLAGS = $(XML_CFLAGS)
-libatom_la_LIBADD = $(XML_LIBS)
diff --git a/src/atom.c b/src/atom.c
deleted file mode 100644 (file)
index e458ce9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *  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;
-}