wgetstr.c

来自「MINIX系统源码」· C语言 代码 · 共 23 行

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

/****************************************************************/
/* Wgetstr(win,str) reads in a string (terminated by \n or \r)	*/
/* To the buffer pointed to by 'str', and displays the input	*/
/* In window 'win'. The user's erase and kill characters are	*/
/* Active.							*/
/****************************************************************/

int wgetstr(win, str)
WINDOW *win;
char *str;
{
  while ((*str = wgetch(win)) != ERR && *str != '\n') str++;
  if (*str == ERR) {
	*str = '\0';
	return ERR;
  }
  *str = '\0';
  return OK;
}

⌨️ 快捷键说明

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