Back to index

tetex-bin  3.0
Functions
lib_in_wchnstr.c File Reference
#include <curses.priv.h>

Go to the source code of this file.

Functions

 win_wchnstr (WINDOW *win, cchar_t *wchstr, int n)

Function Documentation

win_wchnstr ( WINDOW win,
cchar_t *  wchstr,
int  n 
)

Definition at line 45 of file lib_in_wchnstr.c.

{
    int code = OK;

    TR(TRACE_CALLS, (T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n));
    if (win != 0
       && wchstr != 0) {
       int row, col;
       int j;

       getyx(win, row, col);

       if (n < 0) {
           n = getmaxx(win) + 1 - getcurx(win);
       }
       for (j = 0; j < n; ++j) {
           wchstr[j] = win->_line[row].text[col + j];
       }
       T(("result = %s", _nc_viscbuf(wchstr, n)));
    } else {
       code = ERR;
    }
    returnCode(code);
}