/**************************************************** NAME : BloadObjectPatterns DESCRIPTION : Reads in all object pattern data structures from binary image and updates pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Binary data structures updated NOTES : Assumes storage allocated previously ****************************************************/ static void BloadObjectPatterns( void *theEnv, EXEC_STATUS) { size_t space; long i; GenReadBinary(theEnv,execStatus,(void *) &space,sizeof(size_t)); if (space == 0L) return; /* ================================================ Read in the alpha and intermediate pattern nodes ================================================ */ BloadandRefresh(theEnv,execStatus,ObjectReteBinaryData(theEnv,execStatus)->AlphaNodeCount,sizeof(BSAVE_OBJECT_ALPHA_NODE),UpdateAlpha); BloadandRefresh(theEnv,execStatus,ObjectReteBinaryData(theEnv,execStatus)->PatternNodeCount,sizeof(BSAVE_OBJECT_PATTERN_NODE),UpdatePattern); for (i = 0; i < ObjectReteBinaryData(theEnv,execStatus)->PatternNodeCount; i++) { if ((ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i].lastLevel != NULL) && (ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i].lastLevel->selector)) { AddHashedPatternNode(theEnv,execStatus,ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i].lastLevel, &ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i], ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i].networkTest->type, ObjectReteBinaryData(theEnv,execStatus)->PatternArray[i].networkTest->value); } } /* ======================= Set the global pointers ======================= */ SetObjectNetworkTerminalPointer(theEnv,execStatus,(OBJECT_ALPHA_NODE *) &ObjectReteBinaryData(theEnv,execStatus)->AlphaArray[0]); SetObjectNetworkPointer(theEnv,execStatus,(OBJECT_PATTERN_NODE *) &ObjectReteBinaryData(theEnv,execStatus)->PatternArray[0]); }
static void BloadBinaryItem( void *theEnv) { size_t space; /*======================================================*/ /* Read in the amount of space used by the binary image */ /* (this is used to skip the construct in the event it */ /* is not available in the version being run). */ /*======================================================*/ GenReadBinary(theEnv,&space,sizeof(size_t)); /*============================================*/ /* Read in the deffactsModule data structures */ /* and refresh the pointers. */ /*============================================*/ BloadandRefresh(theEnv,DeffactsBinaryData(theEnv)->NumberOfDeffactsModules, sizeof(struct bsaveDeffactsModule),UpdateDeffactsModule); /*======================================*/ /* Read in the deffacts data structures */ /* and refresh the pointers. */ /*======================================*/ BloadandRefresh(theEnv,DeffactsBinaryData(theEnv)->NumberOfDeffacts, sizeof(struct bsaveDeffacts),UpdateDeffacts); }
static void BloadBinaryItem() { unsigned long int space; /*======================================================*/ /* Read in the amount of space used by the binary image */ /* (this is used to skip the construct in the event it */ /* is not available in the version being run). */ /*======================================================*/ GenRead(&space,(unsigned long) sizeof(unsigned long int)); /*=============================================*/ /* Read in the defglobalModule data structures */ /* and refresh the pointers. */ /*=============================================*/ BloadandRefresh(NumberOfDefglobalModules, (unsigned) sizeof(struct bsaveDefglobalModule), UpdateDefglobalModule); /*=======================================*/ /* Read in the defglobal data structures */ /* and refresh the pointers. */ /*=======================================*/ BloadandRefresh(NumberOfDefglobals, (unsigned) sizeof(struct bsaveDefglobal), UpdateDefglobal); }
/********************************************************************* NAME : BloadDeffunctions DESCRIPTION : This routine reads deffunction information from a binary file This routine moves through the deffunction binary array updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished ********************************************************************/ static void BloadDeffunctions() { unsigned long space; GenRead((void *) &space,(unsigned long) sizeof(unsigned long)); BloadandRefresh(ModuleCount,sizeof(BSAVE_DEFFUNCTION_MODULE),UpdateDeffunctionModule); BloadandRefresh(DeffunctionCount,sizeof(BSAVE_DEFFUNCTION),UpdateDeffunction); }
/********************************************************************* NAME : BloadDeffunctions DESCRIPTION : This routine reads deffunction information from a binary file This routine moves through the deffunction binary array updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished ********************************************************************/ static void BloadDeffunctions( void *theEnv) { size_t space; GenReadBinary(theEnv,(void *) &space,sizeof(size_t)); BloadandRefresh(theEnv,DeffunctionBinaryData(theEnv)->ModuleCount,sizeof(BSAVE_DEFFUNCTION_MODULE),UpdateDeffunctionModule); BloadandRefresh(theEnv,DeffunctionBinaryData(theEnv)->DeffunctionCount,sizeof(BSAVE_DEFFUNCTION),UpdateDeffunction); }
/********************************************************************* NAME : BloadDefinstances DESCRIPTION : This routine reads definstances information from a binary file This routine moves through the definstances binary array updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished ********************************************************************/ static void BloadDefinstances( void *theEnv) { unsigned long space; GenReadBinary(theEnv,(void *) &space,(unsigned long) sizeof(unsigned long)); BloadandRefresh(theEnv,DefinstancesBinaryData(theEnv)->ModuleCount,sizeof(BSAVE_DEFINSTANCES_MODULE),UpdateDefinstancesModule); BloadandRefresh(theEnv,DefinstancesBinaryData(theEnv)->DefinstancesCount,sizeof(BSAVE_DEFINSTANCES),UpdateDefinstances); }
static void BloadBinaryItem() { unsigned long int space; GenRead(&space,(unsigned long) sizeof(unsigned long int)); if (NumberOfDefmodules == 0) return; BloadandRefresh(NumberOfDefmodules,(unsigned) sizeof(struct bsaveDefmodule),UpdateDefmodule); BloadandRefresh(NumberOfPortItems,(unsigned) sizeof(struct bsavePortItem),UpdatePortItem); SetListOfDefmodules((void *) DefmoduleArray); SetCurrentModule((void *) GetNextDefmodule(NULL)); }
static void BloadBinaryItem( void *theEnv) { unsigned long int space; GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long int)); if (DefmoduleData(theEnv)->BNumberOfDefmodules == 0) return; BloadandRefresh(theEnv,DefmoduleData(theEnv)->BNumberOfDefmodules,(unsigned) sizeof(struct bsaveDefmodule),UpdateDefmodule); BloadandRefresh(theEnv,DefmoduleData(theEnv)->NumberOfPortItems,(unsigned) sizeof(struct bsavePortItem),UpdatePortItem); SetListOfDefmodules(theEnv,(void *) DefmoduleData(theEnv)->DefmoduleArray); EnvSetCurrentModule(theEnv,(void *) EnvGetNextDefmodule(theEnv,NULL)); }
/********************************************************************* NAME : BloadGenerics DESCRIPTION : This routine reads generic function information from a binary file in four chunks: Generic-header array Method array Method restrictions array Restriction types array This routine moves through the generic function binary arrays updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished ********************************************************************/ static void BloadGenerics() { unsigned long space; GenRead((void *) &space,(unsigned long) sizeof(unsigned long)); if (ModuleCount == 0L) return; BloadandRefresh(ModuleCount,(unsigned) sizeof(BSAVE_DEFGENERIC_MODULE),UpdateGenericModule); if (GenericCount == 0L) return; BloadandRefresh(GenericCount,(unsigned) sizeof(BSAVE_GENERIC),UpdateGeneric); BloadandRefresh(MethodCount,(unsigned) sizeof(BSAVE_METHOD),UpdateMethod); BloadandRefresh(RestrictionCount,(unsigned) sizeof(BSAVE_RESTRICTION),UpdateRestriction); BloadandRefresh(TypeCount,(unsigned) sizeof(long),UpdateType); }
static void BloadBinaryItem( void *theEnv, EXEC_STATUS) { size_t space; long i; /*======================================================*/ /* Read in the amount of space used by the binary image */ /* (this is used to skip the construct in the event it */ /* is not available in the version being run). */ /*======================================================*/ GenReadBinary(theEnv,execStatus,&space,sizeof(size_t)); /*=============================================*/ /* Read in the factPatternNode data structures */ /* and refresh the pointers. */ /*=============================================*/ BloadandRefresh(theEnv,execStatus,FactBinaryData(theEnv,execStatus)->NumberOfPatterns,(unsigned) sizeof(struct bsaveFactPatternNode), UpdateFactPatterns); for (i = 0; i < FactBinaryData(theEnv,execStatus)->NumberOfPatterns; i++) { if ((FactBinaryData(theEnv,execStatus)->FactPatternArray[i].lastLevel != NULL) && (FactBinaryData(theEnv,execStatus)->FactPatternArray[i].lastLevel->header.selector)) { AddHashedPatternNode(theEnv,execStatus,FactBinaryData(theEnv,execStatus)->FactPatternArray[i].lastLevel, &FactBinaryData(theEnv,execStatus)->FactPatternArray[i], FactBinaryData(theEnv,execStatus)->FactPatternArray[i].networkTest->type, FactBinaryData(theEnv,execStatus)->FactPatternArray[i].networkTest->value); } } }
/********************************************************************* NAME : BloadGenerics DESCRIPTION : This routine reads generic function information from a binary file in four chunks: Generic-header array Method array Method restrictions array Restriction types array This routine moves through the generic function binary arrays updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished ********************************************************************/ static void BloadGenerics( void *theEnv) { size_t space; GenReadBinary(theEnv,(void *) &space,sizeof(size_t)); if (DefgenericBinaryData(theEnv)->ModuleCount == 0L) return; BloadandRefresh(theEnv,DefgenericBinaryData(theEnv)->ModuleCount,sizeof(BSAVE_DEFGENERIC_MODULE),UpdateGenericModule); if (DefgenericBinaryData(theEnv)->GenericCount == 0L) return; BloadandRefresh(theEnv,DefgenericBinaryData(theEnv)->GenericCount,sizeof(BSAVE_GENERIC),UpdateGeneric); BloadandRefresh(theEnv,DefgenericBinaryData(theEnv)->MethodCount,sizeof(BSAVE_METHOD),UpdateMethod); BloadandRefresh(theEnv,DefgenericBinaryData(theEnv)->RestrictionCount,sizeof(BSAVE_RESTRICTION),UpdateRestriction); BloadandRefresh(theEnv,DefgenericBinaryData(theEnv)->TypeCount,sizeof(long),UpdateType); }
void RefreshExpressions( Environment *theEnv) { if (ExpressionData(theEnv)->ExpressionArray == NULL) return; BloadandRefresh(theEnv,ExpressionData(theEnv)->NumberOfExpressions, sizeof(BSAVE_EXPRESSION),UpdateExpression); }
/*************************************************************** NAME : BloadObjects DESCRIPTION : This routine moves through the class and handler binary arrays updating pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pointers reset from array indices NOTES : Assumes all loading is finished **************************************************************/ static void BloadObjects() { UNLN space; GenRead((void *) &space,(UNLN) sizeof(UNLN)); if (space == 0L) return; if (ModuleCount != 0L) BloadandRefresh(ModuleCount,(unsigned) sizeof(BSAVE_DEFCLASS_MODULE),UpdateDefclassModule); if (ClassCount != 0L) { BloadandRefresh(ClassCount,(unsigned) sizeof(BSAVE_DEFCLASS),UpdateDefclass); BloadandRefresh(LinkCount,(unsigned) sizeof(DEFCLASS *),UpdateLink); BloadandRefresh(SlotNameCount,(unsigned) sizeof(BSAVE_SLOT_NAME),UpdateSlotName); BloadandRefresh(SlotCount,(unsigned) sizeof(BSAVE_SLOT_DESC),UpdateSlot); if (TemplateSlotCount != 0L) BloadandRefresh(TemplateSlotCount,(unsigned) sizeof(long),UpdateTemplateSlot); if (SlotNameMapCount != 0L) { space = (UNLN) (sizeof(unsigned) * SlotNameMapCount); GenRead((void *) mapslotArray,space); } if (HandlerCount != 0L) { BloadandRefresh(HandlerCount,(unsigned) sizeof(BSAVE_HANDLER),UpdateHandler); space = (UNLN) (sizeof(unsigned) * HandlerCount); GenRead((void *) maphandlerArray,space); } UpdatePrimitiveClassesMap(); } }
static void BloadBinaryItem() { unsigned long space; /*======================================================*/ /* Read in the amount of space used by the binary image */ /* (this is used to skip the construct in the event it */ /* is not available in the version being run). */ /*======================================================*/ GenRead(&space,(unsigned long) sizeof(unsigned long int)); /*===========================================*/ /* Read in the defruleModule data structures */ /* and refresh the pointers. */ /*===========================================*/ BloadandRefresh(NumberOfDefruleModules,(unsigned) sizeof(struct bsaveDefruleModule), UpdateDefruleModule); /*=====================================*/ /* Read in the defrule data structures */ /* and refresh the pointers. */ /*=====================================*/ BloadandRefresh(NumberOfDefrules,(unsigned) sizeof(struct bsaveDefrule), UpdateDefrule); #if FUZZY_DEFTEMPLATES if (NumberOfPatternFuzzyValues > 0) BloadandRefresh(NumberOfPatternFuzzyValues,(unsigned) sizeof(struct bsaveFzSlotLocator), UpdatePatternFuzzyValues); #endif /*======================================*/ /* Read in the joinNode data structures */ /* and refresh the pointers. */ /*======================================*/ BloadandRefresh(NumberOfJoins,(unsigned) sizeof(struct bsaveJoinNode), UpdateJoin); }
/**************************************************** NAME : BloadObjectPatterns DESCRIPTION : Reads in all object pattern data structures from binary image and updates pointers INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Binary data structures updated NOTES : Assumes storage allocated previously ****************************************************/ static void BloadObjectPatterns() { UNLN space; GenRead((void *) &space,(UNLN) sizeof(UNLN)); if (space == 0L) return; /* ================================================ Read in the alpha and intermediate pattern nodes ================================================ */ BloadandRefresh(AlphaNodeCount,(unsigned) sizeof(BSAVE_OBJECT_ALPHA_NODE),UpdateAlpha); BloadandRefresh(PatternNodeCount,(unsigned) sizeof(BSAVE_OBJECT_PATTERN_NODE),UpdatePattern); /* ======================= Set the global pointers ======================= */ SetObjectNetworkTerminalPointer((OBJECT_ALPHA_NODE *) &AlphaArray[0]); SetObjectNetworkPointer((OBJECT_PATTERN_NODE *) &PatternArray[0]); }
globle void ReadNeededConstraints( void *theEnv) { GenReadBinary(theEnv,(void *) &ConstraintData(theEnv)->NumberOfConstraints,sizeof(unsigned long int)); if (ConstraintData(theEnv)->NumberOfConstraints == 0) return; ConstraintData(theEnv)->ConstraintArray = (CONSTRAINT_RECORD *) genalloc(theEnv,(sizeof(CONSTRAINT_RECORD) * ConstraintData(theEnv)->NumberOfConstraints)); BloadandRefresh(theEnv,ConstraintData(theEnv)->NumberOfConstraints,sizeof(BSAVE_CONSTRAINT_RECORD), CopyFromBsaveConstraintRecord); }
static void BloadBinaryItem( void *theEnv) { unsigned long space; /*======================================================*/ /* Read in the amount of space used by the binary image */ /* (this is used to skip the construct in the event it */ /* is not available in the version being run). */ /*======================================================*/ GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long int)); /*===========================================*/ /* Read in the defruleModule data structures */ /* and refresh the pointers. */ /*===========================================*/ BloadandRefresh(theEnv,DefruleBinaryData(theEnv)->NumberOfDefruleModules,(unsigned) sizeof(struct bsaveDefruleModule), UpdateDefruleModule); /*=====================================*/ /* Read in the defrule data structures */ /* and refresh the pointers. */ /*=====================================*/ BloadandRefresh(theEnv,DefruleBinaryData(theEnv)->NumberOfDefrules,(unsigned) sizeof(struct bsaveDefrule), UpdateDefrule); /*======================================*/ /* Read in the joinNode data structures */ /* and refresh the pointers. */ /*======================================*/ BloadandRefresh(theEnv,DefruleBinaryData(theEnv)->NumberOfJoins,(unsigned) sizeof(struct bsaveJoinNode), UpdateJoin); }