newpad.c
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 47 行
C
47 行
#ifdef lintstatic char *sccsid = "@(#)newpad.c 4.1 (ULTRIX) 7/2/90";#endif lint# include "curses.ext"# include <signal.h>char *calloc();char *malloc();extern char *getenv();extern WINDOW *makenew();/* * Like newwin, but makes a pad instead of a window. A pad is not * associated with part of the screen, so it can be bigger. */WINDOW *newpad(nlines, ncols)register int nlines;{ register WINDOW *win; register chtype *sp; register int i; char *calloc(); if ((win = makenew(nlines, ncols, 0, 0)) == NULL) return NULL; win->_flags |= _ISPAD; for (i = 0; i < nlines; i++) if ((win->_y[i] = (chtype *) calloc(ncols, sizeof (chtype))) == NULL) { register int j; for (j = 0; j < i; j++) free((char *)win->_y[j]); free((char *)win->_firstch); free((char *)win->_lastch); free((char *)win->_y); free((char *)win); return NULL; } else for (sp = win->_y[i]; sp < win->_y[i] + ncols; ) *sp++ = ' '; return win;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?