1 /*******************************************************/ 2 /* "C" Language Integrated Production System */ 3 /* */ 4 /* CLIPS Version 6.30 02/05/15 */ 5 /* */ 6 /* SETUP HEADER FILE */ 7 /*******************************************************/ 8 9 /*************************************************************/ 10 /* Purpose: This file is the general header file included by */ 11 /* all of the .c source files. It contains global */ 12 /* definitions and the compiler flags which must be edited */ 13 /* to create a version for a specific machine, operating */ 14 /* system, or feature set. */ 15 /* */ 16 /* Principal Programmer(s): */ 17 /* Gary D. Riley */ 18 /* Brian L. Dantes */ 19 /* */ 20 /* Contributing Programmer(s): */ 21 /* */ 22 /* Revision History: */ 23 /* */ 24 /* 6.24: Default locale modification. */ 25 /* */ 26 /* Removed CONFLICT_RESOLUTION_STRATEGIES, */ 27 /* DYNAMIC_SALIENCE, INCREMENTAL_RESET, */ 28 /* LOGICAL_DEPENDENCIES, IMPERATIVE_METHODS, */ 29 /* INSTANCE_PATTERN_MATCHING, and */ 30 /* IMPERATIVE_MESSAGE_HANDLERS, and */ 31 /* AUXILIARY_MESSAGE_HANDLERS compilation flags. */ 32 /* */ 33 /* Removed the SHORT_LINK_NAMES compilation flag. */ 34 /* */ 35 /* Renamed BOOLEAN macro type to intBool. */ 36 /* */ 37 /* 6.30: Removed conditional code for unsupported */ 38 /* compilers/operating systems (IBM_MCW, */ 39 /* MAC_MCW, IBM_ICB, IBM_TBC, IBM_ZTC, and */ 40 /* IBM_SC). */ 41 /* */ 42 /* Renamed IBM_MSC and WIN_MVC compiler flags */ 43 /* and IBM_GCC to WIN_GCC. */ 44 /* */ 45 /* Added LINUX and DARWIN compiler flags. */ 46 /* */ 47 /* Removed HELP_FUNCTIONS compilation flag and */ 48 /* associated functionality. */ 49 /* */ 50 /* Removed EMACS_EDITOR compilation flag and */ 51 /* associated functionality. */ 52 /* */ 53 /* Combined BASIC_IO and EXT_IO compilation */ 54 /* flags into the single IO_FUNCTIONS flag. */ 55 /* */ 56 /* Used #ifndef for preprocessor definitions so */ 57 /* they can be set at the project or makefile */ 58 /* level. */ 59 /* */ 60 /* Removed ENVIRONMENT_API_ONLY compilation flag. */ 61 /* */ 62 /* Combined BASIC_IO and EXT_IO compilation */ 63 /* flags into the IO_FUNCTIONS compilation flag. */ 64 /* */ 65 /* Changed the EX_MATH compilation flag to */ 66 /* EXTENDED_MATH_FUNCTIONS. */ 67 /* */ 68 /* Removed VOID definition because of conflict */ 69 /* with Windows.h header file. */ 70 /* */ 71 /* Removed deprecated definitions. */ 72 /* */ 73 /* The ALLOW_ENVIRONMENT_GLOBALS flag now */ 74 /* defaults to 0. The use of functions enabled */ 75 /* by this flag is deprecated. */ 76 /* */ 77 /* Removed support for BLOCK_MEMORY. */ 78 /* */ 79 /*************************************************************/ 80 81 #ifndef _H_setup 82 #define _H_setup 83 84 /****************************************************************/ 85 /* -------------------- COMPILER FLAGS ------------------------ */ 86 /****************************************************************/ 87 88 /*********************************************************************/ 89 /* Flag denoting the environment in which the executable is to run. */ 90 /* Only one of these flags should be turned on (set to 1) at a time. */ 91 /*********************************************************************/ 92 93 #ifndef UNIX_V 94 #define UNIX_V 0 /* UNIX System V, 4.2bsd, or HP Unix, presumably with gcc */ 95 #endif 96 97 #ifndef UNIX_7 98 #define UNIX_7 0 /* UNIX System III Version 7 or Sun Unix, presumably with gcc */ 99 #endif 100 101 #ifndef LINUX 102 #define LINUX 0 /* Untested, presumably with gcc */ 103 #endif 104 105 #ifndef DARWIN 106 #define DARWIN 0 /* Darwin Mac OS 10.10.2, presumably with gcc or Xcode 6.2 with Console */ 107 #endif 108 109 #ifndef MAC_XCD 110 #define MAC_XCD 0 /* MacOS 10.10.2, with Xcode 6.2 and Cocoa GUI */ 111 #endif 112 113 #ifndef WIN_MVC 114 #define WIN_MVC 0 /* Windows 7, with Visual Studio 2013 */ 115 #endif 116 117 /* The following are unsupported: */ 118 119 #ifndef WIN_GCC 120 #define WIN_GCC 0 /* Windows XP, with DJGPP 3.21 */ 121 #endif 122 123 #ifndef VAX_VMS 124 #define VAX_VMS 0 /* VAX VMS */ 125 #endif 126 127 /* Use GENERIC if nothing else is used. */ 128 129 #ifndef GENERIC 130 #if (! UNIX_V) && (! LINUX) && (! UNIX_7) && \ 131 (! MAC_XCD) && (! DARWIN) && \ 132 (! WIN_MVC) && (! WIN_GCC) && \ 133 (! VAX_VMS) 134 #define GENERIC 1 /* Generic (any machine) */ 135 #else 136 #define GENERIC 0 /* Generic (any machine) */ 137 #endif 138 #endif 139 140 #if WIN_MVC 141 #define IBM 1 142 #else 143 #define IBM 0 144 #endif 145 146 /***********************************************/ 147 /* Some definitions for use with declarations. */ 148 /***********************************************/ 149 150 #define VOID_ARG void 151 #define STD_SIZE size_t 152 153 #define intBool int 154 #define globle 155 156 /*******************************************/ 157 /* RUN_TIME: Specifies whether a run-time */ 158 /* module is being created. */ 159 /*******************************************/ 160 161 #ifndef RUN_TIME 162 #define RUN_TIME 0 163 #endif 164 165 /*************************************************/ 166 /* DEFRULE_CONSTRUCT: Determines whether defrule */ 167 /* construct is included. */ 168 /*************************************************/ 169 170 #ifndef DEFRULE_CONSTRUCT 171 #define DEFRULE_CONSTRUCT 1 172 #endif 173 174 /************************************************/ 175 /* DEFMODULE_CONSTRUCT: Determines whether the */ 176 /* defmodule construct is included. */ 177 /************************************************/ 178 179 #ifndef DEFMODULE_CONSTRUCT 180 #define DEFMODULE_CONSTRUCT 1 181 #endif 182 183 /****************************************************/ 184 /* DEFTEMPLATE_CONSTRUCT: Determines whether facts */ 185 /* and the deftemplate construct are included. */ 186 /****************************************************/ 187 188 #ifndef DEFTEMPLATE_CONSTRUCT 189 #define DEFTEMPLATE_CONSTRUCT 1 190 #endif 191 192 #if ! DEFRULE_CONSTRUCT 193 #undef DEFTEMPLATE_CONSTRUCT 194 #define DEFTEMPLATE_CONSTRUCT 0 195 #endif 196 197 /************************************************************/ 198 /* FACT_SET_QUERIES: Determines if fact-set query functions */ 199 /* such as any-factp and do-for-all-facts are included. */ 200 /************************************************************/ 201 202 #ifndef FACT_SET_QUERIES 203 #define FACT_SET_QUERIES 1 204 #endif 205 206 #if ! DEFTEMPLATE_CONSTRUCT 207 #undef FACT_SET_QUERIES 208 #define FACT_SET_QUERIES 0 209 #endif 210 211 /****************************************************/ 212 /* DEFFACTS_CONSTRUCT: Determines whether deffacts */ 213 /* construct is included. */ 214 /****************************************************/ 215 216 #ifndef DEFFACTS_CONSTRUCT 217 #define DEFFACTS_CONSTRUCT 1 218 #endif 219 220 #if ! DEFTEMPLATE_CONSTRUCT 221 #undef DEFFACTS_CONSTRUCT 222 #define DEFFACTS_CONSTRUCT 0 223 #endif 224 225 /************************************************/ 226 /* DEFGLOBAL_CONSTRUCT: Determines whether the */ 227 /* defglobal construct is included. */ 228 /************************************************/ 229 230 #ifndef DEFGLOBAL_CONSTRUCT 231 #define DEFGLOBAL_CONSTRUCT 1 232 #endif 233 234 /**********************************************/ 235 /* DEFFUNCTION_CONSTRUCT: Determines whether */ 236 /* deffunction construct is included. */ 237 /**********************************************/ 238 239 #ifndef DEFFUNCTION_CONSTRUCT 240 #define DEFFUNCTION_CONSTRUCT 1 241 #endif 242 243 /*********************************************/ 244 /* DEFGENERIC_CONSTRUCT: Determines whether */ 245 /* generic functions are included. */ 246 /*********************************************/ 247 248 #ifndef DEFGENERIC_CONSTRUCT 249 #define DEFGENERIC_CONSTRUCT 1 250 #endif 251 252 /*****************************************************************/ 253 /* OBJECT_SYSTEM: Determines whether object system is included. */ 254 /* The MULTIFIELD_FUNCTIONS flag should also be on if you want */ 255 /* to be able to manipulate multi-field slots. */ 256 /*****************************************************************/ 257 258 #ifndef OBJECT_SYSTEM 259 #define OBJECT_SYSTEM 1 260 #endif 261 262 /*****************************************************************/ 263 /* DEFINSTANCES_CONSTRUCT: Determines whether the definstances */ 264 /* construct is enabled. */ 265 /*****************************************************************/ 266 267 #ifndef DEFINSTANCES_CONSTRUCT 268 #define DEFINSTANCES_CONSTRUCT 1 269 #endif 270 271 #if ! OBJECT_SYSTEM 272 #undef DEFINSTANCES_CONSTRUCT 273 #define DEFINSTANCES_CONSTRUCT 0 274 #endif 275 276 /********************************************************************/ 277 /* INSTANCE_SET_QUERIES: Determines if instance-set query functions */ 278 /* such as any-instancep and do-for-all-instances are included. */ 279 /********************************************************************/ 280 281 #ifndef INSTANCE_SET_QUERIES 282 #define INSTANCE_SET_QUERIES 1 283 #endif 284 285 #if ! OBJECT_SYSTEM 286 #undef INSTANCE_SET_QUERIES 287 #define INSTANCE_SET_QUERIES 0 288 #endif 289 290 /******************************************************************/ 291 /* Check for consistencies associated with the defrule construct. */ 292 /******************************************************************/ 293 294 #if (! DEFTEMPLATE_CONSTRUCT) && (! OBJECT_SYSTEM) 295 #undef DEFRULE_CONSTRUCT 296 #define DEFRULE_CONSTRUCT 0 297 #endif 298 299 /*******************************************************************/ 300 /* BLOAD/BSAVE_INSTANCES: Determines if the save/restore-instances */ 301 /* functions can be enhanced to perform more quickly by using */ 302 /* binary files */ 303 /*******************************************************************/ 304 305 #ifndef BLOAD_INSTANCES 306 #define BLOAD_INSTANCES 1 307 #endif 308 #ifndef BSAVE_INSTANCES 309 #define BSAVE_INSTANCES 1 310 #endif 311 312 #if ! OBJECT_SYSTEM 313 #undef BLOAD_INSTANCES 314 #undef BSAVE_INSTANCES 315 #define BLOAD_INSTANCES 0 316 #define BSAVE_INSTANCES 0 317 #endif 318 319 /****************************************************************/ 320 /* EXTENDED MATH PACKAGE FLAG: If this is on, then the extended */ 321 /* math package functions will be available for use, (normal */ 322 /* default). If this flag is off, then the extended math */ 323 /* functions will not be available, and the 30K or so of space */ 324 /* they require will be free. Usually a concern only on PC type */ 325 /* machines. */ 326 /****************************************************************/ 327 328 #ifndef EXTENDED_MATH_FUNCTIONS 329 #define EXTENDED_MATH_FUNCTIONS 1 330 #endif 331 332 /****************************************************************/ 333 /* TEXT PROCESSING : Turn on this flag for support of the */ 334 /* hierarchical lookup system. */ 335 /****************************************************************/ 336 337 #ifndef TEXTPRO_FUNCTIONS 338 #define TEXTPRO_FUNCTIONS 1 339 #endif 340 341 /*************************************************************************/ 342 /* BLOAD_ONLY: Enables bload command and disables the load command. */ 343 /* BLOAD: Enables bload command. */ 344 /* BLOAD_AND_BSAVE: Enables bload, and bsave commands. */ 345 /*************************************************************************/ 346 347 #ifndef BLOAD_ONLY 348 #define BLOAD_ONLY 0 349 #endif 350 #ifndef BLOAD 351 #define BLOAD 0 352 #endif 353 #ifndef BLOAD_AND_BSAVE 354 #define BLOAD_AND_BSAVE 1 355 #endif 356 357 #if RUN_TIME 358 #undef BLOAD_ONLY 359 #define BLOAD_ONLY 0 360 #undef BLOAD 361 #define BLOAD 0 362 #undef BLOAD_AND_BSAVE 363 #define BLOAD_AND_BSAVE 0 364 #endif 365 366 /********************************************************************/ 367 /* CONSTRUCT COMPILER: If this flag is turned on, you can generate */ 368 /* C code representing the constructs in the current environment. */ 369 /* With the RUN_TIME flag set, this code can be compiled and */ 370 /* linked to create a stand-alone run-time executable. */ 371 /********************************************************************/ 372 373 #ifndef CONSTRUCT_COMPILER 374 #define CONSTRUCT_COMPILER 1 375 #endif 376 377 #if CONSTRUCT_COMPILER 378 #define API_HEADER "clips.h" 379 #endif 380 381 /************************************************/ 382 /* IO_FUNCTIONS: Includes printout, read, open, */ 383 /* close, format, and readline functions. */ 384 /************************************************/ 385 386 #ifndef IO_FUNCTIONS 387 #define IO_FUNCTIONS 1 388 #endif 389 390 /************************************************/ 391 /* STRING_FUNCTIONS: Includes string functions: */ 392 /* str-length, str-compare, upcase, lowcase, */ 393 /* sub-string, str-index, and eval. */ 394 /************************************************/ 395 396 #ifndef STRING_FUNCTIONS 397 #define STRING_FUNCTIONS 1 398 #endif 399 400 /*********************************************/ 401 /* MULTIFIELD_FUNCTIONS: Includes multifield */ 402 /* functions: mv-subseq, mv-delete, */ 403 /* mv-append, str-explode, str-implode. */ 404 /*********************************************/ 405 406 #ifndef MULTIFIELD_FUNCTIONS 407 #define MULTIFIELD_FUNCTIONS 1 408 #endif 409 410 /****************************************************/ 411 /* DEBUGGING_FUNCTIONS: Includes functions such as */ 412 /* rules, facts, matches, ppdefrule, etc. */ 413 /****************************************************/ 414 415 #ifndef DEBUGGING_FUNCTIONS 416 #define DEBUGGING_FUNCTIONS 1 417 #endif 418 419 /***************************************************/ 420 /* PROFILING_FUNCTIONS: Enables code for profiling */ 421 /* constructs and user functions. */ 422 /***************************************************/ 423 424 #ifndef PROFILING_FUNCTIONS 425 #define PROFILING_FUNCTIONS 1 426 #endif 427 428 /*******************************************************************/ 429 /* WINDOW_INTERFACE : Set this flag if you are recompiling any of */ 430 /* the machine specific GUI interfaces. Currently, when enabled, */ 431 /* this flag disables the more processing used by the help */ 432 /* system. This flag also prevents any input or output being */ 433 /* directly sent to stdin or stdout. */ 434 /*******************************************************************/ 435 436 #ifndef WINDOW_INTERFACE 437 #define WINDOW_INTERFACE 0 438 #endif 439 440 /*************************************************************/ 441 /* ALLOW_ENVIRONMENT_GLOBALS: If enabled, tracks the current */ 442 /* environment and allows environments to be referred to */ 443 /* by index. If disabled, CLIPS makes no use of global */ 444 /* variables. */ 445 /*************************************************************/ 446 447 #ifndef ALLOW_ENVIRONMENT_GLOBALS 448 #define ALLOW_ENVIRONMENT_GLOBALS 0 449 #endif 450 451 /********************************************/ 452 /* DEVELOPER: Enables code for debugging a */ 453 /* development version of the executable. */ 454 /********************************************/ 455 456 #ifndef DEVELOPER 457 #define DEVELOPER 0 458 #endif 459 460 #if DEVELOPER 461 #include <assert.h> 462 #define Bogus(x) assert(! (x)) 463 #else 464 #define Bogus(x) 465 #endif 466 467 /***************************/ 468 /* Environment Definitions */ 469 /***************************/ 470 471 #include "envrnmnt.h" 472 473 /*************************************************/ 474 /* Any user defined global setup information can */ 475 /* be included in the file usrsetup.h which is */ 476 /* an empty file in the baseline version. */ 477 /*************************************************/ 478 479 #include "usrsetup.h" 480 481 #endif /* _H_setup */ 482 483 484 485 486 487 488 489 490 491 492