⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winerase.c

📁 该程序是C语言编写的
💻 C
字号:
/****************************************************************/
/*								*/
/* Erase() routines of the PCcurses package			*/
/*								*/
/****************************************************************/
/* This version of curses is based on ncurses, a curses version	*/
/* originally written by Pavel Curtis at Cornell University.	*/
/* I have made substantial changes to make it run on IBM PC's,	*/
/* and therefore consider myself free to make it public domain.	*/
/*				Bjorn Larsson (bl@infovox.se)	*/
/****************************************************************/
/* 1.4:  Use of short wherever possible. Portability		*/
/*	 improvements:					900114	*/
/* 1.3:	 MSC -W3, Turbo'C' -w -w-pro checkes:		881005	*/
/* 1.2:	 Max limits off by 1. Fixed thanks to S. Creps:	881002	*/
/* 1.0:	 Release:					870515	*/
/****************************************************************/

#include <curses.h>
#include <curspriv.h>

char _curses_winerase_rcsid[] = "@(#)winerase.c   v.1.4  - 900114";

/****************************************************************/
/* 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;
  {
  short		*end;
  short		*start;
  short		 y;
  static short	 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 - 1];
    while (start <= end)				/* clear all line */
      *start++ = blank;
    win->_minchng[y] = 0;
    win->_maxchng[y] = win->_maxx - 1;
    }
  win->_cury = win->_regtop;				/* cursor home */
  win->_curx = 0;
  } /* werase */

/****************************************************************/
/* Erase() fills all lines of stdscr with blanks and positions	*/
/* the cursor at home in the scroll region.			*/
/****************************************************************/

void erase()
  {
  werase(stdscr);
  } /* erase */

⌨️ 快捷键说明

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