Changeset 68b5dd11 in mainline for uspace/lib/clui/tinput.c


Ignore:
Timestamp:
2015-10-20T10:08:15Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b598460a
Parents:
44fe800
Message:

Provide some default options.

File:
1 edited

Legend:

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

    r44fe800 r68b5dd11  
    457457}
    458458
    459 static void tinput_set_str(tinput_t *ti, char *str)
     459static void tinput_set_str(tinput_t *ti, const char *str)
    460460{
    461461        str_to_wstr(ti->buffer, INPUT_MAX_SIZE, str);
     
    853853}
    854854
    855 /** Read in one line of input.
    856  *
    857  * @param ti   Text input.
    858  * @param dstr Place to save pointer to new string.
     855/** Read in one line of input with initial text provided.
     856 *
     857 * @param ti   Text input
     858 * @param istr Initial string
     859 * @param dstr Place to save pointer to new string
    859860 *
    860861 * @return EOK on success
     
    863864 *
    864865 */
    865 int tinput_read(tinput_t *ti, char **dstr)
     866int tinput_read_i(tinput_t *ti, const char *istr, char **dstr)
    866867{
    867868        console_flush(ti->console);
     
    869870                return EIO;
    870871       
    871         ti->pos = 0;
     872        tinput_set_str(ti, istr);
     873
    872874        ti->sel_start = 0;
    873         ti->nc = 0;
    874         ti->buffer[0] = '\0';
    875875        ti->done = false;
    876876        ti->exit_clui = false;
     
    916916}
    917917
     918/** Read in one line of input.
     919 *
     920 * @param ti   Text input
     921 * @param dstr Place to save pointer to new string.
     922 *
     923 * @return EOK on success
     924 * @return ENOENT if user requested abort
     925 * @return EIO if communication with console failed
     926 *
     927 */
     928int tinput_read(tinput_t *ti, char **dstr)
     929{
     930        return tinput_read_i(ti, "", dstr);
     931}
     932
    918933static void tinput_key_ctrl(tinput_t *ti, kbd_event_t *ev)
    919934{
Note: See TracChangeset for help on using the changeset viewer.