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_genrcfun
00024 #define _H_genrcfun
00025
00026 typedef struct defgenericModule DEFGENERIC_MODULE;
00027 typedef struct restriction RESTRICTION;
00028 typedef struct method DEFMETHOD;
00029 typedef struct defgeneric DEFGENERIC;
00030
00031 #ifndef _STDIO_INCLUDED_
00032 #define _STDIO_INCLUDED_
00033 #include <stdio.h>
00034 #endif
00035
00036 #ifndef _H_conscomp
00037 #include "conscomp.h"
00038 #endif
00039 #ifndef _H_constrct
00040 #include "constrct.h"
00041 #endif
00042 #ifndef _H_moduldef
00043 #include "moduldef.h"
00044 #endif
00045 #ifndef _H_symbol
00046 #include "symbol.h"
00047 #endif
00048 #ifndef _H_expressn
00049 #include "expressn.h"
00050 #endif
00051 #ifndef _H_evaluatn
00052 #include "evaluatn.h"
00053 #endif
00054
00055 #if OBJECT_SYSTEM
00056 #ifndef _H_object
00057 #include "object.h"
00058 #endif
00059 #endif
00060
00061 struct defgenericModule
00062 {
00063 struct defmoduleItemHeader header;
00064 };
00065
00066 struct restriction
00067 {
00068 void **types;
00069 EXPRESSION *query;
00070 short tcnt;
00071 };
00072
00073 struct method
00074 {
00075 short index;
00076 unsigned busy;
00077 short restrictionCount;
00078 short minRestrictions;
00079 short maxRestrictions;
00080 short localVarCount;
00081 unsigned system : 1;
00082 unsigned trace : 1;
00083 RESTRICTION *restrictions;
00084 EXPRESSION *actions;
00085 char *ppForm;
00086 struct userData *usrData;
00087 };
00088
00089 struct defgeneric
00090 {
00091 struct constructHeader header;
00092 unsigned busy,trace;
00093 DEFMETHOD *methods;
00094 short mcnt;
00095 short new_index;
00096 };
00097
00098 #define DEFGENERIC_DATA 27
00099
00100 struct defgenericData
00101 {
00102 struct construct *DefgenericConstruct;
00103 int DefgenericModuleIndex;
00104 ENTITY_RECORD GenericEntityRecord;
00105 #if DEBUGGING_FUNCTIONS
00106 unsigned WatchGenerics;
00107 unsigned WatchMethods;
00108 #endif
00109 DEFGENERIC *CurrentGeneric;
00110 DEFMETHOD *CurrentMethod;
00111 DATA_OBJECT *GenericCurrentArgument;
00112 #if (! RUN_TIME) && (! BLOAD_ONLY)
00113 unsigned OldGenericBusySave;
00114 #endif
00115 #if CONSTRUCT_COMPILER && (! RUN_TIME)
00116 struct CodeGeneratorItem *DefgenericCodeItem;
00117 #endif
00118 #if (! BLOAD_ONLY) && (! RUN_TIME)
00119 struct token GenericInputToken;
00120 #endif
00121 };
00122
00123 #define DefgenericData(theEnv) ((struct defgenericData *) GetEnvironmentData(theEnv,DEFGENERIC_DATA))
00124 #define SaveBusyCount(gfunc) (DefgenericData(theEnv)->OldGenericBusySave = gfunc->busy)
00125 #define RestoreBusyCount(gfunc) (gfunc->busy = DefgenericData(theEnv)->OldGenericBusySave)
00126
00127 #ifdef LOCALE
00128 #undef LOCALE
00129 #endif
00130
00131 #ifdef _GENRCFUN_SOURCE_
00132 #define LOCALE
00133 #else
00134 #define LOCALE extern
00135 #endif
00136
00137 #if ! RUN_TIME
00138 LOCALE intBool ClearDefgenericsReady(void *);
00139 LOCALE void *AllocateDefgenericModule(void *);
00140 LOCALE void FreeDefgenericModule(void *,void *);
00141 #endif
00142
00143 #if (! BLOAD_ONLY) && (! RUN_TIME)
00144
00145 LOCALE int ClearDefmethods(void *);
00146 LOCALE int RemoveAllExplicitMethods(void *,DEFGENERIC *);
00147 LOCALE void RemoveDefgeneric(void *,void *);
00148 LOCALE int ClearDefgenerics(void *);
00149 LOCALE void MethodAlterError(void *,DEFGENERIC *);
00150 LOCALE void DeleteMethodInfo(void *,DEFGENERIC *,DEFMETHOD *);
00151 LOCALE void DestroyMethodInfo(void *,DEFGENERIC *,DEFMETHOD *);
00152 LOCALE int MethodsExecuting(DEFGENERIC *);
00153 #endif
00154 #if ! OBJECT_SYSTEM
00155 LOCALE intBool SubsumeType(int,int);
00156 #endif
00157
00158 LOCALE long FindMethodByIndex(DEFGENERIC *,long);
00159 #if DEBUGGING_FUNCTIONS
00160 LOCALE void PreviewGeneric(void *);
00161 LOCALE void PrintMethod(void *,char *,int,DEFMETHOD *);
00162 #endif
00163 LOCALE DEFGENERIC *CheckGenericExists(void *,char *,char *);
00164 LOCALE long CheckMethodExists(void *,char *,DEFGENERIC *,long);
00165
00166 #if ! OBJECT_SYSTEM
00167 LOCALE char *TypeName(void *,int);
00168 #endif
00169
00170 LOCALE void PrintGenericName(void *,char *,DEFGENERIC *);
00171
00172 #endif
00173
00174
00175
00176
00177