/*************************************************** NAME : EnvIsDefinstancesDeletable DESCRIPTION : Determines if a definstances can be deleted INPUTS : Address of the definstances RETURNS : TRUE if deletable, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle int EnvIsDefinstancesDeletable( void *theEnv, void *ptr) { if (! ConstructsDeletable(theEnv)) { return FALSE; } return((((DEFINSTANCES *) ptr)->busy == 0) ? TRUE : FALSE); }
globle intBool EnvIsDefglobalDeletable( void *theEnv, void *ptr) { if (! ConstructsDeletable(theEnv)) { return FALSE; } if (((struct defglobal *) ptr)->busyCount) return(FALSE); return(TRUE); }
bool DefglobalIsDeletable( Defglobal *theDefglobal) { Environment *theEnv = theDefglobal->header.env; if (! ConstructsDeletable(theEnv)) { return false; } if (theDefglobal->busyCount) return false; return true; }
bool DeffactsIsDeletable( Deffacts *theDeffacts) { Environment *theEnv = theDeffacts->header.env; if (! ConstructsDeletable(theEnv)) { return false; } if (ConstructData(theEnv)->ResetInProgress) return false; return true; }
/*************************************************** NAME : EnvIsDeffunctionDeletable DESCRIPTION : Determines if a deffunction is executing or referenced by another expression INPUTS : Deffunction pointer RETURNS : TRUE if the deffunction can be deleted, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle int EnvIsDeffunctionDeletable( void *theEnv, void *ptr) { DEFFUNCTION *dptr; if (! ConstructsDeletable(theEnv)) { return FALSE; } dptr = (DEFFUNCTION *) ptr; return(((dptr->busy == 0) && (dptr->executing == 0)) ? TRUE : FALSE); }
globle intBool EnvIsDeffactsDeletable( void *theEnv, void *ptr) { #if MAC_MCW || WIN_MCW || MAC_XCD #pragma unused(ptr) #endif if (! ConstructsDeletable(theEnv)) { return FALSE; } if (ConstructData(theEnv)->ResetInProgress) return(FALSE); return(TRUE); }
globle intBool EnvIsDeftemplateDeletable( void *theEnv, void *vTheDeftemplate) { struct deftemplate *theDeftemplate = (struct deftemplate *) vTheDeftemplate; if (! ConstructsDeletable(theEnv)) { return FALSE; } if (theDeftemplate->busyCount > 0) return(FALSE); if (theDeftemplate->patternNetwork != NULL) return(FALSE); return(TRUE); }
bool DefruleIsDeletable( Defrule *theDefrule) { Environment *theEnv = theDefrule->header.env; if (! ConstructsDeletable(theEnv)) { return false; } for ( ; theDefrule != NULL; theDefrule = theDefrule->disjunct) { if (theDefrule->executing) return false; } if (EngineData(theEnv)->JoinOperationInProgress) return false; return true; }
globle intBool EnvIsDefruleDeletable( void *theEnv, void *vTheDefrule) { struct defrule *theDefrule; if (! ConstructsDeletable(theEnv)) { return FALSE; } for (theDefrule = (struct defrule *) vTheDefrule; theDefrule != NULL; theDefrule = theDefrule->disjunct) { if (theDefrule->executing) return(FALSE); } if (EngineData(theEnv)->JoinOperationInProgress) return(FALSE); return(TRUE); }
/*************************************************** NAME : EnvIsDefclassDeletable DESCRIPTION : Determines if a defclass can be deleted INPUTS : Address of the defclass RETURNS : TRUE if deletable, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle intBool EnvIsDefclassDeletable( void *theEnv, void *ptr) { DEFCLASS *cls; if (! ConstructsDeletable(theEnv)) { return FALSE; } cls = (DEFCLASS *) ptr; if (cls->system == 1) return(FALSE); #if (! BLOAD_ONLY) && (! RUN_TIME) return((IsClassBeingUsed(cls) == FALSE) ? TRUE : FALSE); #else return FALSE; #endif }
/*************************************************** NAME : EnvIsDefmessageHandlerDeletable DESCRIPTION : Determines if a message-handler can be deleted INPUTS : 1) Address of the handler's class 2) Index of the handler RETURNS : TRUE if deletable, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle int EnvIsDefmessageHandlerDeletable( void *theEnv, void *ptr, int theIndex) { DEFCLASS *cls; if (! ConstructsDeletable(theEnv)) { return FALSE; } cls = (DEFCLASS *) ptr; if (cls->handlers[theIndex-1].system == 1) return(FALSE); #if (! BLOAD_ONLY) && (! RUN_TIME) return((HandlersExecuting(cls) == FALSE) ? TRUE : FALSE); #else return FALSE; #endif }