static void tinput_paste_from_cb(tinput_t *ti) { char *str; int rc = clipboard_get_str(&str); if ((rc != EOK) || (str == NULL)) { /* TODO: Give the user some kind of warning. */ return; } tinput_insert_string(ti, str); free(str); }
static void insert_clipboard_data(void) { char *str; size_t off; wchar_t c; int rc; rc = clipboard_get_str(&str); if (rc != EOK || str == NULL) return; off = 0; while (true) { c = str_decode(str, &off, STR_NO_LIMIT); if (c == '\0') break; insert_char(c); } free(str); }