From 640921c2c92bc5aa57d9960f1dbc17bb633a4d89 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 5 Feb 2012 10:32:49 +0000 Subject: Implement trivial accessors svn path=/trunk/libdom/; revision=13422 --- src/html/html_document.c | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'src/html') diff --git a/src/html/html_document.c b/src/html/html_document.c index 446e68f..4cb26e6 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -94,20 +94,50 @@ void _dom_html_document_destroy(dom_html_document *doc) dom_exception dom_html_document_get_title(dom_html_document *doc, dom_string **title) { - UNUSED(doc); - UNUSED(title); + if (doc->title != NULL) { + *title = dom_string_ref(doc->title); + } else { + /** \todo Search for title element */ + } return DOM_NO_ERR; } dom_exception dom_html_document_set_title(dom_html_document *doc, - dom_string *title); + dom_string *title) +{ + if (doc->title != NULL) + dom_string_unref(doc->title); + + doc->title = dom_string_ref(title); + + return DOM_NO_ERR; +} + dom_exception dom_html_document_get_referer(dom_html_document *doc, - dom_string **referer); + dom_string **referer) +{ + *referer = dom_string_ref(doc->referer); + + return DOM_NO_ERR; +} + dom_exception dom_html_document_get_domain(dom_html_document *doc, - dom_string **domain); + dom_string **domain) +{ + *domain = dom_string_ref(doc->domain); + + return DOM_NO_ERR; +} + dom_exception dom_html_document_get_url(dom_html_document *doc, - dom_string **url); + dom_string **url) +{ + *url = dom_string_ref(doc->url); + + return DOM_NO_ERR; +} + dom_exception dom_html_document_get_body(dom_html_document *doc, struct dom_html_element **body); dom_exception dom_html_document_set_body(dom_html_document *doc, -- cgit v1.2.3