From 734558caf72f4d071d6631d139b365e5fd0d7301 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 9 Aug 2008 18:51:35 -0300 Subject: [PATCH] Create a xml node from an AtomEntry --- atom/entry.c | 8 ++++++++ include/atompub/atom-xml.h | 1 + include/atompub/entry-xml.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 include/atompub/entry-xml.h diff --git a/atom/entry.c b/atom/entry.c index ed59683..8df08d9 100644 --- a/atom/entry.c +++ b/atom/entry.c @@ -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; +} diff --git a/include/atompub/atom-xml.h b/include/atompub/atom-xml.h index 60fe48e..5f09100 100644 --- a/include/atompub/atom-xml.h +++ b/include/atompub/atom-xml.h @@ -21,5 +21,6 @@ #define ATOMPUB_ATOM_XML_H #include +#include #endif diff --git a/include/atompub/entry-xml.h b/include/atompub/entry-xml.h new file mode 100644 index 0000000..8c657f2 --- /dev/null +++ b/include/atompub/entry-xml.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 Thadeu Lima de Souza Cascardo + * + * 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 + +#include + +xmlNodePtr atom_entry_to_xmlnode (AtomEntry *); + +#endif -- 2.20.1