Scippy

SCIP

Solving Constraint Integer Programs

xmldef.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-2023 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 xmldef.h
26  * @brief definitions 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_XMLDEF_H__
34 #define __SCIP_XMLDEF_H__
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 #ifndef XML_Bool
42 #define XML_Bool unsigned int /**< type used for boolean values */
43 #endif
44 
45 #ifndef TRUE
46 #define TRUE 1 /**< boolean value TRUE */
47 #define FALSE 0 /**< boolean value FALSE */
48 #endif
49 
50 
51 #ifdef SCIP_WITH_ZLIB
52 #include <zlib.h>
53 
54 #define FOPEN(file, mode) gzopen(file, mode)
55 #define FCLOSE(fp) gzclose(fp)
56 #define FGETS(buf, len, fp) gzgets(fp, buf, len) /*lint !e755 */
57 #define FREAD(buf, len, fp) gzread(fp, buf, len)
58 #define FPTYPE gzFile
59 #else
60 #define FOPEN(file, mode) fopen(file, mode)
61 #define FCLOSE(fp) fclose(fp)
62 #define FGETS(buf, len, fp) fgets(buf, len, fp) /*lint !e755 */
63 #define FREAD(buf, len, fp) fread(buf, 1, len, fp)
64 #define FPTYPE FILE*
65 #endif /* SCIP_WITH_ZLIB */
66 
67 
68 #ifndef ALLOC_ABORT
69 #define ALLOC_ABORT(x) do \
70  { \
71  if( NULL == (x) ) \
72  { \
73  printf("[%s:%d] No memory in function call\n", __FILE__, __LINE__); \
74  abort(); \
75  } \
76  } \
77  while( FALSE )
78 #endif
79 
80 #ifndef ALLOC_FALSE
81 #define ALLOC_FALSE(x) do \
82  { \
83  if( NULL == (x) ) \
84  { \
85  printf("[%s:%d] No memory in function call\n", __FILE__, __LINE__); \
86  return FALSE; \
87  } \
88  } \
89  while( FALSE )
90 #endif
91 
92 #ifdef XML_DEBUG
93 #define debug(x) x
94 #define debugMessage printf("[%s:%d] debug: ", __FILE__, __LINE__); printf
95 #define debugPrintf printf
96 #else
97 #define debug(x) /**/
98 #define debugMessage while( FALSE ) printf
99 #define debugPrintf while( FALSE ) printf
100 #endif
101 
102 #ifndef infoMessage
103 #define infoMessage printf
104 #endif
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif