Example #1
0
const wchar_t *history_next_match( const wchar_t *needle)
{
    if( current_mode )
    {
        /*
          The index of previous search matches are saved in the 'used'
          list. We just need to pop the top item and set the new
          position. Easy!
        */
        if( al_get_count( &current_mode->used ) )
        {
            al_pop( &current_mode->used );
            if( al_get_count( &current_mode->used ) )
            {
                current_mode->pos = (int) al_peek_long( &current_mode->used );
                item_t *i = item_get( current_mode, al_get( &current_mode->item, current_mode->pos ) );
                return i->data;
            }
        }

        /*
          The used-list is empty. Set position to 'past end of list'
          and return the search string.
        */
        current_mode->pos = al_get_count( &current_mode->item );

    }
    return needle;
}
Example #2
0
/**
   Find at most one file relative to the XDG data directories.
*/
static char *get_filename( char *f )
{
    array_list_t list;
    char *first = NULL;

    al_init( &list );
    append_filenames( &list, f, 0 );
    first = al_pop( &list );
    al_destroy( &list );
    return first;
}
Example #3
0
void eliminarDirector(ArrayList* listaDirec)
{
    char opcion;
    int i;
    int auxCod,flag=0;
    eDirector* pAux;
    eDirector* borrado;
    showMessage("Codigo del director");
    fflush(stdin);
    scanf("%d",&auxCod);
    for(i=0; i<listaDirec->size; i++)
    {
        pAux=al_get(listaDirec,i);
        if(pAux->codDirec==auxCod)
        {
            showMessage("DIRECTOR ENCONTRADO");
            flag=1;
            printf("\nNombre: %s\nFecha de nacimiento: %s\nPais: %s\n",pAux->nombre,pAux->nacimiento,pAux->pais);
            showMessage("Desea Eliminarlo? s/n");
            fflush(stdin);
            scanf("%c",&opcion);
            if(opcion=='s')
            {
                borrado=al_pop(listaDirec,i);
                system("cls");
                printf("Nombre= %s\nNacimiento= %s\nPais= %s\nFUE ELIMINADO CON EXITO",borrado->nombre,borrado->nacimiento,borrado->pais);
                system("pause");
            }
            else
            {
                system("cls");
                showMessage("DIRECTOR NO ELIMINADO");
                system("pause");
            }
        }

    }
    if(flag==0)
    {
        system("cls");
        showMessage("DIRECTOR INEXISTENTE");
        system("pause");
    }
}