00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _H_constrct
00024
00025 #define _H_constrct
00026
00027 struct constructHeader;
00028 struct construct;
00029
00030 #ifndef _H_moduldef
00031 #include "moduldef.h"
00032 #endif
00033 #ifndef _H_symbol
00034 #include "symbol.h"
00035 #endif
00036
00037 #include "userdata.h"
00038
00039 struct constructHeader
00040 {
00041 struct symbolHashNode *name;
00042 char *ppForm;
00043 struct defmoduleItemHeader *whichModule;
00044 long bsaveID;
00045 struct constructHeader *next;
00046 struct userData *usrData;
00047 };
00048
00049 #define CHS (struct constructHeader *)
00050
00051 struct construct
00052 {
00053 char *constructName;
00054 char *pluralName;
00055 int (*parseFunction)(void *,char *);
00056 void *(*findFunction)(void *,char *);
00057 struct symbolHashNode *(*getConstructNameFunction)(struct constructHeader *);
00058 char *(*getPPFormFunction)(void *,struct constructHeader *);
00059 struct defmoduleItemHeader *(*getModuleItemFunction)(struct constructHeader *);
00060 void *(*getNextItemFunction)(void *,void *);
00061 void (*setNextItemFunction)(struct constructHeader *,struct constructHeader *);
00062 intBool (*isConstructDeletableFunction)(void *,void *);
00063 int (*deleteFunction)(void *,void *);
00064 void (*freeFunction)(void *,void *);
00065 struct construct *next;
00066 };
00067
00068 #ifndef _H_evaluatn
00069 #include "evaluatn.h"
00070 #endif
00071 #ifndef _H_scanner
00072 #include "scanner.h"
00073 #endif
00074
00075 #define CONSTRUCT_DATA 42
00076
00077 struct constructData
00078 {
00079 int ClearReadyInProgress;
00080 int ClearInProgress;
00081 int ResetReadyInProgress;
00082 int ResetInProgress;
00083 #if (! RUN_TIME) && (! BLOAD_ONLY)
00084 struct callFunctionItem *ListOfSaveFunctions;
00085 intBool PrintWhileLoading;
00086 unsigned WatchCompilations;
00087 #endif
00088 struct construct *ListOfConstructs;
00089 struct callFunctionItem *ListOfResetFunctions;
00090 struct callFunctionItem *ListOfClearFunctions;
00091 struct callFunctionItem *ListOfClearReadyFunctions;
00092 int Executing;
00093 int (*BeforeResetFunction)(void *);
00094 int CheckSyntaxMode;
00095 int ParsingConstruct;
00096 };
00097
00098 #define ConstructData(theEnv) ((struct constructData *) GetEnvironmentData(theEnv,CONSTRUCT_DATA))
00099
00100 #ifdef LOCALE
00101 #undef LOCALE
00102 #endif
00103
00104 #ifdef _CONSTRCT_SOURCE_
00105 #define LOCALE
00106 #else
00107 #define LOCALE extern
00108 #endif
00109
00110 #define RemoveClearFunction(a) EnvRemoveClearFunction(GetCurrentEnvironment(),a)
00111 #define RemoveResetFunction(a) EnvRemoveResetFunction(GetCurrentEnvironment(),a)
00112
00113 #if ALLOW_ENVIRONMENT_GLOBALS
00114 LOCALE void Clear(void);
00115 LOCALE void Reset(void);
00116 LOCALE int Save(char *);
00117 #endif
00118
00119 LOCALE void EnvClear(void *);
00120 LOCALE void EnvReset(void *);
00121 LOCALE int EnvSave(void *,char *);
00122
00123 LOCALE void InitializeConstructData(void *);
00124 LOCALE intBool AddSaveFunction(void *,char *,void (*)(void *,void *,char *),int);
00125 LOCALE intBool RemoveSaveFunction(void *,char *);
00126 LOCALE intBool EnvAddResetFunction(void *,char *,void (*)(void *),int);
00127 LOCALE intBool AddResetFunction(char *,void (*)(void),int);
00128 LOCALE intBool EnvRemoveResetFunction(void *,char *);
00129 LOCALE intBool AddClearReadyFunction(void *,char *,int (*)(void *),int);
00130 LOCALE intBool RemoveClearReadyFunction(void *,char *);
00131 LOCALE intBool EnvAddClearFunction(void *,char *,void (*)(void *),int);
00132 LOCALE intBool AddClearFunction(char *,void (*)(void),int);
00133 LOCALE intBool EnvRemoveClearFunction(void *,char *);
00134 LOCALE struct construct *AddConstruct(void *,char *,char *,
00135 int (*)(void *,char *),
00136 void *(*)(void *,char *),
00137 SYMBOL_HN *(*)(struct constructHeader *),
00138 char *(*)(void *,struct constructHeader *),
00139 struct defmoduleItemHeader *(*)(struct constructHeader *),
00140 void *(*)(void *,void *),
00141 void (*)(struct constructHeader *,struct constructHeader *),
00142 intBool (*)(void *,void *),
00143 int (*)(void *,void *),
00144 void (*)(void *,void *));
00145 LOCALE int RemoveConstruct(void *,char *);
00146 LOCALE void SetCompilationsWatch(void *,unsigned);
00147 LOCALE unsigned GetCompilationsWatch(void *);
00148 LOCALE void SetPrintWhileLoading(void *,intBool);
00149 LOCALE intBool GetPrintWhileLoading(void *);
00150 LOCALE int ExecutingConstruct(void *);
00151 LOCALE void SetExecutingConstruct(void *,int);
00152 LOCALE void InitializeConstructs(void *);
00153 LOCALE int (*SetBeforeResetFunction(void *,int (*)(void *)))(void *);
00154 LOCALE void OldGetConstructList(void *,DATA_OBJECT *,
00155 void *(*)(void *,void *),
00156 char *(*)(void *,void *));
00157 LOCALE void ResetCommand(void *);
00158 LOCALE void ClearCommand(void *);
00159 LOCALE intBool ClearReady(void *);
00160 LOCALE struct construct *FindConstruct(void *,char *);
00161 LOCALE void DeinstallConstructHeader(void *,struct constructHeader *);
00162 LOCALE void DestroyConstructHeader(void *,struct constructHeader *);
00163
00164 #endif
00165
00166
00167
00168
00169
00170
00171