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-2025 Zuse Institute Berlin (ZIB) */
    7/* */
    8/* Licensed under the Apache License, Version 2.0 (the "License"); */
    9/* you may not use this file except in compliance with the License. */
    10/* You may obtain a copy of the License at */
    11/* */
    12/* http://www.apache.org/licenses/LICENSE-2.0 */
    13/* */
    14/* Unless required by applicable law or agreed to in writing, software */
    15/* distributed under the License is distributed on an "AS IS" BASIS, */
    16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
    17/* See the License for the specific language governing permissions and */
    18/* limitations under the License. */
    19/* */
    20/* You should have received a copy of the Apache-2.0 license */
    21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
    22/* */
    23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    24
    25/**@file xml.h
    26 * @brief declarations for XML parsing
    27 * @author Thorsten Koch
    28 * @author Marc Pfetsch
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_XML_H__
    34#define __SCIP_XML_H__
    35
    36#ifdef __cplusplus
    37extern "C" {
    38#endif
    39
    40
    41typedef struct XML_ATTR_struct XML_ATTR;
    42
    43struct XML_ATTR_struct
    44{
    45 char* name;
    46 char* value;
    47 XML_ATTR* next;
    48};
    49
    50typedef struct XML_NODE_struct XML_NODE;
    51
    52struct XML_NODE_struct
    53{
    54 char* name;
    55 int lineno;
    56 XML_ATTR* attrlist;
    57 XML_NODE* parent;
    58 XML_NODE* prevsibl;
    59 XML_NODE* nextsibl;
    60 XML_NODE* firstchild;
    61 XML_NODE* lastchild;
    62 char* data; /* does not come together with children */
    63};
    64
    65/** Parse file */
    66SCIP_EXPORT
    68 const char* filename /**< XML file name */
    69 );
    70
    71/** create new node */
    72SCIP_EXPORT
    74 const char* name,
    75 int lineno
    76 );
    77
    78/** create new attribute */
    79SCIP_EXPORT
    81 const char* name,
    82 const char* value
    83 );
    84
    85/** add attribute */
    86SCIP_EXPORT
    88 XML_NODE* n,
    89 XML_ATTR* a
    90 );
    91
    92/** append child node */
    93SCIP_EXPORT
    95 XML_NODE* parent,
    96 XML_NODE* child
    97 );
    98
    99/** free node */
    100SCIP_EXPORT
    101void SCIPxmlFreeNode(
    102 XML_NODE* node
    103 );
    104
    105/** output node */
    106SCIP_EXPORT
    107void SCIPxmlShowNode(
    108 const XML_NODE* root
    109 );
    110
    111/** get attribute value */
    112SCIP_EXPORT
    113const char* SCIPxmlGetAttrval(
    114 const XML_NODE* node,
    115 const char* name
    116 );
    117
    118/** return first node */
    119SCIP_EXPORT
    121 const XML_NODE* node,
    122 const char* name
    123 );
    124
    125/** return next node */
    126SCIP_EXPORT
    128 const XML_NODE* node,
    129 const char* name
    130 );
    131
    132/** find node */
    133SCIP_EXPORT
    135 const XML_NODE* node,
    136 const char* name
    137 );
    138
    139/** find node with bound on the depth */
    140SCIP_EXPORT
    142 const XML_NODE* node, /**< current node - use start node to begin */
    143 const char* name, /**< name of tag to search for */
    144 int depth, /**< current depth - start with 0 */
    145 int maxdepth /**< maximal depth */
    146 );
    147
    148/** return next sibling */
    149SCIP_EXPORT
    151 const XML_NODE* node
    152 );
    153
    154/** return previous sibling */
    155SCIP_EXPORT
    157 const XML_NODE* node
    158 );
    159
    160/** return first child */
    161SCIP_EXPORT
    163 const XML_NODE* node
    164 );
    165
    166/** return last child */
    167SCIP_EXPORT
    169 const XML_NODE* node
    170 );
    171
    172/** return name of node */
    173SCIP_EXPORT
    174const char* SCIPxmlGetName(
    175 const XML_NODE* node
    176 );
    177
    178/** get line number */
    179SCIP_EXPORT
    181 const XML_NODE* node
    182 );
    183
    184/** get data */
    185SCIP_EXPORT
    186const char* SCIPxmlGetData(
    187 const XML_NODE* node
    188 );
    189
    190/** find PCDATA */
    191SCIP_EXPORT
    192const char* SCIPxmlFindPcdata(
    193 const XML_NODE* node,
    194 const char* name
    195 );
    196
    197#ifdef __cplusplus
    198}
    199#endif
    200
    201#endif
    SCIP_VAR * a
    Definition: circlepacking.c:66
    const char * SCIPxmlFindPcdata(const XML_NODE *node, const char *name)
    Definition: xmlparse.c:1515
    XML_NODE * SCIPxmlNewNode(const char *name, int lineno)
    Definition: xmlparse.c:1172
    const char * SCIPxmlGetAttrval(const XML_NODE *node, const char *name)
    Definition: xmlparse.c:1333
    struct XML_ATTR_struct XML_ATTR
    Definition: xml.h:41
    const XML_NODE * SCIPxmlFirstChild(const XML_NODE *node)
    Definition: xmlparse.c:1465
    const XML_NODE * SCIPxmlFindNodeMaxdepth(const XML_NODE *node, const char *name, int depth, int maxdepth)
    Definition: xmlparse.c:1415
    void SCIPxmlAddAttr(XML_NODE *n, XML_ATTR *a)
    Definition: xmlparse.c:1211
    const XML_NODE * SCIPxmlFindNode(const XML_NODE *node, const char *name)
    Definition: xmlparse.c:1390
    const XML_NODE * SCIPxmlNextNode(const XML_NODE *node, const char *name)
    Definition: xmlparse.c:1378
    void SCIPxmlShowNode(const XML_NODE *root)
    Definition: xmlparse.c:1305
    const char * SCIPxmlGetData(const XML_NODE *node)
    Definition: xmlparse.c:1505
    const XML_NODE * SCIPxmlFirstNode(const XML_NODE *node, const char *name)
    Definition: xmlparse.c:1358
    const XML_NODE * SCIPxmlNextSibl(const XML_NODE *node)
    Definition: xmlparse.c:1445
    void SCIPxmlFreeNode(XML_NODE *node)
    Definition: xmlparse.c:1271
    const XML_NODE * SCIPxmlLastChild(const XML_NODE *node)
    Definition: xmlparse.c:1475
    void SCIPxmlAppendChild(XML_NODE *parent, XML_NODE *child)
    Definition: xmlparse.c:1224
    struct XML_NODE_struct XML_NODE
    Definition: xml.h:50
    const char * SCIPxmlGetName(const XML_NODE *node)
    Definition: xmlparse.c:1485
    const XML_NODE * SCIPxmlPrevSibl(const XML_NODE *node)
    Definition: xmlparse.c:1455
    int SCIPxmlGetLine(const XML_NODE *node)
    Definition: xmlparse.c:1495
    XML_NODE * SCIPxmlProcess(const char *filename)
    Definition: xmlparse.c:1089
    XML_ATTR * SCIPxmlNewAttr(const char *name, const char *value)
    Definition: xmlparse.c:1191