summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2012-11-03 22:29:21 (GMT)
committer John-Mark Bell <jmb@netsurf-browser.org>2012-11-03 22:29:21 (GMT)
commit411acd732203e2aff077fff73d5e920983cfe70b (patch)
tree5d638b848523b65fae1eaa5cf5bcc66fc6c96684
parentcfb2721a875a547963aad5ea41bd064b50b2eb0d (diff)
downloadlibdom-411acd732203e2aff077fff73d5e920983cfe70b.tar.gz
libdom-411acd732203e2aff077fff73d5e920983cfe70b.tar.bz2
Implement dom_document_type_get_(public|system)id.
-rw-r--r--src/core/document_type.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/core/document_type.c b/src/core/document_type.c
index a01abce..d7b1b99 100644
--- a/src/core/document_type.c
+++ b/src/core/document_type.c
@@ -243,18 +243,17 @@ dom_exception _dom_document_type_get_notations(
* The returned string will have its reference count increased. It is
* the responsibility of the caller to unref the string once it has
* finished with it.
- *
- * We don't support this API now, so this function call should always
- * return DOM_NOT_SUPPORTED_ERR.
*/
dom_exception _dom_document_type_get_public_id(
dom_document_type *doc_type,
dom_string **result)
{
- UNUSED(doc_type);
- UNUSED(result);
-
- return DOM_NOT_SUPPORTED_ERR;
+ if (doc_type->public_id != NULL)
+ *result = dom_string_ref(doc_type->public_id);
+ else
+ *result = NULL;
+
+ return DOM_NO_ERR;
}
/**
@@ -267,18 +266,17 @@ dom_exception _dom_document_type_get_public_id(
* The returned string will have its reference count increased. It is
* the responsibility of the caller to unref the string once it has
* finished with it.
- *
- * We don't support this API now, so this function call should always
- * return DOM_NOT_SUPPORTED_ERR.
*/
dom_exception _dom_document_type_get_system_id(
dom_document_type *doc_type,
dom_string **result)
{
- UNUSED(doc_type);
- UNUSED(result);
-
- return DOM_NOT_SUPPORTED_ERR;
+ if (doc_type->system_id != NULL)
+ *result = dom_string_ref(doc_type->system_id);
+ else
+ *result = NULL;
+
+ return DOM_NO_ERR;
}
/**