2 * Copyright (C) 2000, Luca Padovani <luca.padovani@cs.unibo.it>.
4 * This file is part of miniDOM, a minimal implementation of the
5 * Document Object Model
7 * miniDOM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * miniDOM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with miniDOM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * For details, send a mail to <luca.padovani@cs.unibo.it>
28 #include <libxml/parser.h>
32 #endif /* __cplusplus */
34 typedef xmlChar* mDOMStringRef;
35 typedef const xmlChar* mDOMConstStringRef;
36 typedef xmlDocPtr mDOMDocRef;
37 typedef xmlNodePtr mDOMNodeRef;
38 typedef xmlAttrPtr mDOMAttrRef;
39 typedef xmlEntityPtr mDOMEntityRef;
40 typedef xmlNsPtr mDOMNsRef;
42 typedef xmlEntityPtr (*mDOMEntityResolver)(void*, mDOMConstStringRef);
44 #define C_STRING(s) ((char*) (s))
45 #define C_CONST_STRING(s) ((const char*) (s))
46 #define DOM_STRING(s) ((mDOMStringRef) (s))
47 #define DOM_CONST_STRING(s) ((mDOMConstStringRef) (s))
49 mDOMDocRef mdom_load(const char*, gboolean, mDOMEntityResolver);
50 void mdom_unload(mDOMDocRef);
52 gboolean mdom_string_eq(mDOMConstStringRef, mDOMConstStringRef);
53 void mdom_string_free(mDOMStringRef);
54 mDOMStringRef mdom_string_dup(mDOMConstStringRef);
56 mDOMDocRef mdom_doc_new(mDOMConstStringRef);
57 void mdom_doc_free(mDOMDocRef);
58 mDOMNodeRef mdom_doc_get_root_node(mDOMDocRef);
59 mDOMEntityRef mdom_doc_add_entity(mDOMDocRef, mDOMConstStringRef, mDOMConstStringRef);
60 mDOMEntityRef mdom_doc_get_entity(mDOMDocRef, mDOMConstStringRef);
61 mDOMEntityRef mdom_get_predefined_entity(mDOMConstStringRef);
62 mDOMConstStringRef mdom_entity_get_content(mDOMEntityRef);
65 mDOMNsRef mdom_doc_search_ns(mDOMDocRef, mDOMNodeRef, mDOMConstStringRef);
66 mDOMNsRef mdom_doc_search_ns_by_uri(mDOMDocRef, mDOMNodeRef, mDOMConstStringRef);
67 void mdom_ns_free(mDOMNsRef);
68 mDOMNsRef mdom_node_ns_new(mDOMNodeRef, mDOMConstStringRef, mDOMConstStringRef);
71 void mdom_node_set_user_data(mDOMNodeRef, gpointer);
72 gpointer mdom_node_get_user_data(mDOMNodeRef);
73 gboolean mdom_node_is_text(mDOMNodeRef);
74 gboolean mdom_node_is_element(mDOMNodeRef);
75 gboolean mdom_node_is_entity_ref(mDOMNodeRef);
76 gboolean mdom_node_is_blank(mDOMNodeRef);
77 guint mdom_node_get_type(mDOMNodeRef);
78 mDOMConstStringRef mdom_node_get_name(mDOMNodeRef);
79 mDOMConstStringRef mdom_node_get_ns_uri(mDOMNodeRef);
80 mDOMStringRef mdom_node_get_attribute(mDOMNodeRef, mDOMConstStringRef);
81 mDOMStringRef mdom_node_get_attribute_ns(mDOMNodeRef, mDOMConstStringRef, mDOMConstStringRef);
82 gboolean mdom_node_has_attribute(mDOMNodeRef, mDOMConstStringRef);
83 gboolean mdom_node_has_attribute_ns(mDOMNodeRef, mDOMConstStringRef, mDOMConstStringRef);
84 mDOMStringRef mdom_node_get_content(mDOMNodeRef);
85 mDOMNodeRef mdom_node_get_parent(mDOMNodeRef);
86 mDOMNodeRef mdom_node_get_prev_sibling(mDOMNodeRef);
87 mDOMNodeRef mdom_node_get_next_sibling(mDOMNodeRef);
88 mDOMNodeRef mdom_node_get_first_child(mDOMNodeRef);
89 mDOMAttrRef mdom_node_get_first_attribute(mDOMNodeRef);
90 gboolean mdom_node_is_first(mDOMNodeRef);
91 gboolean mdom_node_is_last(mDOMNodeRef);
93 mDOMConstStringRef mdom_attr_get_name(mDOMAttrRef);
94 mDOMConstStringRef mdom_attr_get_ns_uri(mDOMAttrRef);
95 mDOMStringRef mdom_attr_get_value(mDOMAttrRef);
96 mDOMAttrRef mdom_attr_get_prev_sibling(mDOMAttrRef);
97 mDOMAttrRef mdom_attr_get_next_sibling(mDOMAttrRef);
98 mDOMNodeRef mdom_attr_get_parent(mDOMAttrRef);
102 #endif /* __cplusplus */
104 #endif /* minidom_h */