+
+ win->_curx++;
+ }
+}
+
+NCURSES_EXPORT(int)
+wins_wch(WINDOW *win, const cchar_t * wch)
+{
+ NCURSES_SIZE_T oy;
+ NCURSES_SIZE_T ox;
+ int code = ERR;
+
+ T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch)));
+
+ if (win != 0) {
+ oy = win->_cury;
+ ox = win->_curx;
+
+ _nc_insert_wch(win, wch);
+
+ win->_curx = ox;
+ win->_cury = oy;
+ _nc_synchook(win);
+ code = OK;
+ }
+ returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+wins_nwstr(WINDOW *win, const wchar_t * wstr, int n)
+{
+ int code = ERR;
+ NCURSES_SIZE_T oy;
+ NCURSES_SIZE_T ox;
+ const wchar_t *cp;
+
+ T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n));
+
+ if (win != 0
+ && wstr != 0) {
+ if (n < 1)
+ n = wcslen(wstr);
+ if (n > 0) {
+ oy = win->_cury;
+ ox = win->_curx;
+ for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
+ if (wcwidth(*cp) > 1) {
+ cchar_t tmp_cchar;
+ wchar_t tmp_wchar = *cp;
+ memset(&tmp_cchar, 0, sizeof(tmp_cchar));
+ (void) setcchar(&tmp_cchar,
+ &tmp_wchar,
+ WA_NORMAL,
+ 0,
+ (void *) 0);
+ _nc_insert_wch(win, &tmp_cchar);
+ } else {
+ _nc_insert_ch(win, *cp); /* tabs, other ASCII stuff */
+ }
+ }
+
+ win->_curx = ox;
+ win->_cury = oy;
+ _nc_synchook(win);
+ }