Changeset 68b5dd11 in mainline for uspace/lib/clui/tinput.c
- Timestamp:
- 2015-10-20T10:08:15Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b598460a
- Parents:
- 44fe800
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
r44fe800 r68b5dd11 457 457 } 458 458 459 static void tinput_set_str(tinput_t *ti, c har *str)459 static void tinput_set_str(tinput_t *ti, const char *str) 460 460 { 461 461 str_to_wstr(ti->buffer, INPUT_MAX_SIZE, str); … … 853 853 } 854 854 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 859 860 * 860 861 * @return EOK on success … … 863 864 * 864 865 */ 865 int tinput_read (tinput_t *ti, char **dstr)866 int tinput_read_i(tinput_t *ti, const char *istr, char **dstr) 866 867 { 867 868 console_flush(ti->console); … … 869 870 return EIO; 870 871 871 ti->pos = 0; 872 tinput_set_str(ti, istr); 873 872 874 ti->sel_start = 0; 873 ti->nc = 0;874 ti->buffer[0] = '\0';875 875 ti->done = false; 876 876 ti->exit_clui = false; … … 916 916 } 917 917 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 */ 928 int tinput_read(tinput_t *ti, char **dstr) 929 { 930 return tinput_read_i(ti, "", dstr); 931 } 932 918 933 static void tinput_key_ctrl(tinput_t *ti, kbd_event_t *ev) 919 934 {
Note:
See TracChangeset
for help on using the changeset viewer.