📄 curses.ed
字号:
# @(#)curses.ed 1.1 92/07/30 SMI; from S5R3.1 1.31e keycapsHg/.*KEY_/s//KEY_/g/KEY_F([1-9]/dg'\(KEY_[^,]*\),[ ]*\([0-9][0-9]*\),[ ]*\(.*\)'s''#define \1 \2 /* \3 */'w ./tmp/keycapse !sort +2n ./tmp/keycapsg'\(KEY_[^ ] \)'s''\1 'g'\(KEY_[^ ][^ ] \)'s''\1 'g'\(KEY_[^ ][^ ][^ ] \)'s''\1 '1i/* Funny "characters" enabled for various special function keys for input *//* This list is created from caps and curses.ed. Do not edit it! */#define KEY_MIN 0401 /* Minimum curses key */#define KEY_BREAK 0401 /* break key (unreliable) */./KEY_F(0)/s//KEY_F0 /a#define KEY_F(n) (KEY_F0+(n)) /* Space for 64 function keys is reserved. */./KEY_ENTER/a#define KEY_SRESET 0530 /* soft (partial) reset (unreliable) */#define KEY_RESET 0531 /* reset or hard reset (unreliable) */./KEY_A1/i /* The keypad is arranged like this: */ /* a1 up a3 */ /* left b2 right */ /* c1 down c3 */.$a#define KEY_MAX 0777 /* Maximum curses key */.1i/* * curses.h - this file is automatically made from caps and * curses.ed. Don't make changes directly to curses.h! */#ifndef CURSES_H#define CURSES_H /* define prevents multiple includes */#include <stdio.h> /* * This trick is used to distinguish between SYSV and V7 systems. * We assume that L_ctermid is only defined in stdio.h in SYSV * systems, but not in V7 or Berkeley UNIX. */#ifdef L_ctermid# define SYSV#endif#ifdef SYSV# ifndef VINTR# include <termio.h># ifdef PENDIN# include <sys/filio.h> /* SunOS, so drag in FIONREAD */# endif /* PENDIN */# endif /* VINTR */ typedef struct termio SGTTY;#else /* !SYSV */# ifndef _SGTTYB_# include <sgtty.h># endif /* _SGTTYB_ */ typedef struct sgttyb SGTTY;/* * Here we attempt to improve portability by providing some #defines * for SYSV functions on non-SYSV systems. */# define memcpy(dst, src, len) bcopy((src), (dst), (len))# define strchr index# define strrchr rindex#endif /* SYSV */typedef char bool;#define _VR3_COMPAT_CODE/* * chtype is the type used to store a character together with attributes. * It can be set to "char" to save space, or "long" to get more attributes. */#ifdef CHTYPE typedef CHTYPE chtype;#else typedef unsigned long chtype;#endif /* CHTYPE *//* Define for the 'old' definition of chtype is required when we are running in compatibility mode*/#ifdef _VR3_COMPAT_CODEtypedef unsigned short _ochtype;#endif/* TRUE and FALSE get defined so many times, *//* let's not get in the way of other definitions. */#if !defined(TRUE) || ((TRUE) != 1)#define TRUE (1)#endif#if !defined(FALSE) || ((FALSE) != 0)#define FALSE (0)#endif#if !defined(ERR) || ((ERR) != -1)#define ERR (-1)#endif#if !defined(OK) || ((OK) != 0)#define OK (0)#endif/* short-hand notations */typedef struct _win_st WINDOW;typedef struct screen SCREEN;struct _win_st{ short _cury, _curx; /* current coordinates */ short _maxy, _maxx; /* max coordinates */ short _begy, _begx; /* (0,0) screen coordinates */ char _flags; short _yoffset; /* actual begy is _begy+_yoffset */ bool _clear, /* clearok() info */ _leave, /* leaveok() info */ _immed, /* window in immediate mode */ _sync; /* auto syncup of parent */ WINDOW *_padwin; /* "pad" area for current window */#ifdef _VR3_COMPAT_CODE _ochtype **_y16; /* MUST stay at this offset in WINDOW */#endif short *_firstch; /* first change in line */ short *_lastch; /* last change in line */ short _tmarg, _bmarg; /* scrolling region bounds */ /* MUST stay at this offset in WINDOW */ unsigned _scroll : 1; /* scrollok() info */ unsigned _use_idl : 1; unsigned _use_keypad : 1; unsigned _notimeout : 1; unsigned _use_idc : 1; chtype _attrs; /* current window attributes */ chtype _bkgd; /* background, normally blank */ int _delay; /* delay period on wgetch * 0: for nodelay * <0: for infinite delay * >0: delay time in units of millisec */ short _ndescs; /* number of descendants */ short _parx, _pary; /* coords relative to parent (0,0) */ WINDOW *_parent; /* the parent if this is a subwin */ chtype **_y; /* lines of data */};/* _lastch is initially set to this, _firstch is set to win->_maxx */#define _NOCHANGE -1#define _INFINITY 16000 /* no line can be longer than this *//* values for win->_flags */#define _ISPAD 001#define _WINCHANGED 002#define _WINMOVED 004#define _WINSDEL 010#define _CANT_BE_IMMED 020#define _WIN_ADD_ONE 040#define _WIN_INS_ONE 100#define STUPID 0#define UNKNOWN 1#define CURS_BAD_MALLOC 2/* * Various tricks to shut up lint about things that are perfectly fine. */#if defined(lint) && !defined(CURSES) /* if not internal to curses source */ struct screen { int _nobody_; };#endif /* lint *//* common external variables */extern int LINES, COLS, TABSIZE;extern short curs_errno;extern WINDOW *stdscr, *curscr;extern char ttytype[];/* Function declarations */extern SCREEN *newscreen(/*termname,lines,cols,tabsiz,fout,fin*/), *setcurscreen(/*screenptr*/);extern WINDOW *initscr(), *newwin(/*nlines,ncols,begy,begx*/), *newpad(/*nlines,ncols*/), *derwin(/*orig,nlines,ncols,begy,begx*/), *dupwin(/*orig*/), *getwin(/*file*/);extern chtype winch();extern int wgetch(); /* because it can return KEY_*, for instance. */extern char *longname(), /* long name of terminal */ *termname(), /* effective terminal name */ *keyname(/*int*/), /* name of token returned by wgetch() */ *slk_label(/*index*/), curs_parm_err[], *curs_err_strings[], erasechar(), killchar();extern void vidupdate(), wsyncup(), wsyncdown(), delkeymap(), _ring(), delscreen(), curserr(), _setqiflush(), immedok(), wtimeout(), wbkgdset(), wcursyncup();extern int cbreak(), nocbreak(), reset_prog_mode(), reset_shell_mode(), def_prog_mode(), _setecho(), _setnonl(), def_shell_mode(), raw(), savetty(), traceon(), _meta(), traceoff(), noraw(), flushinp(), _getsyx(), nodelay(), resetty(), ripoffline(), setsyx(), slk_refresh(), slk_restore(), notimeout(), clearok(), leaveok(), scrollok(), wstandend(), wstandout(); extern int crmode(), nocrmode(), ungetch();#define getsyx(y,x) _getsyx(&(y),&(x))/* * Functions to get at the window structure. */#define getyx(win,y,x) ((y) = getcury(win), (x) = getcurx(win))#define getbegyx(win,y,x) ((y) = getbegy(win), (x) = getbegx(win))#define getmaxyx(win,y,x) ((y) = getmaxy(win), (x) = getmaxx(win))#define getparyx(win,y,x) ((y) = getpary(win), (x) = getparx(win))#if defined(PERFORMANCE) && !defined(lint)#define getcury(win) ((win)->_cury)#define getcurx(win) ((win)->_curx)#define getbegy(win) ((win)->_begy)#define getbegx(win) ((win)->_begx)#define getmaxy(win) ((win)->_maxy)#define getmaxx(win) ((win)->_maxx)#define getpary(win) ((win)->_pary)#define getparx(win) ((win)->_parx)#define getbkgd(win) ((win)->_bkgd)#define getattrs(win) ((win)->_attrs)#endif /* defined(PERFORMANCE) && !defined(lint) */#ifdef _VR3_COMPAT_CODE#define newterm newterm32extern SCREEN *newterm(/*termname,fout,fin*/), *set_term(/*screenptr*/);extern WINDOW *initscr32(), *subwin(/*orig,nlines,ncols,sbegy,sbegx*/), *subpad(/*orig,nlines,ncols,begy,begx*/);extern _ochtype *acs_map;extern chtype *acs32map;/* definitions for Vr3 source compatibility */#define initscr initscr32#define waddch w32addch#define wechochar w32echochar#define pechochar p32echochar#define winsch w32insch#define vidputs vid32puts#define vidattr vid32attr#define wattroff w32attroff#define wattron w32attron#define wattrset w32attrset#define acs_map acs32map#define box box32#else /* _VR3_COMPAT_CODE */extern chtype *acs_map;#endif /* _VR3_COMPAT_CODE */extern int wattroff(), wattron(), wattrset();#if defined(NOMACROS) || defined(lint)extern SCREEN *newterm(/*termname,fout,fin*/), *set_term(/*screenptr*/);extern WINDOW *subpad(), *subwin();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -