From 411acd732203e2aff077fff73d5e920983cfe70b Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sat, 3 Nov 2012 22:29:21 +0000 Subject: Implement dom_document_type_get_(public|system)id. --- src/core/document_type.c | 26 ++++++++++++-------------- 1 file 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; } /** -- cgit v1.2.3