wclrto~2.c

来自「操作系统源代码」· C语言 代码 · 共 37 行

C
37
字号
#include <curses.h>#include "curspriv.h"/****************************************************************//* Wclrtoeol() fills the half of the cursor line to the right	*//* Of the cursor in window 'win' with blanks.			*//****************************************************************/int wclrtoeol(win)WINDOW *win;{  int *maxx, *ptr, *end, y, x, minx, blank;  y = win->_cury;  x = win->_curx;  blank = ' ' | (win->_attrs & ATR_MSK);  end = &win->_line[y][win->_maxx];  minx = _NO_CHANGE;  maxx = &win->_line[y][x];  for (ptr = maxx; ptr <= end; ptr++) {	if (*ptr != blank) {		maxx = ptr;		if (minx == _NO_CHANGE) minx = ptr - win->_line[y];		*ptr = blank;	}			/* if */  }				/* for */  if (minx != _NO_CHANGE) {	if (win->_minchng[y] > minx || win->_minchng[y] == _NO_CHANGE)		win->_minchng[y] = minx;	if (win->_maxchng[y] < maxx - win->_line[y])		win->_maxchng[y] = maxx - win->_line[y];  }  return(OK);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?