int ins_wstr(const wchar_t *wcs) { int code; code = wins_nwstr(stdscr, wcs, -1); return (code); }
int ins_nwstr(const wchar_t *wcs, int n) { int code; code = wins_nwstr(stdscr, wcs, n); return (code); }
int wins_wstr(WINDOW *w, const wchar_t *wcs) { int code; code = wins_nwstr(w, wcs, -1); return (code); }
WRAP_API int wrap_winsnstr(WINDOW *win, uchar2 *str, int n) { #if defined(CURSES_WIDE) && SIZEOF_WCHAR_T == 2 return wins_nwstr(win, str, n); #elif defined(CURSES_WIDE) wchar_t stackbuf[BUFFER_SIZE]; xbuffer xinput, xoutput; int ret; xbuf_init_uc(&xinput, str, n, XBUF_FILL); xbuf_init_wc(&xoutput, stackbuf, BUFFER_SIZE, XBUF_EXPANDABLE); ret = unicode_to_wchar(&xinput, &xoutput); if (ret < 0) goto do_exit; ret = xbuf_tzero_wc(&xoutput); if (ret < 0) goto do_exit; ret = wins_nwstr(win, xbuf_data_wc(&xoutput), xbuf_len_wc(&xoutput)); do_exit: xbuf_free(&xoutput); return ret; #else char stackbuf[BUFFER_SIZE]; xbuffer xinput, xoutput; int ret; xbuf_init_uc(&xinput, str, n, XBUF_FILL); xbuf_init(&xoutput, stackbuf, BUFFER_SIZE, XBUF_EXPANDABLE); ret = unicode_to_char(&xinput, &xoutput); if (ret < 0) goto do_exit; ret = xbuf_tzero(&xoutput); if (ret < 0) goto do_exit; ret = winsnstr(win, xbuf_data(&xoutput), xbuf_len(&xoutput)); do_exit: xbuf_free(&xoutput); return ret; #endif }
int mvwins_nwstr(WINDOW *w, int y, int x, const wchar_t *wcs, int n) { int code; if ((code = wmove(w, y, x)) == OK) code = wins_nwstr(w, wcs, n); return (code); }
int mvins_nwstr(int y, int x, const wchar_t *wcs, int n) { int code; if ((code = wmove(stdscr, y, x)) == OK) code = wins_nwstr(stdscr, wcs, n); return (code); }
NCURSES_EXPORT(int) (wins_wstr) (WINDOW * a1, const wchar_t * z) { T((T_CALLED("wins_wstr(%p,%p)"), (const void *)a1, (const void *)z)); returnCode(wins_nwstr(a1,z,-1)); }
NCURSES_EXPORT(int) (mvwins_wstr) (WINDOW * a1, int a2, int a3, const wchar_t * z) { T((T_CALLED("mvwins_wstr(%p,%d,%d,%p)"), (const void *)a1, a2, a3, (const void *)z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wins_nwstr(a1,z,-1))); }
NCURSES_EXPORT(int) (mvins_wstr) (int a1, int a2, const wchar_t * z) { T((T_CALLED("mvins_wstr(%d,%d,%p)"), a1, a2, (const void *)z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wins_nwstr(stdscr,z,-1))); }
NCURSES_EXPORT(int) (ins_wstr) (const wchar_t * z) { T((T_CALLED("ins_wstr(%p)"), (const void *)z)); returnCode(wins_nwstr(stdscr,z,-1)); }
NCURSES_EXPORT(int) (ins_nwstr) (const wchar_t * a1, int z) { T((T_CALLED("ins_nwstr(%p,%d)"), (const void *)a1, z)); returnCode(wins_nwstr(stdscr,a1,z)); }