summaryrefslogtreecommitdiff
path: root/include/dom/core/document_type.h
blob: 4f4841a6986627be2d961cf11e33d65f287b4fbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * This file is part of libdom.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
 * Copyright 2007 James Shaw <jshaw@netsurf-browser.org>
 */

#ifndef dom_core_document_type_h_
#define dom_core_document_type_h_

#include <dom/core/exceptions.h>
#include <dom/core/node.h>

struct dom_namednodemap;

typedef  struct dom_document_type dom_document_type;
/* The Dom DocumentType vtable */
typedef struct dom_document_type_vtable {
	struct dom_node_vtable base;

	dom_exception (*dom_document_type_get_name)(
			struct dom_document_type *doc_type, 
			dom_string **result);
	dom_exception (*dom_document_type_get_entities)(
			struct dom_document_type *doc_type,
			struct dom_namednodemap **result);
	dom_exception (*dom_document_type_get_notations)(
			struct dom_document_type *doc_type,
			struct dom_namednodemap **result);
	dom_exception (*dom_document_type_get_public_id)(
			struct dom_document_type *doc_type,
			dom_string **result);
	dom_exception (*dom_document_type_get_system_id)(
			struct dom_document_type *doc_type,
			dom_string **result);
	dom_exception (*dom_document_type_get_internal_subset)(
			struct dom_document_type *doc_type,
			dom_string **result);
} dom_document_type_vtable;

static inline dom_exception dom_document_type_get_name(
		struct dom_document_type *doc_type, dom_string **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_name(doc_type, result);
}
#define dom_document_type_get_name(dt, r) dom_document_type_get_name( \
		(dom_document_type *) (dt), (r))

static inline dom_exception dom_document_type_get_entities(
		struct dom_document_type *doc_type,
		struct dom_namednodemap **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_entities(doc_type, result);
}
#define dom_document_type_get_entities(dt, r) dom_document_type_get_entities( \
		(dom_document_type *) (dt), (struct dom_namednodemap **) (r))

static inline dom_exception dom_document_type_get_notations(
		struct dom_document_type *doc_type,
		struct dom_namednodemap **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_notations(doc_type, result);
}
#define dom_document_type_get_notations(dt, r) dom_document_type_get_notations(\
		(dom_document_type *) (dt), (struct dom_namednodemap **) (r))

static inline dom_exception dom_document_type_get_public_id(
		struct dom_document_type *doc_type,
		dom_string **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_public_id(doc_type, result);
}
#define dom_document_type_get_public_id(dt, r) \
		dom_document_type_get_public_id((dom_document_type *) (dt), \
		(r))

static inline dom_exception dom_document_type_get_system_id(
		struct dom_document_type *doc_type,
		dom_string **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_system_id(doc_type, result);
}
#define dom_document_type_get_system_id(dt, r) \
		dom_document_type_get_system_id((dom_document_type *) (dt), \
		(r))

static inline dom_exception dom_document_type_get_internal_subset(
		struct dom_document_type *doc_type,
		dom_string **result)
{
	return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable)
			->dom_document_type_get_internal_subset(doc_type,
			result);
}
#define dom_document_type_get_internal_subset(dt, r) \
		dom_document_type_get_internal_subset( \
		(dom_document_type *) (dt), (r))


#endif