1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * These functions are used to access and manipulate the SWIG parse tree.
8 * The structure of this tree is modeled directly after XML-DOM. The attribute
9 * and function names are meant to be similar.
10 * ----------------------------------------------------------------------------- */
12 /* $Id: swig.h 9622 2006-12-19 03:49:17Z beazley $ */
14 /* Macros to traverse the DOM tree */
16 #define nodeType(x) Getattr(x,"nodeType")
17 #define parentNode(x) Getattr(x,"parentNode")
18 #define previousSibling(x) Getattr(x,"previousSibling")
19 #define nextSibling(x) Getattr(x,"nextSibling")
20 #define firstChild(x) Getattr(x,"firstChild")
21 #define lastChild(x) Getattr(x,"lastChild")
23 /* Macros to set up the DOM tree (mostly used by the parser) */
25 #define set_nodeType(x,v) Setattr(x,"nodeType",v)
26 #define set_parentNode(x,v) Setattr(x,"parentNode",v)
27 #define set_previousSibling(x,v) Setattr(x,"previousSibling",v)
28 #define set_nextSibling(x,v) Setattr(x,"nextSibling",v)
29 #define set_firstChild(x,v) Setattr(x,"firstChild",v)
30 #define set_lastChild(x,v) Setattr(x,"lastChild",v)
32 /* Utility functions */
34 extern int checkAttribute(Node *obj, const_String_or_char_ptr name, const_String_or_char_ptr value);
35 extern void appendChild(Node *node, Node *child);
36 extern void prependChild(Node *node, Node *child);
37 extern void removeNode(Node *node);
38 extern Node *copyNode(Node *node);
40 /* Node restoration/restore functions */
42 extern void Swig_require(const char *ns, Node *node, ...);
43 extern void Swig_save(const char *ns, Node *node, ...);
44 extern void Swig_restore(Node *node);
46 /* Debugging of parse trees */
48 extern void Swig_print_tags(File *obj, Node *root);
49 extern void Swig_print_tree(Node *obj);
50 extern void Swig_print_node(Node *obj);