Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SCIP 9.2.0
SCIP 8.1.0
SCIP 7.0.3
SCIP 6.0.2
SCIP 5.0.1
SCIP 4.0.1
SCIP 3.2.1
SCIP
Solving Constraint Integer Programs
Overview
Files
Plugin Types
Interfaces
Examples
How To
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
scip-repo
src
xml
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-2014 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 email to 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
58
XML_NODE
*
xmlProcess
(
59
const
char
* filename
/**< XML file name */
60
);
61
62
/** create new node */
63
extern
64
XML_NODE
*
xmlNewNode
(
65
const
char
* name,
66
int
lineno
67
);
68
69
/** create new attribute */
70
extern
71
XML_ATTR
*
xmlNewAttr
(
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
132
const
XML_NODE
*
xmlFindNodeMaxdepth
(
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
193