werase.c

来自「minux的源代码,一个非常小的操作系统」· C语言 代码 · 共 27 行

C
27
字号
#include <curses.h>
#include "curspriv.h"

/****************************************************************/
/* Werase() fills all lines of window 'win' with blanks and po-	*/
/* Sitions the cursor at home in the scroll region.		*/
/****************************************************************/

void werase(win)
WINDOW *win;
{
  int *end, *start, y, blank;

  blank = ' ' | (win->_attrs & ATR_MSK);

  for (y = win->_regtop; y <= win->_regbottom; y++) {	/* clear all lines */
	start = win->_line[y];
	end = &start[win->_maxx];
	while (start <= end)	/* clear all line */
		*start++ = blank;
	win->_minchng[y] = 0;
	win->_maxchng[y] = win->_maxx;
  }
  win->_cury = win->_regtop;	/* cursor home */
  win->_curx = 0;
}

⌨️ 快捷键说明

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