Create a xml node from an AtomEntry
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 9 Aug 2008 21:51:35 +0000 (18:51 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 9 Aug 2008 21:51:35 +0000 (18:51 -0300)
atom/entry.c
include/atompub/atom-xml.h
include/atompub/entry-xml.h [new file with mode: 0644]

index ed59683..8df08d9 100644 (file)
@@ -162,3 +162,11 @@ atom_entry_string (AtomEntry *entry, char **buffer, size_t *len)
 {
   xmlDocDumpMemory (entry->doc, buffer, len);
 }
+
+xmlNodePtr
+atom_entry_to_xmlnode (AtomEntry *entry)
+{
+  if (entry->doc)
+    return xmlDocGetRootElement (entry->doc);
+  return NULL;
+}
index 60fe48e..5f09100 100644 (file)
@@ -21,5 +21,6 @@
 #define ATOMPUB_ATOM_XML_H
 
 #include <atompub/person-xml.h>
+#include <atompub/entry-xml.h>
 
 #endif
diff --git a/include/atompub/entry-xml.h b/include/atompub/entry-xml.h
new file mode 100644 (file)
index 0000000..8c657f2
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  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_ENTRY_XML_H
+#define ATOM_ENTRY_XML_H
+
+#include <atompub/entry.h>
+
+#include <libxml/tree.h>
+
+xmlNodePtr atom_entry_to_xmlnode (AtomEntry *);
+
+#endif