Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/clui/tinput.c

    r5db9084 r36a75a2  
    513513}
    514514
    515 /** Read in one line of input.
    516  *
    517  * @param ti    Text input.
    518  * @param dstr  Place to save pointer to new string.
    519  * @return      EOK on success, ENOENT if user requested abort, EIO
    520  *              if communication with console failed.
    521  */
    522 int tinput_read(tinput_t *ti, char **dstr)
     515/** Read in one line of input. */
     516char *tinput_read(tinput_t *ti)
    523517{
    524518        console_event_t ev;
     
    528522
    529523        if (console_get_size(fphone(stdin), &ti->con_cols, &ti->con_rows) != EOK)
    530                 return EIO;
     524                return NULL;
    531525        if (console_get_pos(fphone(stdin), &ti->col0, &ti->row0) != EOK)
    532                 return EIO;
     526                return NULL;
    533527
    534528        ti->pos = ti->sel_start = 0;
     
    536530        ti->buffer[0] = '\0';
    537531        ti->done = false;
    538         ti->exit_clui = false;
    539532
    540533        while (!ti->done) {
    541534                fflush(stdout);
    542535                if (!console_get_event(fphone(stdin), &ev))
    543                         return EIO;
     536                        return NULL;
    544537
    545538                if (ev.type != KEY_PRESS)
     
    572565        }
    573566
    574         if (ti->exit_clui)
    575                 return ENOENT;
    576 
    577567        ti->pos = ti->nc;
    578568        tinput_position_caret(ti);
     
    585575        ti->hpos = 0;
    586576
    587         *dstr = str;
    588         return EOK;
     577        return str;
    589578}
    590579
     
    617606        case KC_A:
    618607                tinput_sel_all(ti);
    619                 break;
    620         case KC_Q:
    621                 /* Signal libary client to quit interactive loop. */
    622                 ti->done = true;
    623                 ti->exit_clui = true;
    624608                break;
    625609        default:
Note: See TracChangeset for help on using the changeset viewer.