globle struct partialMatch *CopyPartialMatch( struct partialMatch *list, int addActivationSlot, int addDependencySlot) { struct partialMatch *linker; short int i; linker = get_var_struct(partialMatch,sizeof(struct genericMatch) * (list->bcount + addActivationSlot + addDependencySlot - 1)); linker->next = NULL; linker->betaMemory = TRUE; linker->busy = FALSE; linker->activationf = addActivationSlot; linker->dependentsf = addDependencySlot; linker->notOriginf = FALSE; linker->counterf = FALSE; linker->bcount = list->bcount; for (i = 0; i < (int) linker->bcount; i++) linker->binds[i] = list->binds[i]; if (addActivationSlot) linker->binds[i++].gm.theValue = NULL; if (addDependencySlot) linker->binds[i].gm.theValue = NULL; return(linker); }
globle void *EnvCreateMultifield( void *theEnv, long size) { struct multifield *theSegment; long newSize; if (size <= 0) newSize = 1; else newSize = size; theSegment = get_var_struct(theEnv,multifield,(long) sizeof(struct field) * (newSize - 1L)); theSegment->multifieldLength = size; theSegment->depth = (short) EvaluationData(theEnv)->CurrentEvaluationDepth; theSegment->busyCount = 0; theSegment->next = NULL; theSegment->next = MultifieldData(theEnv)->ListOfMultifields; MultifieldData(theEnv)->ListOfMultifields = theSegment; UtilityData(theEnv)->EphemeralItemCount++; UtilityData(theEnv)->EphemeralItemSize += sizeof(struct multifield) + (sizeof(struct field) * newSize); return((void *) theSegment); }
globle struct partialMatch *AddSingleMatch( struct partialMatch *list, struct alphaMatch *afb, int addActivationSlot, int addDependencySlot) { struct partialMatch *linker; short int i; linker = get_var_struct(partialMatch,sizeof(struct genericMatch) * (list->bcount + addActivationSlot + addDependencySlot)); linker->next = NULL; linker->betaMemory = TRUE; linker->busy = FALSE; linker->activationf = addActivationSlot; linker->dependentsf = addDependencySlot; linker->notOriginf = FALSE; linker->counterf = FALSE; linker->bcount = list->bcount + 1; for (i = 0; i < (int) list->bcount; i++) { linker->binds[i] = list->binds[i]; } set_nth_pm_match(linker,i++,afb); if (addActivationSlot) linker->binds[i++].gm.theValue = NULL; if (addDependencySlot) linker->binds[i].gm.theValue = NULL; return(linker); }
globle void *CreateMultifield2( void *theEnv, long size) { struct multifield *theSegment; long newSize = size; if (size <= 0) newSize = 1; theSegment = get_var_struct(theEnv,multifield,(long) sizeof(struct field) * (newSize - 1L)); theSegment->multifieldLength = size; theSegment->busyCount = 0; theSegment->next = NULL; return((void *) theSegment); }
globle void *EnvCreateMultifield( void *theEnv, long size) { struct multifield *theSegment; long newSize; if (size <= 0) newSize = 1; else newSize = size; theSegment = get_var_struct(theEnv,multifield,(long) sizeof(struct field) * (newSize - 1L)); theSegment->multifieldLength = size; theSegment->busyCount = 0; theSegment->next = NULL; theSegment->next = UtilityData(theEnv)->CurrentGarbageFrame->ListOfMultifields; UtilityData(theEnv)->CurrentGarbageFrame->ListOfMultifields = theSegment; UtilityData(theEnv)->CurrentGarbageFrame->dirty = TRUE; if (UtilityData(theEnv)->CurrentGarbageFrame->LastMultifield == NULL) { UtilityData(theEnv)->CurrentGarbageFrame->LastMultifield = theSegment; } return((void *) theSegment); }