openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/libmisc/cleanup.c
void del_cleanup(/*@notnull@*/ cleanup_function pcf)
{
    unsigned int i;
    assert(NULL != pcf);

    /* Find the pcf cleanup function */
    for (i = 0; i < CLEANUP_FUNCTIONS; i++)
    {
        if (cleanup_functions[i] == pcf)
        {
            break;
        }
    }

    /* Make sure the cleanup function was found */
    assert(i < CLEANUP_FUNCTIONS);

    /* Move the rest of the cleanup functions */
    for (; i < CLEANUP_FUNCTIONS; i++)
    {
        /* Make sure the cleanup function was specified only once */
        assert((i == (CLEANUP_FUNCTIONS - 1)) ||
               (cleanup_functions[i + 1] != pcf));

        if (i == (CLEANUP_FUNCTIONS - 1))
        {
            cleanup_functions[i] = NULL;
            cleanup_function_args[i] = NULL;
        }
        else
        {
            cleanup_functions[i] = cleanup_functions[i + 1];
            cleanup_function_args[i] = cleanup_function_args[i + 1];
        }

        /* A NULL indicates the end of the stack */
        if (NULL == cleanup_functions[i])
        {
            break;
        }
    }
}
/*
 * del_cleanup - Remove a cleanup_function from the cleanup_functions stack.
 */
Remove a cleanup_function from the cleanup_functions stack.
Remove a cleanup_function from the cleanup_functions stack .
void del_cleanup( cleanup_function pcf)
{
    unsigned int i;
    assert(NULL != pcf);
    for (i = 0; i < CLEANUP_FUNCTIONS; i++)
    {
        if (cleanup_functions[i] == pcf)
        {
            break;
        }
    }
    assert(i < CLEANUP_FUNCTIONS);
    for (; i < CLEANUP_FUNCTIONS; i++)
    {
        assert((i == (CLEANUP_FUNCTIONS - 1)) ||
               (cleanup_functions[i + 1] != pcf));
        if (i == (CLEANUP_FUNCTIONS - 1))
        {
            cleanup_functions[i] = NULL;
            cleanup_function_args[i] = NULL;
        }
        else
        {
            cleanup_functions[i] = cleanup_functions[i + 1];
            cleanup_function_args[i] = cleanup_function_args[i + 1];
        }
        if (NULL == cleanup_functions[i])
        {
            break;
        }
    }
}
void del_cleanup ( cleanup_function pcf ) { unsigned int i ; assert ( NULL != pcf ) ; for ( i = 0 ; i < CLEANUP_FUNCTIONS ; i ++ ) { if ( cleanup_functions [ i ] == pcf ) { break ; } } assert ( i < CLEANUP_FUNCTIONS ) ; for ( ; i < CLEANUP_FUNCTIONS ; i ++ ) { assert ( ( i == ( CLEANUP_FUNCTIONS - 1 ) ) || ( cleanup_functions [ i + 1 ] != pcf ) ) ; if ( i == ( CLEANUP_FUNCTIONS - 1 ) ) { cleanup_functions [ i ] = NULL ; cleanup_function_args [ i ] = NULL ; } else { cleanup_functions [ i ] = cleanup_functions [ i + 1 ] ; cleanup_function_args [ i ] = cleanup_function_args [ i + 1 ] ; } if ( NULL == cleanup_functions [ i ] ) { break ; } } }
del_cleanup - Remove a cleanup_function from the cleanup_functions stack.
del_cleanup - Remove a cleanup_function from the cleanup_functions stack .
/*@notnull@*/ /* Find the pcf cleanup function */ /* Make sure the cleanup function was found */ /* Move the rest of the cleanup functions */ /* Make sure the cleanup function was specified only once */ /* A NULL indicates the end of the stack */