abc/src/bdd/cudd/cuddAPI.c
/**Function********************************************************************

  Synopsis    [Removes a function from a hook.]

  Description [Removes a function from a hook. A hook is a list of
  application-provided functions called on certain occasions by the
  package. Returns 1 if successful; 0 the function was not in the list.]

  SideEffects [None]

  SeeAlso     [Cudd_AddHook]

******************************************************************************/
Function
Synopsis    [Removes a function from a hook.]

Description [Removes a function from a hook. A hook is a list of
application-provided functions called on certain occasions by the
package. Returns 1 if successful; 0 the function was not in the list.]




Function Synopsis [ Removes a function from a hook . ] Description [ Removes a function from a hook . A hook is a list of application - provided functions called on certain occasions by the package . Returns 1 if successful ; 0 the function was not in the list . ]
int
Cudd_RemoveHook(
  DdManager * dd,
  DD_HFP f,
  Cudd_HookType where)
{
    DdHook **hook, *nextHook;
    switch (where) {
    case CUDD_PRE_GC_HOOK:
        hook = &(dd->preGCHook);
        break;
    case CUDD_POST_GC_HOOK:
        hook = &(dd->postGCHook);
        break;
    case CUDD_PRE_REORDERING_HOOK:
        hook = &(dd->preReorderingHook);
        break;
    case CUDD_POST_REORDERING_HOOK:
        hook = &(dd->postReorderingHook);
        break;
    default:
        return(0);
    }
    nextHook = *hook;
    while (nextHook != NULL) {
        if (nextHook->f == f) {
            *hook = nextHook->next;
            ABC_FREE(nextHook);
            return(1);
        }
        hook = &(nextHook->next);
        nextHook = nextHook->next;
    }
    return(0);
}
int Cudd_RemoveHook ( DdManager * dd , DD_HFP f , Cudd_HookType where ) { DdHook * * hook , * nextHook ; switch ( where ) { case CUDD_PRE_GC_HOOK : hook = & ( dd -> preGCHook ) ; break ; case CUDD_POST_GC_HOOK : hook = & ( dd -> postGCHook ) ; break ; case CUDD_PRE_REORDERING_HOOK : hook = & ( dd -> preReorderingHook ) ; break ; case CUDD_POST_REORDERING_HOOK : hook = & ( dd -> postReorderingHook ) ; break ; default : return ( 0 ) ; } nextHook = * hook ; while ( nextHook != NULL ) { if ( nextHook -> f == f ) { * hook = nextHook -> next ; ABC_FREE ( nextHook ) ; return ( 1 ) ; } hook = & ( nextHook -> next ) ; nextHook = nextHook -> next ; } return ( 0 ) ; }
Function
Synopsis    [Removes a function from a hook.]
Function Synopsis [ Removes a function from a hook . ]