Finally, an atom:entry gets its atom:content.
GPtrArray *authors;
GPtrArray *categories;
char *summary;
GPtrArray *authors;
GPtrArray *categories;
char *summary;
};
static void atom_entry_updated_set_from_iso8601 (AtomEntry *, char *);
};
static void atom_entry_updated_set_from_iso8601 (AtomEntry *, char *);
entry->categories = NULL;
atom_entry_author_add (entry, author);
entry->summary = NULL;
entry->categories = NULL;
atom_entry_author_add (entry, author);
entry->summary = NULL;
atom_entry_author_add (entry, atom_person_new_from_xmlnode (child));
else if (!xmlStrcmp (child->name, "category"))
atom_entry_category_add (entry, atom_category_new_from_xmlnode (child));
atom_entry_author_add (entry, atom_person_new_from_xmlnode (child));
else if (!xmlStrcmp (child->name, "category"))
atom_entry_category_add (entry, atom_category_new_from_xmlnode (child));
+ else if (!xmlStrcmp (child->name, "content"))
+ entry->content = atom_content_new_from_xmlnode (child);
else
xmlFree (content);
}
else
xmlFree (content);
}
entry->summary = g_strdup (summary);
}
entry->summary = g_strdup (summary);
}
+AtomContent *
+atom_entry_content (AtomEntry *entry)
+{
+ return entry->content;
+}
+
+void
+atom_entry_content_set (AtomEntry *entry, AtomContent *content)
+{
+ if (entry->content)
+ atom_content_delete (entry->content);
+ entry->content = content;
+}
+
static void
atom_entry_update_xmlnode (AtomEntry *entry)
{
static void
atom_entry_update_xmlnode (AtomEntry *entry)
{
!xmlStrcmp (child->name, "updated") ||
!xmlStrcmp (child->name, "summary") ||
!xmlStrcmp (child->name, "author") ||
!xmlStrcmp (child->name, "updated") ||
!xmlStrcmp (child->name, "summary") ||
!xmlStrcmp (child->name, "author") ||
- !xmlStrcmp (child->name, "category"))
+ !xmlStrcmp (child->name, "category") ||
+ !xmlStrcmp (child->name, "content"))
{
xmlUnlinkNode (child);
xmlFreeNode (child);
{
xmlUnlinkNode (child);
xmlFreeNode (child);
cat = atom_category_to_xmlnode (category, "category");
xmlAddChild (root, cat);
}
cat = atom_category_to_xmlnode (category, "category");
xmlAddChild (root, cat);
}
+ if (entry->content)
+ xmlAddChild (root, atom_content_to_xmlnode (entry->content));
#include <atompub/person.h>
#include <atompub/category.h>
#include <atompub/id.h>
#include <atompub/person.h>
#include <atompub/category.h>
#include <atompub/id.h>
+#include <atompub/content.h>
typedef struct _atom_entry AtomEntry;
typedef struct _atom_entry AtomEntry;
void atom_entry_category_add (AtomEntry *, AtomCategory *);
char * atom_entry_summary (AtomEntry *);
void atom_entry_summary_set (AtomEntry *, char *);
void atom_entry_category_add (AtomEntry *, AtomCategory *);
char * atom_entry_summary (AtomEntry *);
void atom_entry_summary_set (AtomEntry *, char *);
+AtomContent *atom_entry_content (AtomEntry *);
+void atom_entry_content_set (AtomEntry *, AtomContent *);
void atom_entry_string (AtomEntry *, char **, size_t *);
#endif
void atom_entry_string (AtomEntry *, char **, size_t *);
#endif