Back to index

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

Go to the source code of this file.

Functions

 winnstr (WINDOW *win, char *str, int n)

Function Documentation

winnstr ( WINDOW win,
char *  str,
int  n 
)

Definition at line 46 of file lib_instr.c.

{
    int i = 0, row, col;

    T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n));

    if (!str)
       returnCode(0);

    if (win) {
       getyx(win, row, col);

       if (n < 0)
           n = win->_maxx - win->_curx + 1;

       for (; i < n;) {
           str[i++] = CharOf(win->_line[row].text[col]);
           if (++col > win->_maxx) {
              col = 0;
              if (++row > win->_maxy)
                  break;
           }
       }
    }
    str[i] = '\0';          /* SVr4 does not seem to count the null */
    T(("winnstr returns %s", _nc_visbuf(str)));
    returnCode(i);
}

Here is the call graph for this function: