libdom
Loading...
Searching...
No Matches
document_type.c File Reference
#include <assert.h>
#include <stdlib.h>
#include "core/string.h"
#include "core/document_type.h"
#include "core/namednodemap.h"
#include "core/node.h"
#include "utils/utils.h"
#include "utils/namespace.h"

Classes

struct  dom_document_type
 

Functions

dom_exception _dom_document_type_create (dom_string *qname, dom_string *public_id, dom_string *system_id, dom_document_type **doctype)
 
void _dom_document_type_destroy (dom_node_internal *doctypenode)
 
dom_exception _dom_document_type_initialise (dom_document_type *doctype, dom_string *qname, dom_string *public_id, dom_string *system_id)
 
void _dom_document_type_finalise (dom_document_type *doctype)
 
dom_exception _dom_document_type_get_name (dom_document_type *doc_type, dom_string **result)
 
dom_exception _dom_document_type_get_entities (dom_document_type *doc_type, dom_namednodemap **result)
 
dom_exception _dom_document_type_get_notations (dom_document_type *doc_type, dom_namednodemap **result)
 
dom_exception _dom_document_type_get_public_id (dom_document_type *doc_type, dom_string **result)
 
dom_exception _dom_document_type_get_system_id (dom_document_type *doc_type, dom_string **result)
 
dom_exception _dom_document_type_get_internal_subset (dom_document_type *doc_type, dom_string **result)
 
dom_exception _dom_document_type_get_text_content (dom_node_internal *node, dom_string **result)
 
dom_exception _dom_document_type_set_text_content (dom_node_internal *node, dom_string *content)
 
void _dom_dt_destroy (dom_node_internal *node)
 
dom_exception _dom_dt_copy (dom_node_internal *old, dom_node_internal **copy)
 

Function Documentation

◆ _dom_document_type_create()

dom_exception _dom_document_type_create ( dom_string * qname,
dom_string * public_id,
dom_string * system_id,
dom_document_type ** doctype )

Create a document type node

Parameters
qnameThe qualified name of the document type
public_idThe external subset public identifier
system_idThe external subset system identifier
allocMemory (de)allocation function
pwPointer to client-specific private data
doctypePointer to location to receive result
Returns
DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion.

The doctype will be referenced, so the client need not do so explicitly. The client must unref the doctype once it has finished with it.

◆ _dom_document_type_destroy()

void _dom_document_type_destroy ( dom_node_internal * doctypenode)

Destroy a DocumentType node

Parameters
doctypeThe DocumentType node to destroy

The contents of ::doctype will be destroyed and ::doctype will be freed.

◆ _dom_document_type_finalise()

void _dom_document_type_finalise ( dom_document_type * doctype)

◆ _dom_document_type_get_entities()

dom_exception _dom_document_type_get_entities ( dom_document_type * doc_type,
dom_namednodemap ** result )

Retrieve a document type's entities

Parameters
doc_typeDocument type to retrieve entities from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

The returned map will have its reference count increased. It is the responsibility of the caller to unref the map 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_document_type_get_internal_subset()

dom_exception _dom_document_type_get_internal_subset ( dom_document_type * doc_type,
dom_string ** result )

Retrieve a document type's internal subset

Parameters
doc_typeDocument type to retrieve internal subset from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

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_document_type_get_name()

dom_exception _dom_document_type_get_name ( dom_document_type * doc_type,
dom_string ** result )

Retrieve a document type's name

Parameters
doc_typeDocument type to retrieve name from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

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_document_type_get_notations()

dom_exception _dom_document_type_get_notations ( dom_document_type * doc_type,
dom_namednodemap ** result )

Retrieve a document type's notations

Parameters
doc_typeDocument type to retrieve notations from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

The returned map will have its reference count increased. It is the responsibility of the caller to unref the map 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_document_type_get_public_id()

dom_exception _dom_document_type_get_public_id ( dom_document_type * doc_type,
dom_string ** result )

Retrieve a document type's public id

Parameters
doc_typeDocument type to retrieve public id from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

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.

◆ _dom_document_type_get_system_id()

dom_exception _dom_document_type_get_system_id ( dom_document_type * doc_type,
dom_string ** result )

Retrieve a document type's system id

Parameters
doc_typeDocument type to retrieve system id from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

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.

◆ _dom_document_type_get_text_content()

dom_exception _dom_document_type_get_text_content ( dom_node_internal * node,
dom_string ** result )

◆ _dom_document_type_initialise()

dom_exception _dom_document_type_initialise ( dom_document_type * doctype,
dom_string * qname,
dom_string * public_id,
dom_string * system_id )

◆ _dom_document_type_set_text_content()

dom_exception _dom_document_type_set_text_content ( dom_node_internal * node,
dom_string * content )

◆ _dom_dt_copy()

dom_exception _dom_dt_copy ( dom_node_internal * old,
dom_node_internal ** copy )

◆ _dom_dt_destroy()

void _dom_dt_destroy ( dom_node_internal * node)