/*************************************************** NAME : DeleteMethodInfo DESCRIPTION : Deallocates all the data associated w/ a method but does not release the method structure itself INPUTS : 1) The generic function address 2) The method address RETURNS : Nothing useful SIDE EFFECTS : Nodes deallocated NOTES : None ***************************************************/ globle void DeleteMethodInfo( void *theEnv, DEFGENERIC *gfunc, DEFMETHOD *meth) { short j,k; RESTRICTION *rptr; SaveBusyCount(gfunc); ExpressionDeinstall(theEnv,meth->actions); ReturnPackedExpression(theEnv,meth->actions); ClearUserDataList(theEnv,meth->usrData); if (meth->ppForm != NULL) rm(theEnv,(void *) meth->ppForm,(sizeof(char) * (strlen(meth->ppForm)+1))); for (j = 0 ; j < meth->restrictionCount ; j++) { rptr = &meth->restrictions[j]; for (k = 0 ; k < rptr->tcnt ; k++) #if OBJECT_SYSTEM DecrementDefclassBusyCount(theEnv,rptr->types[k]); #else DecrementIntegerCount(theEnv,(INTEGER_HN *) rptr->types[k]); #endif if (rptr->types != NULL) rm(theEnv,(void *) rptr->types,(sizeof(void *) * rptr->tcnt)); ExpressionDeinstall(theEnv,rptr->query); ReturnPackedExpression(theEnv,rptr->query); } if (meth->restrictions != NULL) rm(theEnv,(void *) meth->restrictions, (sizeof(RESTRICTION) * meth->restrictionCount)); RestoreBusyCount(gfunc); }
/****************************************************** NAME : DeleteQueryClasses DESCRIPTION : Deletes a query class-list INPUTS : The query list address RETURNS : Nothing useful SIDE EFFECTS : Nodes deallocated Busy count decremented for all classes NOTES : None ******************************************************/ static void DeleteQueryClasses( QUERY_CLASS *qlist) { QUERY_CLASS *tmp; while (qlist != NULL) { while (qlist->chain != NULL) { tmp = qlist->chain; qlist->chain = qlist->chain->chain; DecrementDefclassBusyCount((void *) tmp->cls); rtn_struct(query_class,tmp); } tmp = qlist; qlist = qlist->nxt; DecrementDefclassBusyCount((void *) tmp->cls); rtn_struct(query_class,tmp); } }
/****************************************************** NAME : DeleteQueryClasses DESCRIPTION : Deletes a query class-list INPUTS : The query list address RETURNS : Nothing useful SIDE EFFECTS : Nodes deallocated Busy count decremented for all classes NOTES : None ******************************************************/ static void DeleteQueryClasses( void *theEnv, EXEC_STATUS, QUERY_CLASS *qlist) { QUERY_CLASS *tmp; while (qlist != NULL) { while (qlist->chain != NULL) { tmp = qlist->chain; qlist->chain = qlist->chain->chain; DecrementDefclassBusyCount(theEnv,execStatus,(void *) tmp->cls); rtn_struct(theEnv,execStatus,query_class,tmp); } tmp = qlist; qlist = qlist->nxt; DecrementDefclassBusyCount(theEnv,execStatus,(void *) tmp->cls); rtn_struct(theEnv,execStatus,query_class,tmp); } }
/***************************************************** NAME : DestroyHandlerLinks DESCRIPTION : Iteratively deallocates handler-links INPUTS : The handler-link list RETURNS : Nothing useful SIDE EFFECTS : Deallocation of links NOTES : None *****************************************************/ globle void DestroyHandlerLinks( HANDLER_LINK *mhead) { HANDLER_LINK *tmp; while (mhead != NULL) { tmp = mhead; mhead = mhead->nxt; tmp->hnd->busy--; DecrementDefclassBusyCount((void *) tmp->hnd->cls); rtn_struct(messageHandlerLink,tmp); } }