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_classfun
00027 #define _H_classfun
00028
00029 #ifndef _H_object
00030 #include "object.h"
00031 #endif
00032
00033 #define TestTraversalID(traversalRecord,id) TestBitMap(traversalRecord,id)
00034 #define SetTraversalID(traversalRecord,id) SetBitMap(traversalRecord,id)
00035 #define ClearTraversalID(traversalRecord,id) ClearBitMap(traversalRecord,id)
00036
00037 #define CLASS_TABLE_HASH_SIZE 167
00038 #define SLOT_NAME_TABLE_HASH_SIZE 167
00039
00040 #define INITIAL_OBJECT_CLASS_NAME "INITIAL-OBJECT"
00041
00042 #define ISA_ID 0
00043 #define NAME_ID 1
00044
00045 #ifdef LOCALE
00046 #undef LOCALE
00047 #endif
00048
00049 #ifdef _CLASSFUN_SOURCE_
00050 #define LOCALE
00051 #else
00052 #define LOCALE extern
00053 #endif
00054
00055 LOCALE void IncrementDefclassBusyCount(void *,void *);
00056 LOCALE void DecrementDefclassBusyCount(void *,void *);
00057 LOCALE intBool InstancesPurge(void *theEnv);
00058
00059 #if ! RUN_TIME
00060 LOCALE void InitializeClasses(void *);
00061 #endif
00062 LOCALE SLOT_DESC *FindClassSlot(DEFCLASS *,SYMBOL_HN *);
00063 LOCALE void ClassExistError(void *,char *,char *);
00064 LOCALE void DeleteClassLinks(void *,CLASS_LINK *);
00065 LOCALE void PrintClassName(void *,char *,DEFCLASS *,intBool);
00066
00067 #if DEBUGGING_FUNCTIONS || ((! BLOAD_ONLY) && (! RUN_TIME))
00068 LOCALE void PrintPackedClassLinks(void *,char *,char *,PACKED_CLASS_LINKS *);
00069 #endif
00070
00071 #if ! RUN_TIME
00072 LOCALE void PutClassInTable(void *,DEFCLASS *);
00073 LOCALE void RemoveClassFromTable(void *,DEFCLASS *);
00074 LOCALE void AddClassLink(void *,PACKED_CLASS_LINKS *,DEFCLASS *,int);
00075 LOCALE void DeleteSubclassLink(void *,DEFCLASS *,DEFCLASS *);
00076 LOCALE DEFCLASS *NewClass(void *,SYMBOL_HN *);
00077 LOCALE void DeletePackedClassLinks(void *,PACKED_CLASS_LINKS *,int);
00078 LOCALE void AssignClassID(void *,DEFCLASS *);
00079 LOCALE SLOT_NAME *AddSlotName(void *,SYMBOL_HN *,int,int);
00080 LOCALE void DeleteSlotName(void *,SLOT_NAME *);
00081 LOCALE void RemoveDefclass(void *,void *);
00082 LOCALE void InstallClass(void *,DEFCLASS *,int);
00083 #endif
00084 LOCALE void DestroyDefclass(void *,void *);
00085
00086 #if (! BLOAD_ONLY) && (! RUN_TIME)
00087 LOCALE int IsClassBeingUsed(DEFCLASS *);
00088 LOCALE int RemoveAllUserClasses(void *);
00089 LOCALE int DeleteClassUAG(void *,DEFCLASS *);
00090 LOCALE void MarkBitMapSubclasses(char *,DEFCLASS *,int);
00091 #endif
00092
00093 LOCALE short FindSlotNameID(void *,SYMBOL_HN *);
00094 LOCALE SYMBOL_HN *FindIDSlotName(void *,int);
00095 LOCALE SLOT_NAME *FindIDSlotNameHash(void *,int);
00096 LOCALE int GetTraversalID(void *);
00097 LOCALE void ReleaseTraversalID(void *);
00098 LOCALE unsigned HashClass(SYMBOL_HN *);
00099
00100 #ifndef _CLASSFUN_SOURCE_
00101
00102 #if DEFRULE_CONSTRUCT
00103 extern SYMBOL_HN *INITIAL_OBJECT_SYMBOL;
00104 #endif
00105 #if DEBUGGING_FUNCTIONS
00106 extern unsigned WatchInstances,WatchSlots;
00107 #endif
00108 #endif
00109
00110 #define DEFCLASS_DATA 21
00111
00112 #define PRIMITIVE_CLASSES 9
00113
00114 struct defclassData
00115 {
00116 struct construct *DefclassConstruct;
00117 int DefclassModuleIndex;
00118 ENTITY_RECORD DefclassEntityRecord;
00119 DEFCLASS *PrimitiveClassMap[PRIMITIVE_CLASSES];
00120 DEFCLASS **ClassIDMap;
00121 DEFCLASS **ClassTable;
00122 unsigned short MaxClassID;
00123 unsigned short AvailClassID;
00124 SLOT_NAME **SlotNameTable;
00125 SYMBOL_HN *ISA_SYMBOL;
00126 SYMBOL_HN *NAME_SYMBOL;
00127 #if DEFRULE_CONSTRUCT
00128 SYMBOL_HN *INITIAL_OBJECT_SYMBOL;
00129 #endif
00130 #if DEBUGGING_FUNCTIONS
00131 unsigned WatchInstances;
00132 unsigned WatchSlots;
00133 #endif
00134 unsigned short CTID;
00135 struct token ObjectParseToken;
00136 unsigned short ClassDefaultsMode;
00137 };
00138
00139 #define DefclassData(theEnv) ((struct defclassData *) GetEnvironmentData(theEnv,DEFCLASS_DATA))
00140
00141 #endif
00142
00143
00144
00145
00146
00147
00148
00149
00150