00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _H_dffnxfun
00027 #define _H_dffnxfun
00028
00029 #define EnvGetDeffunctionName(theEnv,x) GetConstructNameString((struct constructHeader *) x)
00030 #define EnvGetDeffunctionPPForm(theEnv,x) GetConstructPPForm(theEnv,(struct constructHeader *) x)
00031
00032 #define GetDeffunctionNamePointer(x) GetConstructNamePointer((struct constructHeader *) x)
00033 #define SetDeffunctionPPForm(d,ppf) SetConstructPPForm(theEnv,(struct constructHeader *) d,ppf)
00034
00035 #define EnvDeffunctionModule(theEnv,x) GetConstructModuleName((struct constructHeader *) x)
00036
00037 typedef struct deffunctionStruct DEFFUNCTION;
00038 typedef struct deffunctionModule DEFFUNCTION_MODULE;
00039
00040 #ifndef _H_conscomp
00041 #include "conscomp.h"
00042 #endif
00043 #ifndef _H_cstrccom
00044 #include "cstrccom.h"
00045 #endif
00046 #ifndef _H_moduldef
00047 #include "moduldef.h"
00048 #endif
00049 #ifndef _H_evaluatn
00050 #include "evaluatn.h"
00051 #endif
00052 #ifndef _H_expressn
00053 #include "expressn.h"
00054 #endif
00055 #ifndef _H_symbol
00056 #include "symbol.h"
00057 #endif
00058
00059 #ifdef LOCALE
00060 #undef LOCALE
00061 #endif
00062 #ifdef _DFFNXFUN_SOURCE_
00063 #define LOCALE
00064 #else
00065 #define LOCALE extern
00066 #endif
00067
00068 struct deffunctionModule
00069 {
00070 struct defmoduleItemHeader header;
00071 };
00072
00073 struct deffunctionStruct
00074 {
00075 struct constructHeader header;
00076 unsigned busy,
00077 executing;
00078 unsigned short trace;
00079 EXPRESSION *code;
00080 int minNumberOfParameters,
00081 maxNumberOfParameters,
00082 numberOfLocalVars;
00083 };
00084
00085 #define DEFFUNCTION_DATA 23
00086
00087 struct deffunctionData
00088 {
00089 struct construct *DeffunctionConstruct;
00090 int DeffunctionModuleIndex;
00091 ENTITY_RECORD DeffunctionEntityRecord;
00092 #if DEBUGGING_FUNCTIONS
00093 unsigned WatchDeffunctions;
00094 #endif
00095 struct CodeGeneratorItem *DeffunctionCodeItem;
00096 DEFFUNCTION *ExecutingDeffunction;
00097 #if (! BLOAD_ONLY) && (! RUN_TIME)
00098 struct token DFInputToken;
00099 #endif
00100 };
00101
00102 #define DeffunctionData(theEnv) ((struct deffunctionData *) GetEnvironmentData(theEnv,DEFFUNCTION_DATA))
00103
00104 #define DeffunctionModule(x) GetConstructModuleName((struct constructHeader *) x)
00105 #define FindDeffunction(a) EnvFindDeffunction(GetCurrentEnvironment(),a)
00106 #define GetDeffunctionList(a,b) EnvGetDeffunctionList(GetCurrentEnvironment(),a,b)
00107 #define GetDeffunctionName(x) GetConstructNameString((struct constructHeader *) x)
00108 #define GetDeffunctionPPForm(x) GetConstructPPForm(GetCurrentEnvironment(),(struct constructHeader *) x)
00109 #define GetDeffunctionWatch(a) EnvGetDeffunctionWatch(GetCurrentEnvironment(),a)
00110 #define GetNextDeffunction(a) EnvGetNextDeffunction(GetCurrentEnvironment(),a)
00111 #define IsDeffunctionDeletable(a) EnvIsDeffunctionDeletable(GetCurrentEnvironment(),a)
00112 #define ListDeffunctions(a,b) EnvListDeffunctions(GetCurrentEnvironment(),a,b)
00113 #define SetDeffunctionWatch(a,b) EnvSetDeffunctionWatch(GetCurrentEnvironment(),a,b)
00114 #define Undeffunction(a) EnvUndeffunction(GetCurrentEnvironment(),a)
00115
00116 LOCALE void SetupDeffunctions(void *);
00117 LOCALE void *EnvFindDeffunction(void *,char *);
00118 LOCALE DEFFUNCTION *LookupDeffunctionByMdlOrScope(void *,char *);
00119 LOCALE DEFFUNCTION *LookupDeffunctionInScope(void *,char *);
00120 LOCALE intBool EnvUndeffunction(void *,void *);
00121 LOCALE void *EnvGetNextDeffunction(void *,void *);
00122 LOCALE int EnvIsDeffunctionDeletable(void *,void *);
00123 LOCALE void UndeffunctionCommand(void *);
00124 LOCALE void *GetDeffunctionModuleCommand(void *);
00125 LOCALE void DeffunctionGetBind(DATA_OBJECT *);
00126 LOCALE void DFRtnUnknown(DATA_OBJECT *);
00127 LOCALE void DFWildargs(DATA_OBJECT *);
00128 LOCALE int CheckDeffunctionCall(void *,void *,int);
00129 #if DEBUGGING_FUNCTIONS
00130 LOCALE void PPDeffunctionCommand(void *);
00131 LOCALE void ListDeffunctionsCommand(void *);
00132 LOCALE void EnvListDeffunctions(void *,char *,struct defmodule *);
00133 LOCALE void EnvSetDeffunctionWatch(void *,unsigned,void *);
00134 LOCALE unsigned EnvGetDeffunctionWatch(void *,void *);
00135 #endif
00136 #if (! BLOAD_ONLY) && (! RUN_TIME)
00137 LOCALE void RemoveDeffunction(void *,void *);
00138 #endif
00139
00140 LOCALE void GetDeffunctionListFunction(void *,DATA_OBJECT *);
00141 globle void EnvGetDeffunctionList(void *,DATA_OBJECT *,struct defmodule *);
00142
00143 #endif
00144
00145
00146
00147
00148
00149