Changes in uspace/lib/clui/tinput.c [5db9084:36a75a2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
r5db9084 r36a75a2 513 513 } 514 514 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. */ 516 char *tinput_read(tinput_t *ti) 523 517 { 524 518 console_event_t ev; … … 528 522 529 523 if (console_get_size(fphone(stdin), &ti->con_cols, &ti->con_rows) != EOK) 530 return EIO;524 return NULL; 531 525 if (console_get_pos(fphone(stdin), &ti->col0, &ti->row0) != EOK) 532 return EIO;526 return NULL; 533 527 534 528 ti->pos = ti->sel_start = 0; … … 536 530 ti->buffer[0] = '\0'; 537 531 ti->done = false; 538 ti->exit_clui = false;539 532 540 533 while (!ti->done) { 541 534 fflush(stdout); 542 535 if (!console_get_event(fphone(stdin), &ev)) 543 return EIO;536 return NULL; 544 537 545 538 if (ev.type != KEY_PRESS) … … 572 565 } 573 566 574 if (ti->exit_clui)575 return ENOENT;576 577 567 ti->pos = ti->nc; 578 568 tinput_position_caret(ti); … … 585 575 ti->hpos = 0; 586 576 587 *dstr = str; 588 return EOK; 577 return str; 589 578 } 590 579 … … 617 606 case KC_A: 618 607 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;624 608 break; 625 609 default:
Note:
See TracChangeset
for help on using the changeset viewer.