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-2018 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 scip.zib.de. */
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 */
57 extern
59  const char* filename /**< XML file name */
60  );
61 
62 /** create new node */
63 extern
65  const char* name,
66  int lineno
67  );
68 
69 /** create new attribute */
70 extern
72  const char* name,
73  const char* value
74  );
75 
76 /** add attribute */
77 extern
78 void xmlAddAttr(
79  XML_NODE* n,
80  XML_ATTR* a
81  );
82 
83 /** append child node */
84 extern
85 void xmlAppendChild(
86  XML_NODE* parent,
87  XML_NODE* child
88  );
89 
90 /** free node */
91 extern
92 void xmlFreeNode(
93  XML_NODE* node
94  );
95 
96 /** output node */
97 extern
98 void xmlShowNode(
99  const XML_NODE* root
100  );
101 
102 /** get attribute value */
103 extern
104 const char* xmlGetAttrval(
105  const XML_NODE* node,
106  const char* name
107  );
108 
109 /** return first node */
110 extern
111 const XML_NODE* xmlFirstNode(
112  const XML_NODE* node,
113  const char* name
114  );
115 
116 /** return next node */
117 extern
118 const XML_NODE* xmlNextNode(
119  const XML_NODE* node,
120  const char* name
121  );
122 
123 /** find node */
124 extern
125 const XML_NODE* xmlFindNode(
126  const XML_NODE* node,
127  const char* name
128  );
129 
130 /** find node with bound on the depth */
131 extern
133  const XML_NODE* node, /**< current node - use start node to begin */
134  const char* name, /**< name of tag to search for */
135  int depth, /**< current depth - start with 0 */
136  int maxdepth /**< maximal depth */
137  );
138 
139 /** return next sibling */
140 extern
141 const XML_NODE* xmlNextSibl(
142  const XML_NODE* node
143  );
144 
145 /** return previous sibling */
146 extern
147 const XML_NODE* xmlPrevSibl(
148  const XML_NODE* node
149  );
150 
151 /** return first child */
152 extern
153 const XML_NODE* xmlFirstChild(
154  const XML_NODE* node
155  );
156 
157 /** return last child */
158 extern
159 const XML_NODE* xmlLastChild(
160  const XML_NODE* node
161  );
162 
163 /** return name of node */
164 extern
165 const char* xmlGetName(
166  const XML_NODE* node
167  );
168 
169 /** get line number */
170 extern
171 int xmlGetLine(
172  const XML_NODE* node
173  );
174 
175 /** get data */
176 extern
177 const char* xmlGetData(
178  const XML_NODE* node
179  );
180 
181 /** find PCDATA */
182 extern
183 const char* xmlFindPcdata(
184  const XML_NODE* node,
185  const char* name
186  );
187 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif
const char * xmlFindPcdata(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1506
const XML_NODE * xmlFirstNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1349
struct XML_ATTR_struct XML_ATTR
Definition: xml.h:32
XML_NODE * xmlProcess(const char *filename)
Definition: xmlparse.c:1072
const XML_NODE * xmlFirstChild(const XML_NODE *node)
Definition: xmlparse.c:1456
const char * xmlGetData(const XML_NODE *node)
Definition: xmlparse.c:1496
void xmlShowNode(const XML_NODE *root)
Definition: xmlparse.c:1296
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:1406
int xmlGetLine(const XML_NODE *node)
Definition: xmlparse.c:1486
const XML_NODE * xmlNextNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1369
const XML_NODE * xmlFindNode(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1381
const char * xmlGetName(const XML_NODE *node)
Definition: xmlparse.c:1476
const XML_NODE * xmlLastChild(const XML_NODE *node)
Definition: xmlparse.c:1466
const char * xmlGetAttrval(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1324
SCIP_VAR * a
Definition: circlepacking.c:57
XML_ATTR * xmlNewAttr(const char *name, const char *value)
Definition: xmlparse.c:1182
XML_NODE * xmlNewNode(const char *name, int lineno)
Definition: xmlparse.c:1163
void xmlAddAttr(XML_NODE *n, XML_ATTR *a)
Definition: xmlparse.c:1202
void xmlFreeNode(XML_NODE *node)
Definition: xmlparse.c:1262
const XML_NODE * xmlPrevSibl(const XML_NODE *node)
Definition: xmlparse.c:1446
const XML_NODE * xmlNextSibl(const XML_NODE *node)
Definition: xmlparse.c:1436
void xmlAppendChild(XML_NODE *parent, XML_NODE *child)
Definition: xmlparse.c:1215