diff options
Diffstat (limited to 'src/engine.h')
-rw-r--r-- | src/engine.h | 149 |
1 files changed, 90 insertions, 59 deletions
diff --git a/src/engine.h b/src/engine.h index 5427b5f..d687455 100644 --- a/src/engine.h +++ b/src/engine.h @@ -1,7 +1,7 @@ /*******************************************************/ /* "C" Language Integrated Production System */ /* */ - /* CLIPS Version 6.24 05/17/06 */ + /* CLIPS Version 6.30 02/04/15 */ /* */ /* ENGINE HEADER FILE */ /*******************************************************/ @@ -16,11 +16,14 @@ /* Contributing Programmer(s): */ /* */ /* Revision History: */ -/* 6.23: Corrected compilation errors for files */ +/* */ +/* 6.23: Correction for FalseSymbol/TrueSymbol. DR0859 */ +/* */ +/* Corrected compilation errors for files */ /* generated by constructs-to-c. DR0861 */ /* */ -/* 6.24: Removed INCREMENTAL_RESET and */ -/* LOGICAL_DEPENDENCIES compilation flag. */ +/* 6.24: Removed DYNAMIC_SALIENCE, INCREMENTAL_RESET, */ +/* and LOGICAL_DEPENDENCIES compilation flags. */ /* */ /* Renamed BOOLEAN macro type to intBool. */ /* */ @@ -29,6 +32,31 @@ /* Added EnvGetNextFocus, EnvGetFocusChanged, and */ /* EnvSetFocusChanged functions. */ /* */ +/* 6.30: Added additional developer statistics to help */ +/* analyze join network performance. */ +/* */ +/* Removed pseudo-facts used in not CEs. */ +/* */ +/* Added context information for run functions. */ +/* */ +/* Added before rule firing callback function. */ +/* */ +/* Changed garbage collection algorithm. */ +/* */ +/* Changed integer type/precision. */ +/* */ +/* Added EnvHalt function. */ +/* */ +/* Used gensprintf instead of sprintf. */ +/* */ +/* Removed conditional code for unsupported */ +/* compilers/operating systems (IBM_MCW, */ +/* MAC_MCW, and IBM_TBC). */ +/* Added const qualifiers to remove C++ */ +/* deprecation warnings. */ +/* */ +/* Converted API macros to function calls. */ +/* */ /*************************************************************/ #ifndef _H_engine @@ -57,17 +85,19 @@ struct focus struct defruleModule *theDefruleModule; struct focus *next; }; - + #define ENGINE_DATA 18 struct engineData - { + { struct defrule *ExecutingRule; intBool HaltRules; struct joinNode *TheLogicalJoin; + struct partialMatch *TheLogicalBind; struct dependency *UnsupportedDataEntities; int alreadyEntered; struct callFunctionItem *ListOfRunFunctions; + struct callFunctionItemWithArg *ListOfBeforeRunFunctions; struct focus *CurrentFocus; int FocusChanged; #if DEBUGGING_FUNCTIONS @@ -80,14 +110,27 @@ struct engineData struct partialMatch *GlobalLHSBinds; struct partialMatch *GlobalRHSBinds; struct joinNode *GlobalJoin; - struct rdriveinfo *DriveRetractionList; struct partialMatch *GarbagePartialMatches; struct alphaMatch *GarbageAlphaMatches; int AlreadyRunning; +#if DEVELOPER + long leftToRightComparisons; + long rightToLeftComparisons; + long leftToRightSucceeds; + long rightToLeftSucceeds; + long leftToRightLoops; + long rightToLeftLoops; + long findNextConflictingComparisons; + long betaHashHTSkips; + long betaHashListSkips; + long unneededMarkerCompare; +#endif }; #define EngineData(theEnv) ((struct engineData *) GetEnvironmentData(theEnv,ENGINE_DATA)) +#define MAX_PATTERNS_CHECKED 64 + #ifdef LOCALE #undef LOCALE #endif @@ -98,61 +141,23 @@ struct engineData #define LOCALE extern #endif -/**************************************************************/ -/* The GetFocus function is remapped under certain conditions */ -/* because it conflicts with a Windows 3.1 function. */ -/**************************************************************/ -/* -#if ! ((GENERIC || IBM) && WINDOW_INTERFACE) -#define WRGetFocus GetFocus -#endif -*/ -#define MAX_PATTERNS_CHECKED 64 - -#if ENVIRONMENT_API_ONLY -#define ClearFocusStack(theEnv) EnvClearFocusStack(theEnv) -#define DefruleHasBreakpoint(theEnv,a) EnvDefruleHasBreakpoint(theEnv,a) -#define Focus(theEnv,a) EnvFocus(theEnv,a) -#define GetFocus(theEnv) EnvGetFocus(theEnv) -#define GetFocusChanged(theEnv) EnvGetFocusChanged(theEnv) -#define GetFocusStack(theEnv,a) EnvGetFocusStack(theEnv,a) -#define GetNextFocus(theEnv,a) EnvGetNextFocus(theEnv,a) -#define ListFocusStack(theEnv,a) EnvListFocusStack(theEnv,a) -#define PopFocus(theEnv) EnvPopFocus(theEnv) -#define RemoveBreak(theEnv,a) EnvRemoveBreak(theEnv,a) -#define RemoveRunFunction(theEnv,a) EnvRemoveRunFunction(theEnv,a) -#define Run(theEnv,a) EnvRun(theEnv,a) -#define SetBreak(theEnv,a) EnvSetBreak(theEnv,a) -#define SetFocusChanged(theEnv,a) EnvSetFocusChanged(theEnv,a) -#define ShowBreaks(theEnv,a,b) EnvShowBreaks(theEnv,a,b) -#else -#define ClearFocusStack() EnvClearFocusStack(GetCurrentEnvironment()) -#define DefruleHasBreakpoint(a) EnvDefruleHasBreakpoint(GetCurrentEnvironment(),a) -#define Focus(a) EnvFocus(GetCurrentEnvironment(),a) -#define GetFocus() EnvGetFocus(GetCurrentEnvironment()) -#define GetFocusChanged() EnvGetFocusChanged(GetCurrentEnvironment()) -#define GetFocusStack(a) EnvGetFocusStack(GetCurrentEnvironment(),a) -#define GetNextFocus(a) EnvGetNextFocus(GetCurrentEnvironment(),a) -#define ListFocusStack(a) EnvListFocusStack(GetCurrentEnvironment(),a) -#define PopFocus() EnvPopFocus(GetCurrentEnvironment()) -#define RemoveBreak(a) EnvRemoveBreak(GetCurrentEnvironment(),a) -#define RemoveRunFunction(a) EnvRemoveRunFunction(GetCurrentEnvironment(),a) -#define Run(a) EnvRun(GetCurrentEnvironment(),a) -#define SetBreak(a) EnvSetBreak(GetCurrentEnvironment(),a) -#define SetFocusChanged(a) EnvSetFocusChanged(GetCurrentEnvironment(),a) -#define ShowBreaks(a,b) EnvShowBreaks(GetCurrentEnvironment(),a,b) -#endif - - LOCALE intBool EnvAddRunFunction(void *,char *, + LOCALE long long EnvRun(void *,long long); + LOCALE intBool EnvAddRunFunction(void *,const char *, void (*)(void *),int); - LOCALE intBool AddRunFunction(char *,void (*)(void),int); - LOCALE long EnvRun(void *,long); - LOCALE intBool EnvRemoveRunFunction(void *,char *); + LOCALE intBool EnvAddRunFunctionWithContext(void *,const char *, + void (*)(void *),int,void *); + LOCALE intBool EnvRemoveRunFunction(void *,const char *); + LOCALE intBool EnvAddBeforeRunFunction(void *,const char *, + void (*)(void *,void *),int); + LOCALE intBool EnvAddBeforeRunFunctionWithContext(void *,const char *, + void (*)(void *, void *),int,void *); + LOCALE intBool EnvRemoveBeforeRunFunction(void *,const char *); LOCALE void InitializeEngine(void *); LOCALE void EnvSetBreak(void *,void *); + LOCALE void EnvHalt(void *); LOCALE intBool EnvRemoveBreak(void *,void *); LOCALE void RemoveAllBreakpoints(void *); - LOCALE void EnvShowBreaks(void *,char *,void *); + LOCALE void EnvShowBreaks(void *,const char *,void *); LOCALE intBool EnvDefruleHasBreakpoint(void *,void *); LOCALE void RunCommand(void *); LOCALE void SetBreakCommand(void *); @@ -167,7 +172,7 @@ struct engineData LOCALE int EnvGetFocusChanged(void *); LOCALE void EnvSetFocusChanged(void *,int); LOCALE void ListFocusStackCommand(void *); - LOCALE void EnvListFocusStack(void *,char *); + LOCALE void EnvListFocusStack(void *,const char *); LOCALE void GetFocusStackFunction(void *,DATA_OBJECT_PTR); LOCALE void EnvGetFocusStack(void *,DATA_OBJECT_PTR); LOCALE void *PopFocusFunction(void *); @@ -176,9 +181,35 @@ struct engineData LOCALE void *EnvGetFocus(void *); LOCALE intBool EnvGetHaltRules(void *); LOCALE void EnvSetHaltRules(void *,intBool); - + LOCALE struct activation *NextActivationToFire(void *); + +#if ALLOW_ENVIRONMENT_GLOBALS + + LOCALE intBool AddBeforeRunFunction(const char *,void (*)(void *),int); + LOCALE intBool AddRunFunction(const char *,void (*)(void),int); + LOCALE void ClearFocusStack(void); + LOCALE void Focus(void *); + LOCALE void GetFocusStack(DATA_OBJECT_PTR); + LOCALE void *GetFocus(void); + LOCALE int GetFocusChanged(void); + LOCALE void *GetNextFocus(void *); + LOCALE void Halt(void); + LOCALE void *PopFocus(void); + LOCALE intBool RemoveRunFunction(const char *); + LOCALE long long Run(long long); + LOCALE void SetFocusChanged(int); +#if DEBUGGING_FUNCTIONS + LOCALE intBool DefruleHasBreakpoint(void *); + LOCALE void ListFocusStack(const char *); + LOCALE intBool RemoveBreak(void *); + LOCALE void SetBreak(void *); + LOCALE void ShowBreaks(const char *,void *); #endif +#endif /* ALLOW_ENVIRONMENT_GLOBALS */ + +#endif /* _H_engine */ + |