static void UpdateDeftemplateSlot( Environment *theEnv, void *buf, unsigned long obji) { struct templateSlot *theSlot; struct bsaveTemplateSlot *btsPtr; btsPtr = (struct bsaveTemplateSlot *) buf; theSlot = (struct templateSlot *) &DeftemplateBinaryData(theEnv)->SlotArray[obji]; theSlot->slotName = SymbolPointer(btsPtr->slotName); IncrementLexemeCount(theSlot->slotName); theSlot->defaultList = HashedExpressionPointer(btsPtr->defaultList); theSlot->facetList = HashedExpressionPointer(btsPtr->facetList); theSlot->constraints = ConstraintPointer(btsPtr->constraints); theSlot->multislot = btsPtr->multislot; theSlot->noDefault = btsPtr->noDefault; theSlot->defaultPresent = btsPtr->defaultPresent; theSlot->defaultDynamic = btsPtr->defaultDynamic; if (btsPtr->next != ULONG_MAX) { theSlot->next = (struct templateSlot *) &DeftemplateBinaryData(theEnv)->SlotArray[obji + 1]; } else { theSlot->next = NULL; } }
/*************************************************** NAME : UpdateConstructHeader DESCRIPTION : Determines field values for construct header from binary-load buffer INPUTS : 1) The binary-load data for the construct header 2) The actual construct header 3) The size of a defmodule item for this construct 4) The array of all defmodule items for this construct 5) The size of this construct 6) The array of these constructs RETURNS : Nothing useful SIDE EFFECTS : Header values set NOTES : None ***************************************************/ LOCALE void UpdateConstructHeader( struct bsaveConstructHeader *theBsaveConstruct, struct constructHeader *theConstruct, int itemModuleSize, void *itemModuleArray, int itemSize, void *itemArray) { long moduleOffset, itemOffset; moduleOffset = itemModuleSize * theBsaveConstruct->whichModule; theConstruct->whichModule = (struct defmoduleItemHeader *) &((char *) itemModuleArray)[moduleOffset]; theConstruct->name = SymbolPointer(theBsaveConstruct->name); IncrementSymbolCount(theConstruct->name); if (theBsaveConstruct->next != -1L) { itemOffset = itemSize * theBsaveConstruct->next; theConstruct->next = (struct constructHeader *) &((char *) itemArray)[itemOffset]; } else theConstruct->next = NULL; theConstruct->ppForm = NULL; theConstruct->bsaveID = 0L; theConstruct->usrData = NULL; }
static void UpdateSlotName( void *buf, long obji) { SLOT_NAME *snp; BSAVE_SLOT_NAME *bsnp; bsnp = (BSAVE_SLOT_NAME *) buf; snp = (SLOT_NAME *) &slotNameArray[obji]; snp->id = bsnp->id; snp->name = SymbolPointer(bsnp->name); IncrementSymbolCount(snp->name); snp->putHandlerName = SymbolPointer(bsnp->putHandlerName); IncrementSymbolCount(snp->putHandlerName); snp->hashTableIndex = bsnp->hashTableIndex; snp->nxt = SlotNameTable[snp->hashTableIndex]; SlotNameTable[snp->hashTableIndex] = snp; }
static void UpdateDefmodule( void *theEnv, void *buf, long obji) { struct bsaveDefmodule *bdp; struct moduleItem *theItem; int i; bdp = (struct bsaveDefmodule *) buf; DefmoduleData(theEnv)->DefmoduleArray[obji].name = SymbolPointer(bdp->name); IncrementSymbolCount(DefmoduleData(theEnv)->DefmoduleArray[obji].name); if (bdp->next != -1L) { DefmoduleData(theEnv)->DefmoduleArray[obji].next = (struct defmodule *) &DefmoduleData(theEnv)->DefmoduleArray[bdp->next]; } else { DefmoduleData(theEnv)->DefmoduleArray[obji].next = NULL; } if (GetNumberOfModuleItems(theEnv) == 0) { DefmoduleData(theEnv)->DefmoduleArray[obji].itemsArray = NULL; } else { DefmoduleData(theEnv)->DefmoduleArray[obji].itemsArray = (struct defmoduleItemHeader **) gm2(theEnv,sizeof(void *) * GetNumberOfModuleItems(theEnv)); } for (i = 0, theItem = GetListOfModuleItems(theEnv); (i < GetNumberOfModuleItems(theEnv)) && (theItem != NULL) ; i++, theItem = theItem->next) { if (theItem->bloadModuleReference == NULL) { DefmoduleData(theEnv)->DefmoduleArray[obji].itemsArray[i] = NULL; } else { DefmoduleData(theEnv)->DefmoduleArray[obji].itemsArray[i] = (struct defmoduleItemHeader *) (*theItem->bloadModuleReference)(theEnv,obji); } } DefmoduleData(theEnv)->DefmoduleArray[obji].ppForm = NULL; if (bdp->importList != -1L) { DefmoduleData(theEnv)->DefmoduleArray[obji].importList = (struct portItem *) &DefmoduleData(theEnv)->PortItemArray[bdp->importList]; } else { DefmoduleData(theEnv)->DefmoduleArray[obji].importList = NULL; } if (bdp->exportList != -1L) { DefmoduleData(theEnv)->DefmoduleArray[obji].exportList = (struct portItem *) &DefmoduleData(theEnv)->PortItemArray[bdp->exportList]; } else { DefmoduleData(theEnv)->DefmoduleArray[obji].exportList = NULL; } DefmoduleData(theEnv)->DefmoduleArray[obji].bsaveID = bdp->bsaveID; }
static void UpdatePortItem( void *theEnv, void *buf, long obji) { struct bsavePortItem *bdp; bdp = (struct bsavePortItem *) buf; if (bdp->moduleName != -1L) { DefmoduleData(theEnv)->PortItemArray[obji].moduleName = SymbolPointer(bdp->moduleName); IncrementSymbolCount(DefmoduleData(theEnv)->PortItemArray[obji].moduleName); } else { DefmoduleData(theEnv)->PortItemArray[obji].moduleName = NULL; } if (bdp->constructType != -1L) { DefmoduleData(theEnv)->PortItemArray[obji].constructType = SymbolPointer(bdp->constructType); IncrementSymbolCount(DefmoduleData(theEnv)->PortItemArray[obji].constructType); } else { DefmoduleData(theEnv)->PortItemArray[obji].constructType = NULL; } if (bdp->constructName != -1L) { DefmoduleData(theEnv)->PortItemArray[obji].constructName = SymbolPointer(bdp->constructName); IncrementSymbolCount(DefmoduleData(theEnv)->PortItemArray[obji].constructName); } else { DefmoduleData(theEnv)->PortItemArray[obji].constructName = NULL; } if (bdp->next != -1L) { DefmoduleData(theEnv)->PortItemArray[obji].next = (struct portItem *) &DefmoduleData(theEnv)->PortItemArray[bdp->next]; } else { DefmoduleData(theEnv)->PortItemArray[obji].next = NULL; } }
static void UpdateSlot( void *buf, long obji) { SLOT_DESC *sp; BSAVE_SLOT_DESC *bsp; sp = (SLOT_DESC *) &slotArray[obji]; bsp = (BSAVE_SLOT_DESC *) buf; sp->dynamicDefault = bsp->dynamicDefault; sp->noDefault = bsp->noDefault; sp->shared = bsp->shared; sp->multiple = bsp->multiple; sp->composite = bsp->composite; sp->noInherit = bsp->noInherit; sp->noWrite = bsp->noWrite; sp->initializeOnly = bsp->initializeOnly; sp->reactive = bsp->reactive; sp->publicVisibility = bsp->publicVisibility; sp->createReadAccessor = bsp->createReadAccessor; sp->createWriteAccessor = bsp->createWriteAccessor; sp->cls = DefclassPointer(bsp->cls); sp->slotName = SlotNamePointer(bsp->slotName); sp->overrideMessage = SymbolPointer(bsp->overrideMessage); IncrementSymbolCount(sp->overrideMessage); if (bsp->defaultValue != -1L) { if (sp->dynamicDefault) sp->defaultValue = (void *) ExpressionPointer(bsp->defaultValue); else { sp->defaultValue = (void *) get_struct(dataObject); EvaluateAndStoreInDataObject((int) sp->multiple,ExpressionPointer(bsp->defaultValue), (DATA_OBJECT *) sp->defaultValue); ValueInstall((DATA_OBJECT *) sp->defaultValue); } } else sp->defaultValue = NULL; sp->constraint = ConstraintPointer(bsp->constraint); sp->sharedCount = 0; sp->sharedValue.value = NULL; sp->bsaveIndex = 0L; if (sp->shared) { sp->sharedValue.desc = sp; sp->sharedValue.value = NULL; } }
static void UpdateHandler( void *buf, long obji) { HANDLER *hnd; BSAVE_HANDLER *bhnd; hnd = (HANDLER *) &handlerArray[obji]; bhnd = (BSAVE_HANDLER *) buf; hnd->system = bhnd->system; hnd->type = bhnd->type; #if (! IMPERATIVE_MESSAGE_HANDLERS) if (hnd->type == MAROUND) { PrintWarningID("OBJBIN",1,FALSE); PrintRouter(WWARNING,"Around message-handlers are not\n"); PrintRouter(WWARNING," supported in this environment."); } #endif #if (! AUXILIARY_MESSAGE_HANDLERS) if ((hnd->type == MBEFORE) || (hnd->type == MAFTER)) { PrintWarningID("OBJBIN",2,FALSE); PrintRouter(WWARNING,"Before and after message-handlers are not\n"); PrintRouter(WWARNING," supported in this environment."); } #endif hnd->minParams = bhnd->minParams; hnd->maxParams = bhnd->maxParams; hnd->localVarCount = bhnd->localVarCount; hnd->cls = DefclassPointer(bhnd->cls); hnd->name = SymbolPointer(bhnd->name); IncrementSymbolCount(hnd->name); hnd->actions = ExpressionPointer(bhnd->actions); hnd->ppForm = NULL; hnd->busy = 0; hnd->mark = 0; hnd->usrData = NULL; #if DEBUGGING_FUNCTIONS hnd->trace = WatchHandlers; #endif }