Scippy

SCIP

Solving Constraint Integer Programs

xml.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file xml.h
17  * @brief declarations for XML parsing
18  * @author Thorsten Koch
19  * @author Marc Pfetsch
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_XML_H__
25 #define __SCIP_XML_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 typedef struct XML_ATTR_struct XML_ATTR;
33 
34 struct XML_ATTR_struct
35 {
36  char* name;
37  char* value;
38  XML_ATTR* next;
39 };
40 
41 typedef struct XML_NODE_struct XML_NODE;
42 
43 struct XML_NODE_struct
44 {
45  char* name;
46  int lineno;
47  XML_ATTR* attrlist;
48  XML_NODE* parent;
49  XML_NODE* prevsibl;
50  XML_NODE* nextsibl;
51  XML_NODE* firstchild;
52  XML_NODE* lastchild;
53  char* data; /* does not come together with children */
54 };
55 
56 /** Parse file */
58  const char* filename /**< XML file name */
59  );
60 
61 /** create new node */
63  const char* name,
64  int lineno
65  );
66 
67 /** create new attribute */
69  const char* name,
70  const char* value
71  );
72 
73 /** add attribute */
74 void xmlAddAttr(
75  XML_NODE* n,
76  XML_ATTR* a
77  );
78 
79 /** append child node */
80 void xmlAppendChild(
81  XML_NODE* parent,
82  XML_NODE* child
83  );
84 
85 /** free node */
86 void xmlFreeNode(
87  XML_NODE* node
88  );
89 
90 /** output node */
91 void xmlShowNode(
92  const XML_NODE* root
93  );
94 
95 /** get attribute value */
96 const char* xmlGetAttrval(
97  const XML_NODE* node,
98  const char* name
99  );
100 
101 /** return first node */
102 const XML_NODE* xmlFirstNode(
103  const XML_NODE* node,
104  const char* name
105  );
106 
107 /** return next node */
108 const XML_NODE* xmlNextNode(
109  const XML_NODE* node,
110  const char* name
111  );
112 
113 /** find node */
114 const XML_NODE* xmlFindNode(
115  const XML_NODE* node,
116  const char* name
117  );
118 
119 /** find node with bound on the depth */
121  const XML_NODE* node, /**< current node - use start node to begin */
122  const char* name, /**< name of tag to search for */
123  int depth, /**< current depth - start with 0 */
124  int maxdepth /**< maximal depth */
125  );
126 
127 /** return next sibling */
128 const XML_NODE* xmlNextSibl(
129  const XML_NODE* node
130  );
131 
132 /** return previous sibling */
133 const XML_NODE* xmlPrevSibl(
134  const XML_NODE* node
135  );
136 
137 /** return first child */
138 const XML_NODE* xmlFirstChild(
139  const XML_NODE* node
140  );
141 
142 /** return last child */
143 const XML_NODE* xmlLastChild(
144  const XML_NODE* node
145  );
146 
147 /** return name of node */
148 const char* xmlGetName(
149  const XML_NODE* node
150  );
151 
152 /** get line number */
153 int xmlGetLine(
154  const XML_NODE* node
155  );
156 
157 /** get data */
158 const char* xmlGetData(
159  const XML_NODE* node
160  );
161 
162 /** find PCDATA */
163 const char* xmlFindPcdata(
164  const XML_NODE* node,
165  const char* name
166  );
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif
const char * xmlFindPcdata(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1508
const XML_NODE * xmlFirstNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1351
struct XML_ATTR_struct XML_ATTR
Definition: xml.h:32
XML_NODE * xmlProcess(const char *filename)
Definition: xmlparse.c:1074
const XML_NODE * xmlFirstChild(const XML_NODE *node)
Definition: xmlparse.c:1458
const char * xmlGetData(const XML_NODE *node)
Definition: xmlparse.c:1498
void xmlShowNode(const XML_NODE *root)
Definition: xmlparse.c:1298
struct XML_NODE_struct XML_NODE
Definition: xml.h:41
const XML_NODE * xmlFindNodeMaxdepth(const XML_NODE *node, const char *name, int depth, int maxdepth)
Definition: xmlparse.c:1408
int xmlGetLine(const XML_NODE *node)
Definition: xmlparse.c:1488
const XML_NODE * xmlNextNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1371
const XML_NODE * xmlFindNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1383
const char * xmlGetName(const XML_NODE *node)
Definition: xmlparse.c:1478
const XML_NODE * xmlLastChild(const XML_NODE *node)
Definition: xmlparse.c:1468
const char * xmlGetAttrval(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1326
SCIP_VAR * a
Definition: circlepacking.c:57
XML_ATTR * xmlNewAttr(const char *name, const char *value)
Definition: xmlparse.c:1184
XML_NODE * xmlNewNode(const char *name, int lineno)
Definition: xmlparse.c:1165
void xmlAddAttr(XML_NODE *n, XML_ATTR *a)
Definition: xmlparse.c:1204
void xmlFreeNode(XML_NODE *node)
Definition: xmlparse.c:1264
const XML_NODE * xmlPrevSibl(const XML_NODE *node)
Definition: xmlparse.c:1448
const XML_NODE * xmlNextSibl(const XML_NODE *node)
Definition: xmlparse.c:1438
void xmlAppendChild(XML_NODE *parent, XML_NODE *child)
Definition: xmlparse.c:1217