wdelch.c

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

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

/* Wdelch() deletes the character at the window cursor, and the
   characters to the right of it are shifted left, inserting a
   space at the last position of the line.
*/

int wdelch(win)
WINDOW *win;
{
  int *temp1;
  int *temp2;
  int *end;
  int y = win->_cury;
  int x = win->_curx;
  int maxx = win->_maxx;

  end = &win->_line[y][maxx];
  temp1 = &win->_line[y][x];
  temp2 = temp1 + 1;
  while (temp1 < end) *temp1++ = *temp2++;
  *temp1 = ' ' | (win->_attrs & ATR_MSK);
  win->_maxchng[y] = maxx;
  if (win->_minchng[y] == _NO_CHANGE || win->_minchng[y] > x)
	win->_minchng[y] = x;
  return(OK);
}

⌨️ 快捷键说明

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