diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-05 10:32:49 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-05 10:32:49 +0000 |
commit | 640921c2c92bc5aa57d9960f1dbc17bb633a4d89 (patch) | |
tree | 60a17b8f631240ad6d7f86c439cd94af7c16351c | |
parent | 5a2770d01f9f59d9995bdc529ecf905202461f91 (diff) | |
download | libdom-640921c2c92bc5aa57d9960f1dbc17bb633a4d89.tar.gz libdom-640921c2c92bc5aa57d9960f1dbc17bb633a4d89.tar.bz2 |
Implement trivial accessors
svn path=/trunk/libdom/; revision=13422
-rw-r--r-- | src/html/html_document.c | 42 |
1 files changed, 36 insertions, 6 deletions
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, |