00001 /*******************************************************/ 00002 /* "C" Language Integrated Production System */ 00003 /* */ 00004 /* CLIPS Version 6.30 12/07/07 */ 00005 /* */ 00006 /* SETUP HEADER FILE */ 00007 /*******************************************************/ 00008 00009 /*************************************************************/ 00010 /* Purpose: This file is the general header file included by */ 00011 /* all of the .c source files. It contains global */ 00012 /* definitions and the compiler flags which must be edited */ 00013 /* to create a version for a specific machine, operating */ 00014 /* system, or feature set. */ 00015 /* */ 00016 /* Principal Programmer(s): */ 00017 /* Gary D. Riley */ 00018 /* Brian L. Dantes */ 00019 /* */ 00020 /* Contributing Programmer(s): */ 00021 /* */ 00022 /* Revision History: */ 00023 /* 6.24: Default locale modification. */ 00024 /* */ 00025 /* Removed CONFLICT_RESOLUTION_STRATEGIES, */ 00026 /* DYNAMIC_SALIENCE, INCREMENTAL_RESET, */ 00027 /* LOGICAL_DEPENDENCIES, IMPERATIVE_METHODS, */ 00028 /* INSTANCE_PATTERN_MATCHING, and */ 00029 /* IMPERATIVE_MESSAGE_HANDLERS, and */ 00030 /* AUXILIARY_MESSAGE_HANDLERS compilation flags. */ 00031 /* */ 00032 /* Removed the SHORT_LINK_NAMES compilation flag. */ 00033 /* */ 00034 /* Renamed BOOLEAN macro type to intBool. */ 00035 /* */ 00036 /* 6.30: Used #ifndef for preprocessor definitions so */ 00037 /* they can be set at the project or makefile */ 00038 /* level. */ 00039 /* */ 00040 /* Removed ENVIRONMENT_API_ONLY compilation flag. */ 00041 /* */ 00042 /* Combined BASIC_IO and EXT_IO compilation */ 00043 /* flags into the IO_FUNCTIONS compilation flag. */ 00044 /* */ 00045 /* Changed the EX_MATH compilation flag to */ 00046 /* EXTENDED_MATH_FUNCTIONS. */ 00047 /* */ 00048 /* Removed VOID definition because of conflict */ 00049 /* with Windows.h header file. */ 00050 /* */ 00051 /*************************************************************/ 00052 00053 #ifndef _H_setup 00054 #define _H_setup 00055 00056 /****************************************************************/ 00057 /* -------------------- COMPILER FLAGS ------------------------ */ 00058 /****************************************************************/ 00059 00060 /*********************************************************************/ 00061 /* Flag denoting the environment in which the executable is to run. */ 00062 /* Only one of these flags should be turned on (set to 1) at a time. */ 00063 /*********************************************************************/ 00064 00065 #ifndef UNIX_V 00066 #define UNIX_V 0 /* UNIX System V, 4.2bsd, or HP Unix, presumably with gcc */ 00067 #endif 00068 00069 #ifndef UNIX_7 00070 #define UNIX_7 0 /* UNIX System III Version 7 or Sun Unix, presumably with gcc */ 00071 #endif 00072 00073 #ifndef LINUX 00074 #define LINUX 0 /* Untested, presumably with gcc */ 00075 #endif 00076 00077 #ifndef DARWIN 00078 #define DARWIN 0 /* Darwin Mac OS 10.5, presumably with gcc or Xcode 3.0 with Console */ 00079 #endif 00080 00081 #ifndef MAC_XCD 00082 #define MAC_XCD 0 /* MacOS 10.5, with Xcode 3.0 and Cocoa GUI */ 00083 #endif 00084 00085 #ifndef MAC_MCW 00086 #define MAC_MCW 0 /* MacOS 10.5, with CodeWarrior 9.6 */ 00087 #endif 00088 00089 #ifndef WIN_MVC 00090 #define WIN_MVC 0 /* Windows XP, with VC++ 2008 Express */ 00091 #endif 00092 00093 #ifndef WIN_BTC 00094 #define WIN_BTC 0 /* Windows XP, with Borland Turbo C++ 2006 */ 00095 #endif 00096 00097 #ifndef WIN_MCW 00098 #define WIN_MCW 0 /* Windows XP, with CodeWarrior 9.4 */ 00099 #endif 00100 00101 #ifndef WIN_GCC 00102 #define WIN_GCC 0 /* Windows XP, with DJGPP 3.21 */ 00103 #endif 00104 00105 /* The following are unsupported: */ 00106 00107 #ifndef VAX_VMS 00108 #define VAX_VMS 0 /* VAX VMS */ 00109 #endif 00110 00111 /* Use GENERIC if nothing else is used. */ 00112 00113 #ifndef GENERIC 00114 #if (! UNIX_V) && (! LINUX) && (! UNIX_7) && \ 00115 (! MAC_XCD) && (! MAC_MCW) && (! DARWIN) && \ 00116 (! WIN_MVC) && (! WIN_BTC) && (! WIN_MCW) && (! WIN_GCC) && \ 00117 (! VAX_VMS) 00118 #define GENERIC 1 /* Generic (any machine) */ 00119 #else 00120 #define GENERIC 0 /* Generic (any machine) */ 00121 #endif 00122 #endif 00123 00124 #if WIN_MVC || WIN_BTC || WIN_MCW 00125 #define IBM 1 00126 #else 00127 #define IBM 0 00128 #endif 00129 00130 /***********************************************/ 00131 /* Some definitions for use with declarations. */ 00132 /***********************************************/ 00133 00134 #define VOID_ARG void 00135 #define STD_SIZE size_t 00136 00137 #define intBool int 00138 #define globle 00139 00140 /*******************************************/ 00141 /* RUN_TIME: Specifies whether a run-time */ 00142 /* module is being created. */ 00143 /*******************************************/ 00144 00145 #ifndef RUN_TIME 00146 #define RUN_TIME 0 00147 #endif 00148 00149 /*************************************************/ 00150 /* DEFRULE_CONSTRUCT: Determines whether defrule */ 00151 /* construct is included. */ 00152 /*************************************************/ 00153 00154 #ifndef DEFRULE_CONSTRUCT 00155 #define DEFRULE_CONSTRUCT 1 00156 #endif 00157 00158 /************************************************/ 00159 /* DEFMODULE_CONSTRUCT: Determines whether the */ 00160 /* defmodule construct is included. */ 00161 /************************************************/ 00162 00163 #ifndef DEFMODULE_CONSTRUCT 00164 #define DEFMODULE_CONSTRUCT 1 00165 #endif 00166 00167 /****************************************************/ 00168 /* DEFTEMPLATE_CONSTRUCT: Determines whether facts */ 00169 /* and the deftemplate construct are included. */ 00170 /****************************************************/ 00171 00172 #ifndef DEFTEMPLATE_CONSTRUCT 00173 #define DEFTEMPLATE_CONSTRUCT 1 00174 #endif 00175 00176 #if ! DEFRULE_CONSTRUCT 00177 #undef DEFTEMPLATE_CONSTRUCT 00178 #define DEFTEMPLATE_CONSTRUCT 0 00179 #endif 00180 00181 /************************************************************/ 00182 /* FACT_SET_QUERIES: Determines if fact-set query functions */ 00183 /* such as any-factp and do-for-all-facts are included. */ 00184 /************************************************************/ 00185 00186 #ifndef FACT_SET_QUERIES 00187 #define FACT_SET_QUERIES 1 00188 #endif 00189 00190 #if ! DEFTEMPLATE_CONSTRUCT 00191 #undef FACT_SET_QUERIES 00192 #define FACT_SET_QUERIES 0 00193 #endif 00194 00195 /****************************************************/ 00196 /* DEFFACTS_CONSTRUCT: Determines whether deffacts */ 00197 /* construct is included. */ 00198 /****************************************************/ 00199 00200 #ifndef DEFFACT_CONSTRUCT 00201 #define DEFFACTS_CONSTRUCT 1 00202 #endif 00203 00204 #if ! DEFTEMPLATE_CONSTRUCT 00205 #undef DEFFACTS_CONSTRUCT 00206 #define DEFFACTS_CONSTRUCT 0 00207 #endif 00208 00209 /************************************************/ 00210 /* DEFGLOBAL_CONSTRUCT: Determines whether the */ 00211 /* defglobal construct is included. */ 00212 /************************************************/ 00213 00214 #ifndef DEFGLOBAL_CONSTRUCT 00215 #define DEFGLOBAL_CONSTRUCT 1 00216 #endif 00217 00218 /**********************************************/ 00219 /* DEFFUNCTION_CONSTRUCT: Determines whether */ 00220 /* deffunction construct is included. */ 00221 /**********************************************/ 00222 00223 #ifndef DEFFUNCTION_CONSTRUCT 00224 #define DEFFUNCTION_CONSTRUCT 1 00225 #endif 00226 00227 /*********************************************/ 00228 /* DEFGENERIC_CONSTRUCT: Determines whether */ 00229 /* generic functions are included. */ 00230 /*********************************************/ 00231 00232 #ifndef DEFGENERIC_CONSTRUCT 00233 #define DEFGENERIC_CONSTRUCT 1 00234 #endif 00235 00236 /*****************************************************************/ 00237 /* OBJECT_SYSTEM: Determines whether object system is included. */ 00238 /* The MULTIFIELD_FUNCTIONS flag should also be on if you want */ 00239 /* to be able to manipulate multi-field slots. */ 00240 /*****************************************************************/ 00241 00242 #ifndef OBJECT_SYSTEM 00243 #define OBJECT_SYSTEM 1 00244 #endif 00245 00246 /*****************************************************************/ 00247 /* DEFINSTANCES_CONSTRUCT: Determines whether the definstances */ 00248 /* construct is enabled. */ 00249 /*****************************************************************/ 00250 00251 #ifndef DEFINSTANCES_CONSTRUCT 00252 #define DEFINSTANCES_CONSTRUCT 1 00253 #endif 00254 00255 #if ! OBJECT_SYSTEM 00256 #undef DEFINSTANCES_CONSTRUCT 00257 #define DEFINSTANCES_CONSTRUCT 0 00258 #endif 00259 00260 /********************************************************************/ 00261 /* INSTANCE_SET_QUERIES: Determines if instance-set query functions */ 00262 /* such as any-instancep and do-for-all-instances are included. */ 00263 /********************************************************************/ 00264 00265 #ifndef INSTANCE_SET_QUERIES 00266 #define INSTANCE_SET_QUERIES 1 00267 #endif 00268 00269 #if ! OBJECT_SYSTEM 00270 #undef INSTANCE_SET_QUERIES 00271 #define INSTANCE_SET_QUERIES 0 00272 #endif 00273 00274 /******************************************************************/ 00275 /* Check for consistencies associated with the defrule construct. */ 00276 /******************************************************************/ 00277 00278 #if (! DEFTEMPLATE_CONSTRUCT) && (! OBJECT_SYSTEM) 00279 #undef DEFRULE_CONSTRUCT 00280 #define DEFRULE_CONSTRUCT 0 00281 #endif 00282 00283 /*******************************************************************/ 00284 /* BLOAD/BSAVE_INSTANCES: Determines if the save/restore-instances */ 00285 /* functions can be enhanced to perform more quickly by using */ 00286 /* binary files */ 00287 /*******************************************************************/ 00288 00289 #ifndef BLOAD_INSTANCES 00290 #define BLOAD_INSTANCES 1 00291 #endif 00292 #ifndef BSAVE_INSTANCES 00293 #define BSAVE_INSTANCES 1 00294 #endif 00295 00296 #if ! OBJECT_SYSTEM 00297 #undef BLOAD_INSTANCES 00298 #undef BSAVE_INSTANCES 00299 #define BLOAD_INSTANCES 0 00300 #define BSAVE_INSTANCES 0 00301 #endif 00302 00303 /****************************************************************/ 00304 /* EXTENDED MATH PACKAGE FLAG: If this is on, then the extended */ 00305 /* math package functions will be available for use, (normal */ 00306 /* default). If this flag is off, then the extended math */ 00307 /* functions will not be available, and the 30K or so of space */ 00308 /* they require will be free. Usually a concern only on PC type */ 00309 /* machines. */ 00310 /****************************************************************/ 00311 00312 #ifndef EXTENDED_MATH_FUNCTIONS 00313 #define EXTENDED_MATH_FUNCTIONS 1 00314 #endif 00315 00316 /****************************************************************/ 00317 /* TEXT PROCESSING : Turn on this flag for support of the */ 00318 /* hierarchical lookup system. */ 00319 /****************************************************************/ 00320 00321 #ifndef TEXTPRO_FUNCTIONS 00322 #define TEXTPRO_FUNCTIONS 1 00323 #endif 00324 00325 /****************************************************************/ 00326 /* HELP: To implement the help facility, set the flag below and */ 00327 /* specify the path and name of the help data file your system. */ 00328 /****************************************************************/ 00329 00330 #ifndef HELP_FUNCTIONS 00331 #define HELP_FUNCTIONS 1 00332 #endif 00333 00334 #if HELP_FUNCTIONS 00335 #define HELP_DEFAULT "clips.hlp" 00336 #endif 00337 00338 /*************************************************************************/ 00339 /* BLOAD_ONLY: Enables bload command and disables the load command. */ 00340 /* BLOAD: Enables bload command. */ 00341 /* BLOAD_AND_BSAVE: Enables bload, and bsave commands. */ 00342 /*************************************************************************/ 00343 00344 #ifndef BLOAD_ONLY 00345 #define BLOAD_ONLY 0 00346 #endif 00347 #ifndef BLOAD 00348 #define BLOAD 0 00349 #endif 00350 #ifndef BLOAD_AND_BSAVE 00351 #define BLOAD_AND_BSAVE 1 00352 #endif 00353 00354 #if RUN_TIME 00355 #undef BLOAD_ONLY 00356 #define BLOAD_ONLY 0 00357 #undef BLOAD 00358 #define BLOAD 0 00359 #undef BLOAD_AND_BSAVE 00360 #define BLOAD_AND_BSAVE 0 00361 #endif 00362 00363 /****************************************************************/ 00364 /* EMACS_EDITOR: If this flag is turned on, an integrated EMACS */ 00365 /* style editor can be utilized on supported machines. */ 00366 /****************************************************************/ 00367 00368 #ifndef EMACS_EDITOR 00369 #define EMACS_EDITOR 1 00370 #endif 00371 00372 #if GENERIC || MAC_XCD || MAC_MCW || WIN_MCW || WIN_BTC || WIN_MVC 00373 #undef EMACS_EDITOR 00374 #define EMACS_EDITOR 0 00375 #endif 00376 00377 /********************************************************************/ 00378 /* CONSTRUCT COMPILER: If this flag is turned on, you can generate */ 00379 /* C code representing the constructs in the current environment. */ 00380 /* With the RUN_TIME flag set, this code can be compiled and */ 00381 /* linked to create a stand-alone run-time executable. */ 00382 /********************************************************************/ 00383 00384 #ifndef CONSTRUCT_COMPILER 00385 #define CONSTRUCT_COMPILER 1 00386 #endif 00387 00388 #if CONSTRUCT_COMPILER 00389 #define API_HEADER "clips.h" 00390 #endif 00391 00392 /************************************************/ 00393 /* IO_FUNCTIONS: Includes printout, read, open, */ 00394 /* close, format, and readline functions. */ 00395 /************************************************/ 00396 00397 #ifndef IO_FUNCTIONS 00398 #define IO_FUNCTIONS 1 00399 #endif 00400 00401 /************************************************/ 00402 /* STRING_FUNCTIONS: Includes string functions: */ 00403 /* str-length, str-compare, upcase, lowcase, */ 00404 /* sub-string, str-index, and eval. */ 00405 /************************************************/ 00406 00407 #ifndef STRING_FUNCTIONS 00408 #define STRING_FUNCTIONS 1 00409 #endif 00410 00411 /*********************************************/ 00412 /* MULTIFIELD_FUNCTIONS: Includes multifield */ 00413 /* functions: mv-subseq, mv-delete, */ 00414 /* mv-append, str-explode, str-implode. */ 00415 /*********************************************/ 00416 00417 #ifndef MULTIFIELD_FUNCTIONS 00418 #define MULTIFIELD_FUNCTIONS 1 00419 #endif 00420 00421 /****************************************************/ 00422 /* DEBUGGING_FUNCTIONS: Includes functions such as */ 00423 /* rules, facts, matches, ppdefrule, etc. */ 00424 /****************************************************/ 00425 00426 #ifndef DEBUGGING_FUNCTIONS 00427 #define DEBUGGING_FUNCTIONS 1 00428 #endif 00429 00430 /***************************************************/ 00431 /* PROFILING_FUNCTIONS: Enables code for profiling */ 00432 /* constructs and user functions. */ 00433 /***************************************************/ 00434 00435 #ifndef PROFILING_FUNCTIONS 00436 #define PROFILING_FUNCTIONS 1 00437 #endif 00438 00439 /************************************************************************/ 00440 /* BLOCK_MEMORY: Causes memory to be allocated in large blocks. */ 00441 /* INITBUFFERSIZE and BLOCKSIZE should both be set to less than the */ 00442 /* maximum size of a signed integer. */ 00443 /************************************************************************/ 00444 00445 #ifndef BLOCK_MEMORY 00446 #define BLOCK_MEMORY 0 00447 #endif 00448 00449 #if BLOCK_MEMORY 00450 00451 #define INITBLOCKSIZE 32000 00452 #define BLOCKSIZE 32000 00453 00454 #endif 00455 00456 /*******************************************************************/ 00457 /* WINDOW_INTERFACE : Set this flag if you are recompiling any of */ 00458 /* the machine specific GUI interfaces. Currently, when enabled, */ 00459 /* this flag disables the more processing used by the help */ 00460 /* system. This flag also prevents any input or output being */ 00461 /* directly sent to stdin or stdout. */ 00462 /*******************************************************************/ 00463 00464 #ifndef WINDOW_INTERFACE 00465 #define WINDOW_INTERFACE 0 00466 #endif 00467 00468 #if WINDOW_INTERFACE 00469 #undef EMACS_EDITOR /* Editor can't be used with */ 00470 #define EMACS_EDITOR 0 /* windowed interface */ 00471 #endif 00472 00473 /*************************************************************/ 00474 /* ALLOW_ENVIRONMENT_GLOBALS: If enabled, tracks the current */ 00475 /* environment and allows environments to be referred to */ 00476 /* by index. If disabled, CLIPS makes no use of global */ 00477 /* variables. */ 00478 /*************************************************************/ 00479 00480 #ifndef ALLOW_ENVIRONMENT_GLOBALS 00481 #define ALLOW_ENVIRONMENT_GLOBALS 1 00482 #endif 00483 00484 #if ! ALLOW_ENVIRONMENT_GLOBALS 00485 #undef EMACS_EDITOR /* Editor can't be used without */ 00486 #define EMACS_EDITOR 0 /* environment globals */ 00487 #endif 00488 00489 /********************************************/ 00490 /* DEVELOPER: Enables code for debugging a */ 00491 /* development version of the executable. */ 00492 /********************************************/ 00493 00494 #ifndef DEVELOPER 00495 #define DEVELOPER 0 00496 #endif 00497 00498 #if DEVELOPER 00499 #include <assert.h> 00500 #define Bogus(x) assert(! (x)) 00501 #else 00502 #define Bogus(x) 00503 #endif 00504 00505 /***************************/ 00506 /* Environment Definitions */ 00507 /***************************/ 00508 00509 #include "envrnmnt.h" 00510 00511 /******************************/ 00512 /* Compatibilty Redefinitions */ 00513 /******************************/ 00514 00515 #define PrintCLIPS(x,y) EnvPrintRouter(GetCurrentEnvironment(),x,y) 00516 #define GetcCLIPS(x,y) EnvGetcRouter(GetCurrentEnvironment(),x) 00517 #define UngetcCLIPS(x,y) EnvUngetcRouter(GetCurrentEnvironment(),x,y) 00518 #define ExitCLIPS(x) EnvExitRouter(GetCurrentEnvironment(),x) 00519 #define CLIPSSystemError(x,y) SystemError(x,y) 00520 #define CLIPSFunctionCall(x,y,z) FunctionCall(x,y,z) 00521 #define InitializeCLIPS() InitializeEnvironment() 00522 #define WCLIPS WPROMPT 00523 #define CLIPSTrueSymbol EnvTrueSymbol(GetCurrentEnvironment()) 00524 #define CLIPSFalseSymbol EnvFalseSymbol(GetCurrentEnvironment()) 00525 #define EnvCLIPSTrueSymbol(theEnv) EnvTrueSymbol(theEnv) 00526 #define EnvCLIPSFalseSymbol(theEnv) EnvFalseSymbol(theEnv) 00527 #define CLIPS_FALSE 0 00528 #define CLIPS_TRUE 1 00529 00530 /*************************************************/ 00531 /* Any user defined global setup information can */ 00532 /* be included in the file usrsetup.h which is */ 00533 /* an empty file in the baseline version. */ 00534 /*************************************************/ 00535 00536 #include "usrsetup.h" 00537 00538 #endif /* _H_setup */ 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548
1.5.6