| 1 | /* glpenv.h (GLPK environment) */cxx . . $ `<file>/external/glpk/glpenv.h`/ |
| 2 | |
| 3 | /*********************************************************************** |
| 4 | * This code is part of GLPK (GNU Linear Programming Kit). |
| 5 | * |
| 6 | * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
| 7 | * 2009, 2010 Andrew Makhorin, Department for Applied Informatics, |
| 8 | * Moscow Aviation Institute, Moscow, Russia. All rights reserved. |
| 9 | * E-mail: <[email protected]>. |
| 10 | * |
| 11 | * GLPK is free software: you can redistribute it and/or modify it |
| 12 | * under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation, either version 3 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * GLPK is distributed in the hope that it will be useful, but WITHOUT |
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
| 19 | * License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with GLPK. If not, see <http://www.gnu.org/licenses/>. |
| 23 | ***********************************************************************/ |
| 24 | |
| 25 | #ifndef GLPENV_H |
| 26 | #define GLPENV_Hcxx . . $ `external/glpk/glpenv.h:26:9`! |
| 27 | |
| 28 | #include "glpstd.h"cxx . . $ `<file>/external/glpk/glpstd.h`/ |
| 29 | #include "glplib.h"cxx . . $ `<file>/external/glpk/glplib.h`/ |
| 30 | |
| 31 | typedef struct ENVcxx . . $ ENV# ENVcxx . . $ ENV#; |
| 32 | typedef struct MEMcxx . . $ MEM# MEMcxx . . $ MEM#; |
| 33 | typedef struct XFILEcxx . . $ XFILE# XFILEcxx . . $ XFILE#; |
| 34 | |
| 35 | #define ENV_MAGICcxx . . $ `external/glpk/glpenv.h:35:9`! 0x454E5631 |
| 36 | /* environment block magic value */ |
| 37 | |
| 38 | #define TERM_BUF_SIZEcxx . . $ `external/glpk/glpenv.h:38:9`! 4096 |
| 39 | /* terminal output buffer size, in bytes */ |
| 40 | |
| 41 | #define IOERR_MSG_SIZEcxx . . $ `external/glpk/glpenv.h:41:9`! 1024 |
| 42 | /* i/o error message buffer size, in bytes */ |
| 43 | |
| 44 | #define MEM_MAGICcxx . . $ `external/glpk/glpenv.h:44:9`! 0x4D454D31 |
| 45 | /* memory block descriptor magic value */ |
| 46 | |
| 47 | struct ENVcxx . . $ ENV# |
| 48 | { /* environment block */ |
| 49 | int magiccxx . . $ ENV#magic.; |
| 50 | /* magic value used for debugging */ |
| 51 | char versioncxx . . $ ENV#version.[7+1]; |
| 52 | /* version string returned by the routine glp_version */ |
| 53 | /*--------------------------------------------------------------*/ |
| 54 | /* terminal output */ |
| 55 | char *term_bufcxx . . $ ENV#term_buf.; /* char term_buf[TERM_BUF_SIZE]; */ |
| 56 | /* terminal output buffer */ |
| 57 | int term_outcxx . . $ ENV#term_out.; |
| 58 | /* flag to enable/disable terminal output */ |
| 59 | int (*term_hookcxx . . $ ENV#term_hook.)(void *info, const char *s); |
| 60 | /* user-defined routine to intercept terminal output */ |
| 61 | void *term_infocxx . . $ ENV#term_info.; |
| 62 | /* transit pointer (cookie) passed to the routine term_hook */ |
| 63 | FILEcxx . . $ FILE# *tee_filecxx . . $ ENV#tee_file.; |
| 64 | /* output stream used to copy terminal output */ |
| 65 | /*--------------------------------------------------------------*/ |
| 66 | /* error handling */ |
| 67 | const char *err_filecxx . . $ ENV#err_file.; |
| 68 | /* value of the __FILE__ macro passed to glp_error */ |
| 69 | int err_linecxx . . $ ENV#err_line.; |
| 70 | /* value of the __LINE__ macro passed to glp_error */ |
| 71 | void (*err_hookcxx . . $ ENV#err_hook.)(void *info); |
| 72 | /* user-defined routine to intercept abnormal termination */ |
| 73 | void *err_infocxx . . $ ENV#err_info.; |
| 74 | /* transit pointer (cookie) passed to the routine err_hook */ |
| 75 | /*--------------------------------------------------------------*/ |
| 76 | /* memory allocation */ |
| 77 | glp_longcxx . . $ glp_long# mem_limitcxx . . $ ENV#mem_limit.; |
| 78 | /* maximal amount of memory (in bytes) available for dynamic |
| 79 | allocation */ |
| 80 | MEMcxx . . $ MEM# *mem_ptrcxx . . $ ENV#mem_ptr.; |
| 81 | /* pointer to the linked list of allocated memory blocks */ |
| 82 | int mem_countcxx . . $ ENV#mem_count.; |
| 83 | /* total number of currently allocated memory blocks */ |
| 84 | int mem_cpeakcxx . . $ ENV#mem_cpeak.; |
| 85 | /* peak value of mem_count */ |
| 86 | glp_longcxx . . $ glp_long# mem_totalcxx . . $ ENV#mem_total.; |
| 87 | /* total amount of currently allocated memory (in bytes; is the |
| 88 | sum of the size field over all memory block descriptors) */ |
| 89 | glp_longcxx . . $ glp_long# mem_tpeakcxx . . $ ENV#mem_tpeak.; |
| 90 | /* peak value of mem_total */ |
| 91 | /*--------------------------------------------------------------*/ |
| 92 | /* stream input/output */ |
| 93 | XFILEcxx . . $ XFILE# *file_ptrcxx . . $ ENV#file_ptr.; |
| 94 | /* pointer to the linked list of active stream descriptors */ |
| 95 | char *ioerr_msgcxx . . $ ENV#ioerr_msg.; /* char ioerr_msg[IOERR_MSG_SIZE]; */ |
| 96 | /* input/output error message buffer */ |
| 97 | /*--------------------------------------------------------------*/ |
| 98 | /* shared libraries support */ |
| 99 | void *h_odbccxx . . $ ENV#h_odbc.; |
| 100 | /* handle to ODBC shared library */ |
| 101 | void *h_mysqlcxx . . $ ENV#h_mysql.; |
| 102 | /* handle to MySQL shared library */ |
| 103 | }; |
| 104 | |
| 105 | struct MEMcxx . . $ MEM# |
| 106 | { /* memory block descriptor */ |
| 107 | int flagcxx . . $ MEM#flag.; |
| 108 | /* descriptor flag */ |
| 109 | int sizecxx . . $ MEM#size.; |
| 110 | /* size of block (in bytes, including descriptor) */ |
| 111 | MEMcxx . . $ MEM# *prevcxx . . $ MEM#prev.; |
| 112 | /* pointer to previous memory block descriptor */ |
| 113 | MEMcxx . . $ MEM# *nextcxx . . $ MEM#next.; |
| 114 | /* pointer to next memory block descriptor */ |
| 115 | }; |
| 116 | |
| 117 | struct XFILEcxx . . $ XFILE# |
| 118 | { /* input/output stream descriptor */ |
| 119 | int typecxx . . $ XFILE#type.; |
| 120 | /* stream handle type: */ |
| 121 | #define FH_FILEcxx . . $ `external/glpk/glpenv.h:121:9`! 0x11 /* FILE */ |
| 122 | #define FH_ZLIBcxx . . $ `external/glpk/glpenv.h:122:9`! 0x22 /* gzFile */ |
| 123 | void *fhcxx . . $ XFILE#fh.; |
| 124 | /* pointer to stream handle */ |
| 125 | XFILEcxx . . $ XFILE# *prevcxx . . $ XFILE#prev.; |
| 126 | /* pointer to previous stream descriptor */ |
| 127 | XFILEcxx . . $ XFILE# *nextcxx . . $ XFILE#next.; |
| 128 | /* pointer to next stream descriptor */ |
| 129 | }; |
| 130 | |
| 131 | #define XEOFcxx . . $ `external/glpk/glpenv.h:131:9`! (-1) |
| 132 | |
| 133 | #define get_env_ptrcxx . . $ `external/glpk/glpenv.h:133:9`! _glp_get_env_ptr |
| 134 | ENVcxx . . $ ENV# *get_env_ptrcxx . . $ `external/glpk/glpenv.h:133:9`!(void); |
| 135 | /* retrieve pointer to environment block */ |
| 136 | |
| 137 | #define tls_set_ptrcxx . . $ `external/glpk/glpenv.h:137:9`! _glp_tls_set_ptr |
| 138 | void tls_set_ptrcxx . . $ `external/glpk/glpenv.h:137:9`!(void *ptr); |
| 139 | /* store global pointer in TLS */ |
| 140 | |
| 141 | #define tls_get_ptrcxx . . $ `external/glpk/glpenv.h:141:9`! _glp_tls_get_ptr |
| 142 | void *tls_get_ptrcxx . . $ `external/glpk/glpenv.h:141:9`!(void); |
| 143 | /* retrieve global pointer from TLS */ |
| 144 | |
| 145 | #define xprintfcxx . . $ `external/glpk/glpenv.h:145:9`! glp_printf |
| 146 | void glp_printfcxx . . $ glp_printf(326aeb464d16410c).(const char *fmt, ...); |
| 147 | /* write formatted output to the terminal */ |
| 148 | |
| 149 | #define xvprintfcxx . . $ `external/glpk/glpenv.h:149:9`! glp_vprintf |
| 150 | void glp_vprintfcxx . . $ glp_vprintf(ac175dd46a4e4d7f).(const char *fmt, va_listcxx . . $ va_list# arg); |
| 151 | /* write formatted output to the terminal */ |
| 152 | |
| 153 | #ifndef GLP_ERROR_DEFINEDcxx . . $ `external/glpk/glpk.h:801:9`! |
| 154 | #define GLP_ERROR_DEFINEDcxx . . $ `external/glpk/glpenv.h:154:9`! |
| 155 | typedef void (*_glp_errorcxx . . $ _glp_error#)(const char *fmt, ...); |
| 156 | #endif |
| 157 | |
| 158 | #define xerrorcxx . . $ `external/glpk/glpenv.h:158:9`! glp_error_(__FILE__, __LINE__) |
| 159 | _glp_errorcxx . . $ _glp_error# glp_error_cxx . . $ glp_error_(68ddb57ca28ebef9).(const char *file, int line); |
| 160 | /* display error message and terminate execution */ |
| 161 | |
| 162 | #define xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(expr) \ |
| 163 | ((void)((expr) || (glp_assert_(#expr, __FILE__, __LINE__), 1))) |
| 164 | void glp_assert_cxx . . $ glp_assert_(5e891a9f77bb0eff).(const char *expr, const char *file, int line); |
| 165 | /* check for logical condition */ |
| 166 | |
| 167 | #define xmalloccxx . . $ `external/glpk/glpenv.h:167:9`! glp_malloc |
| 168 | void *glp_malloccxx . . $ glp_malloc(d1680a912d714170).(int size); |
| 169 | /* allocate memory block */ |
| 170 | |
| 171 | #define xcalloccxx . . $ `external/glpk/glpenv.h:171:9`! glp_calloc |
| 172 | void *glp_calloccxx . . $ glp_calloc(e7ddb6f3a463937c).(int n, int size); |
| 173 | /* allocate memory block */ |
| 174 | |
| 175 | #define xfreecxx . . $ `external/glpk/glpenv.h:175:9`! glp_free |
| 176 | void glp_freecxx . . $ glp_free(5d22bdacc48458e8).(void *ptr); |
| 177 | /* free memory block */ |
| 178 | |
| 179 | #define xtimecxx . . $ `external/glpk/glpenv.h:179:9`! glp_time |
| 180 | glp_longcxx . . $ glp_long# glp_timecxx . . $ glp_time(97909279aa163842).(void); |
| 181 | /* determine current universal time */ |
| 182 | |
| 183 | #define xdifftimecxx . . $ `external/glpk/glpenv.h:183:9`! glp_difftime |
| 184 | double glp_difftimecxx . . $ glp_difftime(9517efb6951e755a).(glp_longcxx . . $ glp_long# t1, glp_longcxx . . $ glp_long# t0); |
| 185 | /* compute difference between two time values, in seconds */ |
| 186 | |
| 187 | #define lib_err_msgcxx . . $ `external/glpk/glpenv.h:187:9`! _glp_lib_err_msg |
| 188 | void lib_err_msgcxx . . $ `external/glpk/glpenv.h:187:9`!(const char *msg); |
| 189 | |
| 190 | #define xerrmsgcxx . . $ `external/glpk/glpenv.h:190:9`! _glp_lib_xerrmsg |
| 191 | const char *xerrmsgcxx . . $ `external/glpk/glpenv.h:190:9`!(void); |
| 192 | |
| 193 | #define xfopencxx . . $ `external/glpk/glpenv.h:193:9`! _glp_lib_xfopen |
| 194 | XFILEcxx . . $ XFILE# *xfopencxx . . $ `external/glpk/glpenv.h:193:9`!(const char *fname, const char *mode); |
| 195 | |
| 196 | #define xferrorcxx . . $ `external/glpk/glpenv.h:196:9`! _glp_lib_xferror |
| 197 | int xferrorcxx . . $ `external/glpk/glpenv.h:196:9`!(XFILEcxx . . $ XFILE# *file); |
| 198 | |
| 199 | #define xfeofcxx . . $ `external/glpk/glpenv.h:199:9`! _glp_lib_xfeof |
| 200 | int xfeofcxx . . $ `external/glpk/glpenv.h:199:9`!(XFILEcxx . . $ XFILE# *file); |
| 201 | |
| 202 | #define xfgetccxx . . $ `external/glpk/glpenv.h:202:9`! _glp_lib_xfgetc |
| 203 | int xfgetccxx . . $ `external/glpk/glpenv.h:202:9`!(XFILEcxx . . $ XFILE# *file); |
| 204 | |
| 205 | #define xfputccxx . . $ `external/glpk/glpenv.h:205:9`! _glp_lib_xfputc |
| 206 | int xfputccxx . . $ `external/glpk/glpenv.h:205:9`!(int c, XFILEcxx . . $ XFILE# *file); |
| 207 | |
| 208 | #define xfflushcxx . . $ `external/glpk/glpenv.h:208:9`! _glp_lib_xfflush |
| 209 | int xfflushcxx . . $ `external/glpk/glpenv.h:208:9`!(XFILEcxx . . $ XFILE# *fp); |
| 210 | |
| 211 | #define xfclosecxx . . $ `external/glpk/glpenv.h:211:9`! _glp_lib_xfclose |
| 212 | int xfclosecxx . . $ `external/glpk/glpenv.h:211:9`!(XFILEcxx . . $ XFILE# *file); |
| 213 | |
| 214 | #define xfprintfcxx . . $ `external/glpk/glpenv.h:214:9`! _glp_lib_xfprintf |
| 215 | int xfprintfcxx . . $ `external/glpk/glpenv.h:214:9`!(XFILEcxx . . $ XFILE# *file, const char *fmt, ...); |
| 216 | |
| 217 | #define xdlopencxx . . $ `external/glpk/glpenv.h:217:9`! _glp_xdlopen |
| 218 | void *xdlopencxx . . $ `external/glpk/glpenv.h:217:9`!(const char *module); |
| 219 | |
| 220 | #define xdlsymcxx . . $ `external/glpk/glpenv.h:220:9`! _glp_xdlsym |
| 221 | void *xdlsymcxx . . $ `external/glpk/glpenv.h:220:9`!(void *h, const char *symbol); |
| 222 | |
| 223 | #define xdlclosecxx . . $ `external/glpk/glpenv.h:223:9`! _glp_xdlclose |
| 224 | void xdlclosecxx . . $ `external/glpk/glpenv.h:223:9`!(void *h); |
| 225 | |
| 226 | #endif |
| 227 | |
| 228 | /* eof */ |