Debian Codegraph @

libgdome/gdomecore/gdome-xml-xmlutil.h

raw
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
2 /* gdome-xml-xmlutil.h
3 *
4 * Copyright (C) 2001 Paolo Casarini <[email protected]>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef GDOME_XML_XMLUTIL_H
22 #define GDOME_XML_XMLUTIL_H
23
24 #define INLINE0
25
26 #ifdef INLINE
27 #define gdome_xmlGetPrev(node) ((node)->prev)
28 #define gdome_xmlSetPrev(node,p) ((node)->prev = (p))
29 #define gdome_xmlGetNext(node) ((node)->next)
30 #define gdome_xmlSetNext(node,p) ((node)->next = (p))
31 #define gdome_xmlGetFirstChild(node) ((node)->children)
32 #define gdome_xmlSetFirstChild(node,p) ((node)->children = (p))
33 #define gdome_xmlGetLastChild(node) ((node)->last)
34 #define gdome_xmlSetLastChild(node,p) ((node)->last = (p))
35 #define gdome_xmlGetAttrList(elem) ((elem)->properties)
36 #define gdome_xmlSetAttrList(elem,p) ((elem)->properties = (p))
37 #define gdome_xmlGetNsDeclList(elem) ((elem)->nsDef)
38 #define gdome_xmlGetOwner(node) ((node)->doc)
39 #define gdome_xmlSetOwner(node,p) ((node)->doc = (p))
40 #define gdome_xmlGetParent(node) ((node)->parent)
41 #define gdome_xmlSetParent(node,p) ((node)->parent = (p))
42 #define gdome_xmlGetNs(node) ((node)->ns)
43 #define gdome_xmlSetNs(node,p) ((node)->ns = (p))
44 #define gdome_xmlGetType(node) ((node)->type)
45 #define gdome_xmlGetName(node) ((node)->name)
46 #define gdome_xmlGetContent(node) ((node)->content)
47 #else
48 xmlNode * gdome_xmlGetPrev (xmlNode *node);
49 void gdome_xmlSetPrev (xmlNode *node,
50 xmlNode *prev);
51 xmlNode * gdome_xmlGetNext (xmlNode *node);
52 void gdome_xmlSetNext (xmlNode *node,
53 xmlNode *next);
54 xmlNode * gdome_xmlGetFirstChild (xmlNode *node);
55 void gdome_xmlSetFirstChild (xmlNode *node,
56 xmlNode *first);
57 xmlNode * gdome_xmlGetLastChild (xmlNode *node);
58 void gdome_xmlSetLastChild (xmlNode *node,
59 xmlNode *last);
60 xmlAttr * gdome_xmlGetAttrList (xmlNode *elem);
61 xmlNs * gdome_xmlGetNsDeclList (xmlNode *elem);
62 void gdome_xmlSetAttrList (xmlNode *elem,
63 xmlAttr *attr);
64 xmlDoc * gdome_xmlGetOwner (xmlNode *node);
65 void gdome_xmlSetOwner (xmlNode *node,
66 xmlDoc *owner);
67 xmlNode * gdome_xmlGetParent (xmlNode *node);
68 void gdome_xmlSetParent (xmlNode *node,
69 xmlNode *parent);
70 xmlNs * gdome_xmlGetNs (xmlNode *node);
71 void gdome_xmlSetNs (xmlNode *node, xmlNs *ns);
72 xmlElementType gdome_xmlGetType (xmlNode *node);
73 const xmlChar * gdome_xmlGetName (xmlNode *node);
74 xmlChar * gdome_xmlGetContent (xmlNode *node);
75 #endif /* INLINE */
76
77 void gdome_xmlSetNsDeclList (xmlNode *elem,
78 xmlChar *prefix,
79 xmlChar *href);
80 xmlDoc * gdome_xmlGetOwnerOrSelf (xmlNode *node);
81 const xmlChar * gdome_xmlGetNsPrefix (xmlNode *node);
82 const xmlChar * gdome_xmlGetNsURI (xmlNode *node);
83 xmlAttr * gdome_xmlGetAttr (xmlNode *elem,
84 const xmlChar* name);
85 xmlAttr * gdome_xmlGetNsAttr (xmlNode *elem,
86 const xmlChar* namespaceURI,
87 const xmlChar* localName);
88 void gdome_xmlSetAttrValue (xmlAttr *attr,
89 xmlChar *value);
90 xmlNode * gdome_xmlAppendChild (xmlNode *parent,
91 xmlNode *child);
92 xmlNode * gdome_xmlInsertBeforeChild (xmlNode *parent,
93 xmlNode* newchild,
94 xmlNode *refchild);
95 xmlNode * gdome_xmlUnlinkChild (xmlNode *parent,
96 xmlNode *child);
97 xmlAttr * gdome_xmlUnlinkAttr (xmlNode *elem,
98 const xmlChar* name);
99 xmlAttr * gdome_xmlUnlinkNsAttr (xmlNode *elem,
100 const xmlChar* namespaceURI,
101 const xmlChar* localName);
102 xmlNs * gdome_xmlUnlinkNsDecl (xmlNode *elem,
103 const xmlChar* localName);
104 int gdome_xmlLinkAttr (xmlNode *elem,
105 xmlAttr *attr);
106 int gdome_xmlLinkNsDecl (xmlNode *elem,
107 xmlChar *prefix,
108 xmlChar *href);
109 xmlNode * gdome_xmlGetChildrenItem (xmlNode *parent,
110 gulong index);
111 xmlNode * gdome_xmlNamedPreorderTraversal (xmlNode *root,
112 xmlChar *tagURI,
113 xmlChar *tagName,
114 gulong *cur,
115 gulong index);
116 gulong gdome_xmlGetChildrensLength (xmlNode *parent);
117 void gdome_xmlNamedCntTreeElements (xmlNode *root,
118 xmlChar *tagURI,
119 xmlChar *tagName,
120 gulong *cur);
121 xmlNs * gdome_xmlGetNsDecl (xmlNode *elem,
122 xmlChar *localName);
123 xmlAttrPtr gdome_xmlNewNsDecl (xmlNodePtr node,
124 const xmlChar *name,
125 const xmlChar *value);
126 GdomeBoolean gdome_xmlIsNsDecl (xmlAttr *a);
127 xmlNs * gdome_xmlGetNsDeclByAttr (xmlAttr *a);
128 void gdome_xmlSetOldNs (xmlDoc *doc, xmlNs *ns);
129 xmlNs * gdome_xmlNewNs (xmlDoc *doc, const xmlChar *href, const xmlChar *prefix);
130
131 #endif /* GDOME_XML_XMLUTIL_H */