Exemplo n.º 1
0
orl_return ORLRemoveFileLinks( orli_file_handle orli_file_hnd )
{
    orli_handle                         orli_hnd;
    orli_file_handle                    current;

    orli_hnd = orli_file_hnd->orli_hnd;

    if( orli_hnd->first_file_hnd == orli_file_hnd ) {
        orli_hnd->first_file_hnd = orli_file_hnd->next;
        ORL_FUNCS_FREE( orli_hnd, orli_file_hnd );
        return( ORL_OKAY );
    } else {
        current = orli_hnd->first_file_hnd;
        while( current->next != NULL ) {
            if( current->next == orli_file_hnd ) {
                current->next = orli_file_hnd->next;
                ORL_FUNCS_FREE( orli_hnd, orli_file_hnd );
                return( ORL_OKAY );
            } else {
                current = current->next;
            }
        }
    }
    return( ORL_ERROR );
}
Exemplo n.º 2
0
orl_return ELFENTRY ElfFini( elf_handle elf_hnd )
{
    orl_return          error;

    while( elf_hnd->first_file_hnd != NULL ) {
        error = ElfRemoveFileLinks( elf_hnd->first_file_hnd );
        if( error != ORL_OKAY ) return( error );
    }
    ORL_FUNCS_FREE( elf_hnd, elf_hnd );
    return( ORL_OKAY );
}
Exemplo n.º 3
0
orl_return OMFENTRY OmfFini( omf_handle oh )
{
    orl_return          err;

    assert( oh );

    while( oh->first_file_hnd != NULL ) {
        err = OmfRemoveFileLinks( oh->first_file_hnd );
        if( err != ORL_OKAY ) return( err );
    }
    ORL_FUNCS_FREE( oh, oh );
    return( ORL_OKAY );
}