1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
/*******************************************************/
/* "C" Language Integrated Production System */
/* */
/* CLIPS Version 6.24 05/17/06 */
/* */
/* ENGINE HEADER FILE */
/*******************************************************/
/*************************************************************/
/* Purpose: Provides functionality primarily associated with */
/* the run and focus commands. */
/* */
/* Principal Programmer(s): */
/* Gary D. Riley */
/* */
/* Contributing Programmer(s): */
/* */
/* Revision History: */
/* 6.23: Corrected compilation errors for files */
/* generated by constructs-to-c. DR0861 */
/* */
/* 6.24: Removed INCREMENTAL_RESET and */
/* LOGICAL_DEPENDENCIES compilation flag. */
/* */
/* Renamed BOOLEAN macro type to intBool. */
/* */
/* Added access functions to the HaltRules flag. */
/* */
/* Added EnvGetNextFocus, EnvGetFocusChanged, and */
/* EnvSetFocusChanged functions. */
/* */
/*************************************************************/
#ifndef _H_engine
#define _H_engine
#ifndef _H_lgcldpnd
#include "lgcldpnd.h"
#endif
#ifndef _H_ruledef
#include "ruledef.h"
#endif
#ifndef _H_network
#include "network.h"
#endif
#ifndef _H_moduldef
#include "moduldef.h"
#endif
#ifndef _H_retract
#include "retract.h"
#endif
struct focus
{
struct defmodule *theModule;
struct defruleModule *theDefruleModule;
struct focus *next;
};
#define ENGINE_DATA 18
struct engineData
{
struct defrule *ExecutingRule;
intBool HaltRules;
struct joinNode *TheLogicalJoin;
struct dependency *UnsupportedDataEntities;
int alreadyEntered;
struct callFunctionItem *ListOfRunFunctions;
struct focus *CurrentFocus;
int FocusChanged;
#if DEBUGGING_FUNCTIONS
unsigned WatchStatistics;
unsigned WatchFocus;
#endif
intBool IncrementalResetInProgress;
intBool IncrementalResetFlag;
intBool JoinOperationInProgress;
struct partialMatch *GlobalLHSBinds;
struct partialMatch *GlobalRHSBinds;
struct joinNode *GlobalJoin;
struct rdriveinfo *DriveRetractionList;
struct partialMatch *GarbagePartialMatches;
struct alphaMatch *GarbageAlphaMatches;
int AlreadyRunning;
};
#define EngineData(theEnv) ((struct engineData *) GetEnvironmentData(theEnv,ENGINE_DATA))
#ifdef LOCALE
#undef LOCALE
#endif
#ifdef _ENGINE_SOURCE_
#define LOCALE
#else
#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 *,
void (*)(void *),int);
LOCALE intBool AddRunFunction(char *,void (*)(void),int);
LOCALE long EnvRun(void *,long);
LOCALE intBool EnvRemoveRunFunction(void *,char *);
LOCALE void InitializeEngine(void *);
LOCALE void EnvSetBreak(void *,void *);
LOCALE intBool EnvRemoveBreak(void *,void *);
LOCALE void RemoveAllBreakpoints(void *);
LOCALE void EnvShowBreaks(void *,char *,void *);
LOCALE intBool EnvDefruleHasBreakpoint(void *,void *);
LOCALE void RunCommand(void *);
LOCALE void SetBreakCommand(void *);
LOCALE void RemoveBreakCommand(void *);
LOCALE void ShowBreaksCommand(void *);
LOCALE void HaltCommand(void *);
LOCALE int FocusCommand(void *);
LOCALE void ClearFocusStackCommand(void *);
LOCALE void EnvClearFocusStack(void *);
LOCALE void *EnvGetNextFocus(void *,void *);
LOCALE void EnvFocus(void *,void *);
LOCALE int EnvGetFocusChanged(void *);
LOCALE void EnvSetFocusChanged(void *,int);
LOCALE void ListFocusStackCommand(void *);
LOCALE void EnvListFocusStack(void *,char *);
LOCALE void GetFocusStackFunction(void *,DATA_OBJECT_PTR);
LOCALE void EnvGetFocusStack(void *,DATA_OBJECT_PTR);
LOCALE void *PopFocusFunction(void *);
LOCALE void *GetFocusFunction(void *);
LOCALE void *EnvPopFocus(void *);
LOCALE void *EnvGetFocus(void *);
LOCALE intBool EnvGetHaltRules(void *);
LOCALE void EnvSetHaltRules(void *,intBool);
#endif
|