winsch.c

Go to the documentation of this file.
00001 #include <curses.h>
00002 #include "curspriv.h"
00003 
00004 /* Winsch() inserts character 'c' at the cursor position in
00005    window 'win'. The cursor is advanced.
00006 */
00007 
00008 int winsch(win, c)
00009 WINDOW *win;
00010 char c;
00011 {
00012   int *temp1;
00013   int *temp2;
00014   int *end;
00015   int x = win->_curx;
00016   int y = win->_cury;
00017   int maxx = win->_maxx;
00018 
00019   if ((c < ' ') && (c == '\n' || c == '\r' || c == '\t' || c == '\b'))
00020         return(waddch(win, c));
00021   end = &win->_line[y][x];
00022   temp1 = &win->_line[y][maxx];
00023   temp2 = temp1 - 1;
00024   if (c < ' ')                  /* if CTRL-char make space for 2 */
00025         temp2--;
00026   while (temp1 > end) *temp1-- = *temp2--;
00027   win->_maxchng[y] = maxx;
00028   if ((win->_minchng[y] == _NO_CHANGE) || (win->_minchng[y] > x))
00029         win->_minchng[y] = x;
00030   return(waddch(win, c));       /* fixes CTRL-chars too */
00031 }                               /* winsch */

Generated on Fri Apr 14 22:57:26 2006 for minix by  doxygen 1.4.6