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

  Synopsis    [Checks whether a function is in a hook.]

  Description [Checks whether a function is in a hook. A hook is a list of
  application-provided functions called on certain occasions by the
  package. Returns 1 if the function is found; 0 otherwise.]

  SideEffects [None]

  SeeAlso     [Cudd_AddHook Cudd_RemoveHook]

******************************************************************************/
Function
Synopsis    [Checks whether a function is in a hook.]

Description [Checks whether a function is in a hook. A hook is a list of
application-provided functions called on certain occasions by the
package. Returns 1 if the function is found; 0 otherwise.]




Function Synopsis [ Checks whether a function is in a hook . ] Description [ Checks whether a function is in a hook . A hook is a list of application - provided functions called on certain occasions by the package . Returns 1 if the function is found ; 0 otherwise . ]
int
Cudd_IsInHook(
  DdManager * dd,
  DD_HFP f,
  Cudd_HookType where)
{
    DdHook *hook;
    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);
    }
    while (hook != NULL) {
        if (hook->f == f) {
            return(1);
        }
        hook = hook->next;
    }
    return(0);
}
int Cudd_IsInHook ( DdManager * dd , DD_HFP f , Cudd_HookType where ) { DdHook * hook ; 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 ) ; } while ( hook != NULL ) { if ( hook -> f == f ) { return ( 1 ) ; } hook = hook -> next ; } return ( 0 ) ; }
Function
Synopsis    [Checks whether a function is in a hook.]
Function Synopsis [ Checks whether a function is in a hook . ]
/* Scan the list and find whether the function is already there. */