Back to index

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

Go to the source code of this file.

Functions

 winsnstr (WINDOW *win, const char *s, int n)

Function Documentation

winsnstr ( WINDOW win,
const char *  s,
int  n 
)

Definition at line 46 of file lib_insnstr.c.

{
    int code = ERR;
    NCURSES_SIZE_T oy;
    NCURSES_SIZE_T ox;
    const unsigned char *str = (const unsigned char *) s;
    const unsigned char *cp;

    T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));

    if (win != 0 && str != 0) {
       oy = win->_cury;
       ox = win->_curx;
       for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
           _nc_insert_ch(win, (chtype) UChar(*cp));
       }
       win->_curx = ox;
       win->_cury = oy;
       _nc_synchook(win);
       code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function: