]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_insch.c
ncurses 5.0
[ncurses.git] / ncurses / base / lib_insch.c
similarity index 83%
rename from ncurses/lib_insch.c
rename to ncurses/base/lib_insch.c
index ebee17882d3a258177f60652ae852b83bdab9546..ccc5ff5d024dc4460b7c2e599fa3e66de766eb1f 100644 (file)
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_insch.c,v 1.9 1998/02/11 12:13:54 tom Exp $")
+MODULE_ID("$Id: lib_insch.c,v 1.10 1998/06/28 00:26:52 tom Exp $")
 
 int  winsch(WINDOW *win, chtype c)
 {
 int code = ERR;
-chtype *temp1, *temp2;
-chtype *end;
 
        T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c)));
 
        if (win) {
-         end = &win->_line[win->_cury].text[win->_curx];
-         temp1 = &win->_line[win->_cury].text[win->_maxx];
-         temp2 = temp1 - 1;
+               struct ldat *line = &(win->_line[win->_cury]);
+               chtype *end = &(line->text[win->_curx]);
+               chtype *temp1 = &(line->text[win->_maxx]);
+               chtype *temp2 = temp1 - 1;
 
-         while (temp1 > end)
-           *temp1-- = *temp2--;
-         
-         *temp1 = _nc_render(win, c);
-         
-         win->_line[win->_cury].lastchar = win->_maxx;
-         if (win->_line[win->_cury].firstchar == _NOCHANGE
-             ||  win->_line[win->_cury].firstchar > win->_curx)
-           win->_line[win->_cury].firstchar = win->_curx;
-         code = OK;
+               CHANGED_TO_EOL(line, win->_curx, win->_maxx);
+               while (temp1 > end)
+                       *temp1-- = *temp2--;
+
+               *temp1 = _nc_render(win, c);
+               code = OK;
        }
        returnCode(code);
 }