curses.ed revision 2
2N/Ae keycaps
2N/AH
2N/Ag/.*KEY_/s//KEY_/
2N/Ag/KEY_F([1-9]/d
2N/Ag'\(KEY_[^,]*\),[ ]*\([0-9][0-9]*\),[ ]*\(.*\)'s''#define \1 \2 /* \3 */'
2N/Aw ./tmp/keycaps
2N/Ae !sort +2n ./tmp/keycaps
2N/Ag'\(KEY_[^ ] \)'s''\1 '
2N/Ag'\(KEY_[^ ][^ ] \)'s''\1 '
2N/Ag'\(KEY_[^ ][^ ][^ ] \)'s''\1 '
2N/A1i
2N/A/* Funny "characters" enabled for various special function keys for input */
2N/A/* This list is created from caps and curses.ed. Do not edit it! */
2N/A#define KEY_MIN 0401 /* Minimum curses key */
2N/A#define KEY_BREAK 0401 /* break key (unreliable) */
2N/A.
2N/A/KEY_F(0)/s//KEY_F0 /
2N/Aa
2N/A#define KEY_F(n) (KEY_F0+(n)) /* Space for 64 function keys */
2N/A /* is reserved. */
2N/A.
2N/A/KEY_ENTER/a
2N/A#define KEY_SRESET 0530 /* soft (partial) reset (unreliable) */
2N/A#define KEY_RESET 0531 /* reset or hard reset (unreliable) */
2N/A.
2N/A/KEY_A1/i
2N/A /* The keypad is arranged like this: */
2N/A /* a1 up a3 */
2N/A /* left b2 right */
2N/A /* c1 down c3 */
2N/A.
2N/A$a
2N/A#define KEY_MAX 0777 /* Maximum curses key */
2N/A.
2N/A1i
2N/A#ifndef _CURSES_H
2N/A#define _CURSES_H
2N/A
2N/A/*
2N/A * curses.h - this file is automatically made from caps and
2N/A * curses.ed. Don't make changes directly to curses.h!
2N/A */
2N/A
2N/A#include <widec.h>
2N/A
2N/A#include <stdio.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#define CSMAX 4
2N/A
2N/A/*
2N/A * This trick is used to distinguish between SYSV and V7 systems.
2N/A * We assume that L_ctermid is only defined in stdio.h in SYSV
2N/A * systems, but not in V7 or Berkeley UNIX.
2N/A */
2N/A#ifdef L_ctermid
2N/A#ifdef SYSV
2N/A#undef SYSV
2N/A#endif
2N/A#define SYSV
2N/A#endif
2N/A/* Some V7 systems define L_ctermid - we list those here */
2N/A#ifdef BSD
2N/A#undef SYSV
2N/A#endif
2N/A
2N/A#ifdef SYSV
2N/A
2N/A#include <termio.h>
2N/Atypedef struct termio SGTTY;
2N/Atypedef struct termios SGTTYS;
2N/A
2N/A#else /* !SYSV */
2N/A
2N/A#ifndef _SGTTYB_
2N/A#include <sgtty.h>
2N/A#endif /* _SGTTYB_ */
2N/Atypedef struct sgttyb SGTTY;
2N/A
2N/A#endif /* SYSV */
2N/A
2N/A/*
2N/A * bool is a built-in type in standard C++ and as such is not
2N/A * defined here when using standard C++. However, the GNU compiler
2N/A * fixincludes utility nonetheless creates it's own version of this
2N/A * header for use by gcc and g++. In that version it adds a redundant
2N/A * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
2N/A * header we need to include the following magic comment:
2N/A *
2N/A * we must use the C++ compiler's type
2N/A *
2N/A * The above comment should not be removed or changed until GNU
2N/A * gcc/fixinc/inclhack.def is updated to bypass this header.
2N/A */
2N/A#if !defined(__cplusplus) && !defined(_BOOL)
2N/Atypedef char bool;
2N/A#endif /* !defined(__cplusplus) && !defined(_BOOL) */
2N/A
2N/A#define _VR3_COMPAT_CODE
2N/A/*
2N/A * chtype is the type used to store a character together with attributes.
2N/A * It can be set to "char" to save space, or "long" to get more attributes.
2N/A */
2N/A#ifdef CHTYPE
2N/Atypedef CHTYPE chtype;
2N/A#else
2N/A#ifdef _LP64
2N/Atypedef unsigned int chtype;
2N/A#else
2N/Atypedef unsigned long chtype;
2N/A#endif /* _LP64 */
2N/A#endif /* CHTYPE */
2N/A
2N/A/*
2N/A * Define for the 'old' definition of chtype is required
2N/A * when we are running in compatibility mode
2N/A */
2N/A#ifdef _VR3_COMPAT_CODE
2N/Atypedef unsigned short _ochtype;
2N/A#endif
2N/A
2N/A/* TRUE and FALSE get defined so many times, */
2N/A/* let's not get in the way of other definitions. */
2N/A#if !defined(TRUE) || ((TRUE) != 1)
2N/A#define TRUE (1)
2N/A#endif
2N/A#if !defined(FALSE) || ((FALSE) != 0)
2N/A#define FALSE (0)
2N/A#endif
2N/A#if !defined(ERR) || ((ERR) != -1)
2N/A#define ERR (-1)
2N/A#endif
2N/A#if !defined(OK) || ((OK) != 0)
2N/A#define OK (0)
2N/A#endif
2N/A
2N/A/* short-hand notations */
2N/Atypedef struct _win_st WINDOW;
2N/Atypedef struct screen SCREEN;
2N/Atypedef struct _Mouse MOUSE_STATUS;
2N/A
2N/Astruct _win_st
2N/A{
2N/A short _cury, _curx; /* current coordinates */
2N/A short _maxy, _maxx; /* max coordinates */
2N/A short _begy, _begx; /* (0,0) screen coordinates */
2N/A char _flags;
2N/A short _yoffset; /* actual begy is _begy+_yoffset */
2N/A bool _clear, /* clearok() info */
2N/A _leave, /* leaveok() info */
2N/A _immed, /* window in immediate mode */
2N/A _sync; /* auto syncup of parent */
2N/A WINDOW *_padwin; /* "pad" area for current window */
2N/A#ifdef _VR3_COMPAT_CODE
2N/A _ochtype **_y16; /* MUST stay at this offset in WINDOW */
2N/A#endif
2N/A short *_firstch; /* first change in line */
2N/A short *_lastch; /* last change in line */
2N/A short _tmarg, _bmarg; /* scrolling region bounds */
2N/A /* MUST stay at this offset in WINDOW */
2N/A unsigned _scroll : 1; /* scrollok() info */
2N/A unsigned _use_idl : 1;
2N/A unsigned _use_keypad : 1;
2N/A unsigned _notimeout : 1;
2N/A unsigned _use_idc : 1;
2N/A chtype _attrs; /* current window attributes */
2N/A chtype _bkgd; /* background, normally blank */
2N/A int _delay; /* delay period on wgetch */
2N/A /* 0: for nodelay */
2N/A /* <0: for infinite delay */
2N/A /* >0: delay time in millisec */
2N/A short _ndescs; /* number of descendants */
2N/A short _parx, _pary; /* coords relative to parent (0,0) */
2N/A WINDOW *_parent; /* the parent if this is a subwin */
2N/A chtype **_y; /* lines of data */
2N/A short _nbyte; /* number of bytes to come */
2N/A short _index; /* index to hold coming char */
2N/A char _waitc[CSMAX]; /* array to hold partial m-width char */
2N/A bool _insmode; /* TRUE for inserting, */
2N/A /* FALSE for adding */
2N/A};
2N/A
2N/A/* _lastch is initially set to this, _firstch is set to win->_maxx */
2N/A#define _NOCHANGE -1
2N/A#define _INFINITY 16000 /* no line can be longer than this */
2N/A
2N/A/* values for win->_flags */
2N/A#define _ISPAD 001
2N/A#define _WINCHANGED 002
2N/A#define _WINMOVED 004
2N/A#define _WINSDEL 010
2N/A#define _CANT_BE_IMMED 020
2N/A#define _WIN_ADD_ONE 040
2N/A#define _WIN_INS_ONE 100
2N/A
2N/Astruct _Mouse {
2N/A int x, y;
2N/A short button[3];
2N/A int changes;
2N/A};
2N/A
2N/A#define CURS_STUPID 0
2N/A#define CURS_UNKNOWN 1
2N/A#define CURS_BAD_MALLOC 2
2N/A
2N/A/*
2N/A * Various tricks to shut up lint about things that are perfectly fine.
2N/A */
2N/A#if defined(__lint) && !defined(CURSES) /* if not internal to curses source */
2N/Astruct screen {
2N/A int _nobody_;
2N/A};
2N/A#endif /* __lint */
2N/A
2N/A/* common external variables */
2N/A
2N/Aextern int LINES, COLS, TABSIZE, COLORS, COLOR_PAIRS;
2N/A
2N/Aextern short curs_errno;
2N/A
2N/Aextern WINDOW *stdscr, *curscr;
2N/A
2N/Aextern MOUSE_STATUS Mouse_status;
2N/A
2N/Aextern char ttytype[];
2N/A
2N/Aextern char curs_parm_err[],
2N/A *curs_err_strings[];
2N/A
2N/A/* Function declarations */
2N/A
2N/A#ifdef _VR3_COMPAT_CODE
2N/A
2N/Aextern _ochtype *acs_map;
2N/Aextern chtype *acs32map;
2N/A
2N/A/* definitions for Vr3 source compatibility */
2N/A
2N/A#define initscr initscr32
2N/A#define newterm newterm32
2N/A#define waddch w32addch
2N/A#define wechochar w32echochar
2N/A#define pechochar p32echochar
2N/A#define winsch w32insch
2N/A#define vidputs vid32puts
2N/A#define vidattr vid32attr
2N/A#define wattroff w32attroff
2N/A#define wattron w32attron
2N/A#define wattrset w32attrset
2N/A#define acs_map acs32map
2N/A#define box box32
2N/A
2N/A#ifdef __STDC__
2N/Aextern WINDOW *initscr(void);
2N/Aextern SCREEN *newterm(char *, FILE *, FILE *);
2N/A#else
2N/Aextern WINDOW *initscr();
2N/Aextern SCREEN *newterm();
2N/A#endif
2N/A
2N/A/* declarations for mini-curses */
2N/A
2N/A#ifdef __STDC__
2N/Aextern WINDOW *m_initscr(void);
2N/A
2N/Aextern SCREEN *m_newterm(char *, FILE *, FILE *);
2N/A
2N/Aextern int m_addch(int), m_addstr(char *), m_clear(void), m_erase(void),
2N/A m_move(int, int), m_refresh(void);
2N/A
2N/A#else /* __STDC__ */
2N/Aextern WINDOW *m_initscr();
2N/A
2N/Aextern SCREEN *m_newterm();
2N/A
2N/Aextern int m_addch(), m_addstr(), m_clear(), m_erase(),
2N/A m_move(), m_refresh();
2N/A
2N/A#endif /* __STDC__ */
2N/A
2N/A#else /* _VR3_COMPAT_CODE */
2N/A
2N/Aextern chtype *acs_map;
2N/A
2N/A#endif /* _VR3_COMPAT_CODE */
2N/A
2N/A#ifdef __STDC__
2N/A
2N/Aextern SCREEN *newscreen(char *, int, int, int, FILE *, FILE *);
2N/Aextern SCREEN *setcurscreen(SCREEN *);
2N/A
2N/Aextern WINDOW *initscr(void);
2N/Aextern WINDOW *newwin(int, int, int, int);
2N/Aextern WINDOW *newpad(int, int);
2N/Aextern WINDOW *derwin(WINDOW *, int, int, int, int);
2N/Aextern WINDOW *dupwin(WINDOW *);
2N/Aextern WINDOW *getwin(FILE *);
2N/A
2N/Aextern int wgetch(WINDOW *); /* it can return KEY_*, for instance. */
2N/A
2N/Aextern char *longname(void); /* long name of terminal */
2N/Aextern char *termname(void); /* effective terminal name */
2N/Aextern char *keyname(int); /* name of token returned by wgetch() */
2N/Aextern char *slk_label(int);
2N/Aextern char erasechar(void);
2N/Aextern char killchar(void);
2N/Aextern char *unctrl(int);
2N/A
2N/Aextern chtype termattrs(void);
2N/A
2N/Aextern void vidupdate(chtype, chtype, int (*)(char));
2N/Aextern void wsyncup(WINDOW *);
2N/Aextern void wsyncdown(WINDOW *);
2N/Aextern void delscreen(SCREEN *);
2N/Aextern void curserr(void);
2N/Aextern void _setqiflush(int);
2N/Aextern void wcursyncup(WINDOW *);
2N/A
2N/Aextern int cbreak(void);
2N/Aextern int nocbreak(void);
2N/Aextern int reset_prog_mode(void);
2N/Aextern int reset_shell_mode(void);
2N/Aextern int def_prog_mode(void);
2N/Aextern int _setecho(int);
2N/Aextern int _setnonl(int);
2N/Aextern int def_shell_mode(void);
2N/Aextern int raw(void);
2N/Aextern int savetty(void);
2N/Aextern int traceon(void);
2N/Aextern int _meta(int);
2N/Aextern int traceoff(void);
2N/Aextern int noraw(void);
2N/Aextern int flushinp(void);
2N/Aextern int _getsyx(int *, int *);
2N/Aextern int _ring(bool);
2N/Aextern int resetty(void);
2N/Aextern int ripoffline(int, int (*)(WINDOW *, int));
2N/Aextern int setsyx(int, int);
2N/Aextern int slk_refresh(void);
2N/Aextern int slk_restore(void);
2N/Aextern int wstandend(WINDOW *);
2N/Aextern int wstandout(WINDOW *);
2N/Aextern int wattroff(WINDOW *, chtype);
2N/Aextern int wattron(WINDOW *, chtype);
2N/Aextern int wattrset(WINDOW *, chtype);
2N/Aextern int wrefresh(WINDOW *);
2N/A
2N/Aextern int copywin(WINDOW *, WINDOW *, int, int, int, int, int, int, int);
2N/Aextern int curs_set(int);
2N/Aextern int delay_output(int);
2N/Aextern int delwin(WINDOW *);
2N/Aextern int doupdate(void);
2N/Aextern int drainio(int);
2N/Aextern int endwin(void);
2N/Aextern int isendwin(void);
2N/Aextern int baudrate(void);
2N/Aextern int has_ic(void);
2N/Aextern int has_il(void);
2N/Aextern int keypad(WINDOW *, bool);
2N/Aextern int mvcur(int, int, int, int);
2N/A
2N/Aextern int mvprintw(int, int, ...);
2N/Aextern int mvscanw(int, int, ...);
2N/Aextern int mvwprintw(WINDOW *, int, int, ...);
2N/Aextern int mvwscanw(WINDOW *, int, int, ...);
2N/Aextern int printw(char *, ...);
2N/Aextern int scanw(char *, ...);
2N/Aextern int wprintw(WINDOW *, ...);
2N/Aextern int wscanw(WINDOW *, ...);
2N/A
2N/A /* __va_list is the ANSI-C safe definition of the */
2N/A /* va_list type as allowed to be defined in stdlib.h. */
2N/A /* <stdio.h> provides the nested include of <va_list.h> */
2N/A /* which provides this namespace safe definition. */
2N/A /* Either <stdarg.h> or <varargs.h> must be included to */
2N/A /* use these interfaces. */
2N/A
2N/Aextern int vwprintw(WINDOW *, char *, __va_list);
2N/Aextern int vwscanw(WINDOW *, char *, __va_list);
2N/A
2N/Aextern int mvwin(WINDOW *, int, int);
2N/Aextern int mvderwin(WINDOW *, int, int);
2N/Aextern int napms(int);
2N/Aextern int newkey(char *, short, bool);
2N/Aextern int filter(void);
2N/Aextern int pechochar(WINDOW *, chtype);
2N/Aextern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
2N/Aextern int prefresh(WINDOW *, int, int, int, int, int, int);
2N/A
2N/Aextern int putwin(WINDOW *, FILE *);
2N/Aextern int wredrawln(WINDOW *, int, int);
2N/Aextern int scr_dump(char *);
2N/Aextern int setupterm(char *, int, int *);
2N/A
2N/Aextern int slk_attron(chtype);
2N/Aextern int slk_attroff(chtype);
2N/Aextern int slk_attrset(chtype);
2N/Aextern int slk_clear(void);
2N/Aextern int slk_noutrefresh(void);
2N/Aextern int slk_set(int, char *, int);
2N/Aextern int slk_start(int, int *);
2N/Aextern int slk_touch(void);
2N/Aextern int start_color(void);
2N/Aextern int typeahead(int);
2N/A
2N/Aextern bool can_change_color(void);
2N/Aextern bool has_colors(void);
2N/A
2N/Aextern int waddch(WINDOW *, chtype);
2N/Aextern int waddchnstr(WINDOW *, chtype *, int);
2N/Aextern int waddnstr(WINDOW *, char *, int);
2N/Aextern int wbkgd(WINDOW *, chtype);
2N/Aextern int wborder(WINDOW *, chtype, chtype, chtype, chtype,
2N/A chtype, chtype, chtype, chtype);
2N/Aextern int wclrtobot(WINDOW *);
2N/Aextern int wclrtoeol(WINDOW *);
2N/Aextern int wdelch(WINDOW *);
2N/Aextern int wechochar(WINDOW *, chtype);
2N/Aextern int wgetstr(WINDOW *, char *);
2N/Aextern int wgetnstr(WINDOW *, char *, int);
2N/Aextern int whline(WINDOW *, chtype, int);
2N/Aextern int wvline(WINDOW *, chtype, int);
2N/Aextern int winchnstr(WINDOW *, chtype *, int);
2N/Aextern int winchstr(WINDOW *, chtype *);
2N/Aextern int winnstr(WINDOW *, char *, int);
2N/Aextern int winsch(WINDOW *, chtype);
2N/Aextern int winsdelln(WINDOW *, int); /* internal */
2N/Aextern int winsnstr(WINDOW *, char *, int);
2N/Aextern int winstr(WINDOW *, char *);
2N/Aextern int wmove(WINDOW *, int, int);
2N/Aextern int wnoutrefresh(WINDOW *);
2N/Aextern int wredrawln(WINDOW *, int, int);
2N/Aextern int wscrl(WINDOW *, int);
2N/Aextern int wsetscrreg(WINDOW *, int, int);
2N/Aextern int wtouchln(WINDOW *, int, int, int);
2N/A
2N/Aextern int crmode(void);
2N/Aextern int nocrmode(void);
2N/Aextern int ungetch(int);
2N/A
2N/Aextern int mouse_set(long int);
2N/Aextern int mouse_on(long int);
2N/Aextern int mouse_off(long int);
2N/Aextern int request_mouse_pos(void);
2N/Aextern int map_button(unsigned long);
2N/A
2N/Aextern void wmouse_position(WINDOW *, int *, int *);
2N/A
2N/Aextern unsigned long getmouse(void), getbmap(void);
2N/A
2N/A /* the following declarations take integers as arguments */
2N/A /* to keep the CI5 compiler happy. what we really want */
2N/A /* to pass is given in comments. (by the way, we don't */
2N/A /* save anything by passing short or bool, since compiler */
2N/A /* expands them to integers any way */
2N/A
2N/Aextern int pair_content(short, short *, short *);
2N/Aextern int color_content(short, short *, short *, short *); /* as above */
2N/Aextern int init_color(short, short, short, short);
2N/Aextern int init_pair(short, short, short);
2N/Aextern int idlok(WINDOW *, bool);
2N/A
2N/Aextern void immedok(WINDOW *, bool);
2N/A
2N/Aextern chtype winwch(WINDOW *);
2N/A
2N/Aextern int pechowchar(WINDOW *, chtype);
2N/Aextern int ungetwch(const wchar_t);
2N/Aextern int waddnwstr(WINDOW *, wchar_t *, int);
2N/Aextern int waddwch(WINDOW *, chtype);
2N/Aextern int waddwchnstr(WINDOW *, chtype *, int);
2N/Aextern int wechowchar(WINDOW *, chtype);
2N/Aextern int wgetnwstr(WINDOW *, wchar_t *, int);
2N/Aextern int wgetwch(WINDOW *);
2N/Aextern int wgetwstr(WINDOW *, wchar_t *);
2N/Aextern int winnwstr(WINDOW *, wchar_t *, int);
2N/Aextern int winsnwstr(WINDOW *, wchar_t *, int);
2N/Aextern int winswch(WINDOW *, chtype);
2N/Aextern int winwchnstr(WINDOW *, chtype *, int);
2N/Aextern int winwstr(WINDOW *, wchar_t *);
2N/A
2N/A#else /* __STDC__ */
2N/A
2N/Aextern SCREEN *newscreen(), /* termname, lines, cols, tabsiz, fout, fin */
2N/A *setcurscreen(); /* screenptr */
2N/A
2N/Aextern WINDOW *initscr(),
2N/A *newwin(), /* nlines, ncols, begy, begx */
2N/A *newpad(), /* nlines, ncols */
2N/A *derwin(), /* orig, nlines, ncols, begy, begx */
2N/A *dupwin(), /* orig */
2N/A *getwin(); /* file */
2N/A
2N/Aextern int wgetch(); /* because it can return KEY_*, for instance. */
2N/A
2N/Aextern char *longname(), /* long name of terminal */
2N/A *termname(), /* effective terminal name */
2N/A *keyname(), /* (int) name of token returned by wgetch() */
2N/A *slk_label(), /* index */
2N/A erasechar(),
2N/A killchar(),
2N/A *unctrl();
2N/A
2N/Aextern chtype termattrs();
2N/A
2N/Aextern void vidupdate(), wsyncup(), wsyncdown(),
2N/A delkeymap(),
2N/A delscreen(), curserr(),
2N/A _setqiflush(),
2N/A immedok(),
2N/A wcursyncup();
2N/A
2N/Aextern int cbreak(), nocbreak(),
2N/A reset_prog_mode(), reset_shell_mode(), def_prog_mode(),
2N/A _setecho(), _setnonl(),
2N/A def_shell_mode(), raw(),
2N/A savetty(), traceon(), _meta(),
2N/A traceoff(), noraw(), flushinp(), _getsyx(),
2N/A _ring(), resetty(), ripoffline(), setsyx(), slk_refresh(),
2N/A slk_restore(), wstandend(), wstandout(),
2N/A wattroff(), wattron(), wattrset(), wrefresh();
2N/A
2N/Aextern int color_cont(), copywin(), curs_set(), delay_output(), delwin(),
2N/A doupdate(), drainio(), endwin(), isendwin(),
2N/A baudrate(), has_ic(), has_il(), idlok(),
2N/A init_color(), init_pair(), keypad(), mvcur();
2N/A
2N/Aextern int mvprintw(), mvscanw(), mvwprintw(), mvwscanw(),
2N/A printw(), scanw(), wprintw(), wscanw(), vwprintw(), vwscanw();
2N/A
2N/Aextern int mvwin(), mvderwin(), napms(), newkey(), filter(),
2N/A pair_content(), pechochar(), pnoutrefresh(), prefresh();
2N/A
2N/Aextern int putwin(), wredrawln(), scr_dump(), setupterm();
2N/A
2N/Aextern int slk_attrof(), slk_attrof(), slk_attrset(),
2N/A slk_clear(), slk_noutrefresh(), slk_set(),
2N/A slk_start(), slk_touch(), start_color(),
2N/A typeahead();
2N/A
2N/Aextern bool can_change_color(), has_colors();
2N/A
2N/Aextern int waddch(), waddchnstr(), waddnstr(), wbkgd(),
2N/A wborder(), wclrtobot(), wclrtoeol(), wdelch(), wechochar(),
2N/A wgetstr(), wgetnstr(), whline(), wvline(), winchnstr(),
2N/A winchstr(), winnstr(), winsch(),
2N/A winsdelln(), /* internal */
2N/A winsnstr(), winstr(), wmove(), wnoutrefresh(), wredrawln(),
2N/A wscrl(), wsetscrreg(), wtouchln();
2N/A
2N/Aextern int crmode(), nocrmode(), ungetch();
2N/A
2N/Aextern int mouse_set(), mouse_on(), mouse_off(),
2N/A request_mouse_pos(), map_button();
2N/A
2N/Aextern void wmouse_position();
2N/A
2N/Aextern unsigned long getmouse(), getbmap();
2N/A
2N/Aextern chtype winwch();
2N/A
2N/Aextern int pechowchar(), ungetwch(), waddnwstr(), waddwch(),
2N/A waddwchnstr(), wechowchar(), wgetnwstr(), wgetwch(),
2N/A wgetwstr(), winnwstr(), winsnwstr(), winswch(),
2N/A winwchnstr(), winwstr();
2N/A
2N/A#endif /* __STDC__ */
2N/A
2N/A#define getsyx(y, x) _getsyx(&(y), &(x))
2N/A
2N/A/*
2N/A * Functions to get at the window structure.
2N/A */
2N/A
2N/A#define getyx(win, y, x) ((y) = getcury(win), (x) = getcurx(win))
2N/A#define getbegyx(win, y, x) ((y) = getbegy(win), (x) = getbegx(win))
2N/A#define getmaxyx(win, y, x) ((y) = getmaxy(win), (x) = getmaxx(win))
2N/A#define getparyx(win, y, x) ((y) = getpary(win), (x) = getparx(win))
2N/A
2N/A#if defined(CURS_PERFORMANCE) && !defined(__lint)
2N/A#define getcury(win) ((win)->_cury)
2N/A#define getcurx(win) ((win)->_curx)
2N/A#define getbegy(win) ((win)->_begy)
2N/A#define getbegx(win) ((win)->_begx)
2N/A#define getmaxy(win) ((win)->_maxy)
2N/A#define getmaxx(win) ((win)->_maxx)
2N/A#define getpary(win) ((win)->_pary)
2N/A#define getparx(win) ((win)->_parx)
2N/A#define getbkgd(win) ((win)->_bkgd)
2N/A#define getattrs(win) ((win)->_attrs)
2N/A#else /* defined(CURS_PERFORMANCE) && !defined(__lint) */
2N/A
2N/A#ifdef __STDC__
2N/Aextern int getcury(WINDOW *);
2N/Aextern int getcurx(WINDOW *);
2N/Aextern int getbegy(WINDOW *);
2N/Aextern int getbegx(WINDOW *);
2N/Aextern int getmaxy(WINDOW *);
2N/Aextern int getmaxx(WINDOW *);
2N/Aextern int getpary(WINDOW *);
2N/Aextern int getparx(WINDOW *);
2N/A
2N/Aextern chtype getbkgd(WINDOW *);
2N/Aextern chtype getattrs(WINDOW *);
2N/A
2N/A#else /* __STDC__ */
2N/Aextern int getcury(), getcurx(), getbegy(), getbegx(),
2N/A getmaxy(), getmaxx(), getpary(), getparx();
2N/A
2N/Aextern chtype getbkgd(), getattrs();
2N/A
2N/A#endif /* __STDC__ */
2N/A#endif /* defined(CURS_PERFORMANCE) && !defined(__lint) */
2N/A
2N/A#if defined(NOMACROS) || defined(__lint)
2N/A
2N/A#ifdef __STDC__
2N/A
2N/Aextern SCREEN *newterm(char *, FILE *, FILE *);
2N/Aextern SCREEN *set_term(SCREEN *);
2N/A
2N/Aextern WINDOW *subpad(WINDOW *, int, int, int, int);
2N/Aextern WINDOW *subwin(WINDOW *, int, int, int, int);
2N/A
2N/Aextern char *unctrl(int);
2N/A
2N/Aextern chtype inch(void);
2N/Aextern chtype winch(WINDOW *);
2N/Aextern chtype mvinch(int, int);
2N/Aextern chtype mvwinch(WINDOW *, int, int);
2N/A
2N/Aextern int addch(chtype);
2N/Aextern int addchnstr(chtype *, int);
2N/Aextern int addchstr(chtype *);
2N/Aextern int addnstr(char *, int);
2N/Aextern int addstr(char *);
2N/Aextern int attroff(chtype);
2N/Aextern int attron(chtype);
2N/Aextern int attrset(chtype);
2N/Aextern int beep(void);
2N/Aextern int bkgd(chtype);
2N/Aextern int border(chtype, chtype, chtype, chtype,
2N/A chtype, chtype, chtype, chtype);
2N/Aextern int box(WINDOW *, chtype, chtype);
2N/Aextern int clear(void);
2N/Aextern int clearok(WINDOW *, bool);
2N/Aextern int clrtobot(void);
2N/Aextern int clrtoeol(void);
2N/Aextern int crmode(void);
2N/Aextern int delch(void);
2N/Aextern int deleteln(void);
2N/Aextern int echo(void);
2N/Aextern int echochar(chtype);
2N/Aextern int erase(void);
2N/Aextern int fixterm(void);
2N/Aextern int flash(void);
2N/Aextern int garbagedlines(WINDOW *, int, int);
2N/Aextern int garbagedwin(WINDOW *);
2N/Aextern int getch(void);
2N/Aextern int getstr(char *);
2N/Aextern int gettmode(void);
2N/Aextern int halfdelay(int);
2N/Aextern int hline(chtype, int);
2N/Aextern int inchnstr(chtype *, int);
2N/Aextern int inchstr(chtype *);
2N/Aextern int innstr(char *, int);
2N/Aextern int insch(chtype);
2N/Aextern int insdelln(int);
2N/Aextern int insertln(void);
2N/Aextern int insnstr(char *, int);
2N/Aextern int insstr(char *);
2N/Aextern int instr(char *);
2N/Aextern int intrflush(WINDOW *, int);
2N/Aextern int is_linetouched(WINDOW *, int);
2N/Aextern int is_wintouched(WINDOW *);
2N/Aextern int leaveok(WINDOW *, bool);
2N/Aextern int meta(WINDOW *, int);
2N/Aextern int move(int, int);
2N/Aextern int mvaddch(int, int, chtype);
2N/Aextern int mvaddchnstr(int, int, chtype *, int);
2N/Aextern int mvaddchstr(int, int, chtype *);
2N/Aextern int mvaddnstr(int, int, char *, int);
2N/Aextern int mvaddstr(int, int, char *);
2N/Aextern int mvdelch(int, int);
2N/Aextern int mvgetch(int, int);
2N/Aextern int mvgetstr(int, int, char *);
2N/Aextern int mvhline(int, int, chtype, int);
2N/Aextern int mvinchnstr(int, int, chtype *, int);
2N/Aextern int mvinchstr(int, int, chtype *);
2N/Aextern int mvinnstr(int, int, char *, int);
2N/Aextern int mvinsch(int, int, chtype);
2N/Aextern int mvinsnstr(int, int, char *, int);
2N/Aextern int mvinsstr(int, int, char *);
2N/Aextern int mvinstr(int, int, char *);
2N/Aextern int mvvline(int, int, chtype, int);
2N/Aextern int mvwaddch(WINDOW *, int, int, chtype);
2N/Aextern int mvwaddchnstr(WINDOW *, int, int, chtype *, int);
2N/Aextern int mvwaddchstr(WINDOW *, int, int, chtype *);
2N/Aextern int mvwaddnstr(WINDOW *, int, int, char *, int);
2N/Aextern int mvwaddstr(WINDOW *, int, int, char *);
2N/Aextern int mvwdelch(WINDOW *, int, int);
2N/Aextern int mvwgetch(WINDOW *, int, int);
2N/Aextern int mvwgetstr(WINDOW *, int, int, char *);
2N/Aextern int mvwhline(WINDOW *, int, int, chtype, int);
2N/Aextern int mvwinchnstr(WINDOW *, int, int, chtype *, int);
2N/Aextern int mvwinchstr(WINDOW *, int, int, chtype *);
2N/Aextern int mvwinnstr(WINDOW *, int, int, char *, int);
2N/Aextern int mvwinsch(WINDOW *, int, int, chtype);
2N/Aextern int mvwinsnstr(WINDOW *, int, int, char *, int);
2N/Aextern int mvwinsstr(WINDOW *, int, int, char *);
2N/Aextern int mvwinstr(WINDOW *, int, int, char *);
2N/Aextern int mvwvline(WINDOW *, int, int, chtype, int);
2N/Aextern int nl(void);
2N/Aextern int nocrmode(void);
2N/Aextern int nodelay(WINDOW *, bool);
2N/Aextern int noecho(void);
2N/Aextern int nonl(void);
2N/Aextern int notimeout(WINDOW *, bool);
2N/Aextern int overlay(WINDOW *, WINDOW *);
2N/Aextern int overwrite(WINDOW *, WINDOW *);
2N/Aextern int redrawwin(WINDOW *);
2N/Aextern int refresh(void);
2N/Aextern int resetterm(void);
2N/Aextern int saveterm(void);
2N/Aextern int scr_init(char *);
2N/Aextern int scr_restore(char *);
2N/Aextern int scr_set(char *);
2N/Aextern int scrl(int);
2N/Aextern int scroll(WINDOW *);
2N/Aextern int scrollok(WINDOW *, bool);
2N/Aextern int setscrreg(int, int);
2N/Aextern int setterm(char *);
2N/Aextern int slk_init(int);
2N/Aextern int standend(void);
2N/Aextern int standout(void);
2N/Aextern int syncok(WINDOW *, bool);
2N/Aextern int touchline(WINDOW *, int, int);
2N/Aextern int touchwin(WINDOW *);
2N/Aextern int untouchwin(WINDOW *);
2N/Aextern int vline(chtype, int);
2N/Aextern int waddchstr(WINDOW *, chtype *);
2N/Aextern int waddstr(WINDOW *, char *);
2N/Aextern int wclear(WINDOW *);
2N/Aextern int wdeleteln(WINDOW *);
2N/Aextern int werase(WINDOW *);
2N/Aextern int winchstr(WINDOW *, chtype *);
2N/Aextern int winsertln(WINDOW *);
2N/Aextern int winsstr(WINDOW *, char *);
2N/Aextern int winstr(WINDOW *, char *);
2N/Aextern int wstandend(WINDOW *);
2N/Aextern int wstandout(WINDOW *);
2N/A
2N/Aextern void bkgdset(chtype);
2N/Aextern void idcok(WINDOW *, bool);
2N/Aextern void noqiflush(void);
2N/Aextern void wbkgdset(WINDOW *, chtype);
2N/Aextern void qiflush(void);
2N/Aextern void timeout(int);
2N/Aextern void wtimeout(WINDOW *, int);
2N/Aextern void use_env(int); /* int sb. char */
2N/A
2N/Aextern chtype inwch(void);
2N/Aextern chtype mvinwch(int, int);
2N/Aextern chtype mvwinwch(WINDOW *, int, int);
2N/A
2N/Aextern int addnwstr(wchar_t *, int);
2N/Aextern int addwch(chtype);
2N/Aextern int addwchnstr(chtype *, int);
2N/Aextern int addwchstr(chtype *);
2N/Aextern int addwstr(wchar_t *);
2N/Aextern int echowchar(chtype);
2N/Aextern int getnwstr(wchar_t *, int);
2N/Aextern int getwch(void);
2N/Aextern int getwstr(wchar_t *);
2N/Aextern int innwstr(wchar_t *, int);
2N/Aextern int insnwstr(wchar_t *, int);
2N/Aextern int inswch(chtype);
2N/Aextern int inswstr(wchar_t *);
2N/Aextern int inwchnstr(chtype *, int);
2N/Aextern int inwchstr(chtype *);
2N/Aextern int inwstr(wchar_t *);
2N/Aextern int mvaddnwstr(int, int, wchar_t *, int);
2N/Aextern int mvaddwch(int, int, chtype);
2N/Aextern int mvaddwchnstr(int, int, chtype *, int);
2N/Aextern int mvaddwchstr(int, int, chtype *);
2N/Aextern int mvaddwstr(int, int, wchar_t *);
2N/Aextern int mvgetnwstr(int, int, wchar_t *, int);
2N/Aextern int mvgetwch(int, int);
2N/Aextern int mvgetwstr(int, int, wchar_t *);
2N/Aextern int mvinnwstr(int, int, wchar_t *, int);
2N/Aextern int mvinsnwstr(int, int, wchar_t *, int);
2N/Aextern int mvinswch(int, int, chtype);
2N/Aextern int mvinswstr(int, int, wchar_t *);
2N/Aextern int mvinwchnstr(int, int, chtype *, int);
2N/Aextern int mvinwchstr(int, int, chtype *);
2N/Aextern int mvinwstr(int, int, wchar_t *);
2N/Aextern int mvwaddnwstr(WINDOW *, int, int, wchar_t *, int);
2N/Aextern int mvwaddwch(WINDOW *, int, int, chtype);
2N/Aextern int mvwaddwchnstr(WINDOW *, int, int, chtype *, int);
2N/Aextern int mvwaddwchstr(WINDOW *, int, int, chtype *);
2N/Aextern int mvwaddwstr(WINDOW *, int, int, wchar_t *);
2N/Aextern int mvwgetnwstr(WINDOW *, int, int, wchar_t *, int);
2N/Aextern int mvwgetwch(WINDOW *, int, int);
2N/Aextern int mvwgetwstr(WINDOW *, int, int, wchar_t *);
2N/Aextern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
2N/Aextern int mvwinsnwstr(WINDOW *, int, int, wchar_t *, int);
2N/Aextern int mvwinswch(WINDOW *, int, int, chtype);
2N/Aextern int mvwinswstr(WINDOW *, int, int, wchar_t *);
2N/Aextern int mvwinwchnstr(WINDOW *, int, int, chtype *, int);
2N/Aextern int mvwinwchstr(WINDOW *, int, int, chtype *);
2N/Aextern int mvwinwstr(WINDOW *, int, int, wchar_t *);
2N/Aextern int waddwchstr(WINDOW *, chtype *);
2N/Aextern int waddwstr(WINDOW *, wchar_t *);
2N/Aextern int winswstr(WINDOW *, wchar_t *);
2N/Aextern int winwchstr(WINDOW *, chtype *);
2N/A
2N/A#else /* __STDC__ */
2N/A
2N/Aextern SCREEN *newterm(), /* termname, fout, fin */
2N/Aextern SCREEN *set_term(); /* screenptr */
2N/A
2N/Aextern WINDOW *subpad(),
2N/Aextern WINDOW *subwin();
2N/A
2N/Aextern chtype inch(), winch(), mvinch(), mvwinch();
2N/A
2N/Aextern char *unctrl();
2N/A
2N/Aextern int addch(), addchnstr(), addchstr(), addnstr(), addstr(),
2N/A attroff(), attron(), attrset(), beep(), bkgd(),
2N/A border(), box(), clear(), clearok(), clrtobot(), clrtoeol(),
2N/A crmode(), delch(), deleteln(), echo(), echochar(),
2N/A erase(),
2N/A/* MORE */ fixterm(),
2N/A flash(), garbagedlines(), garbagedwin(),
2N/A getch(), getstr(), gettmode(), halfdelay(), hline(),
2N/A inchnstr(), inchstr(), innstr(), insch(),
2N/A insdelln(), insertln(), insnstr(), insstr(), instr(),
2N/A intrflush(),
2N/A is_linetouched(), is_wintouched(), leaveok(), meta(),
2N/A move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(),
2N/A mvaddstr(), mvdelch(), mvgetch(), mvgetstr(), mvhline(),
2N/A mvinchnstr(), mvinchstr(), mvinnstr(), mvinsch(), mvinsnstr(),
2N/A mvinsstr(), mvinstr(), mvvline(), mvwaddch(), mvwaddchnstr(),
2N/A mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(),
2N/A mvwgetch(), mvwgetstr(), mvwhline(), mvwinchnstr(),
2N/A mvwinchstr(), mvwinnstr(), mvwinsch(), mvwinsnstr(),
2N/A mvwinsstr(), mvwinstr(), mvwvline(),
2N/A nl(), nocrmode(), nodelay(),
2N/A noecho(), nonl(), notimeout(),
2N/A overlay(), overwrite(), redrawwin(), refresh(),
2N/A resetterm(), saveterm(), scr_init(),
2N/A scr_restore(), scr_set(), scrl(),
2N/A scroll(), scrollok(), setscrreg(), setterm(),
2N/A slk_init(), standend(), standout(),
2N/A syncok(), touchline(), touchwin(), untouchwin(), vline(),
2N/A waddchstr(), waddstr(), wclear(),
2N/A wdeleteln(), werase(), winchstr(), winsertln(),
2N/A winsstr(), winstr(), wstandend(), wstandout();
2N/A
2N/Aextern void bkgdset(), wbkgdset(), idcok(), noqiflush(),
2N/A qiflush(), timeout(), wtimeout(), use_env();
2N/A
2N/Aextern unsigned long getmouse(), getbmap();
2N/A
2N/Aextern chtype inwch(), mvinwch(), mvwinwch();
2N/A
2N/Aextern int addnwstr(), addwch(), addwchnstr(), addwchstr(),
2N/A addwstr(), echowchar(), getnwstr(), getwch(),
2N/A getwstr(), innwstr(), insnwstr(), inswch(),
2N/A inswstr(), inwchnstr(), inwchstr(), inwstr(),
2N/A mvaddnwstr(), mvaddwch(), mvaddwchnstr(), mvaddwchstr(),
2N/A mvaddwstr(), mvgetnwstr(), mvgetwch(), mvgetwstr(),
2N/A mvinnwstr(), mvinsnwstr(), mvinswch(), mvinswstr(),
2N/A mvinwchnstr(), mvinwchstr(), mvinwstr(), mvwaddnwstr(),
2N/A mvwaddwch(), mvwaddwchnstr(), mvwaddwchstr(), mvwaddwstr(),
2N/A mvwgetnwstr(), mvwgetwch(), mvwgetwstr(), mvwinnwstr(),
2N/A mvwinsnwstr(), mvwinswch(), mvwinswstr(), mvwinwchnstr(),
2N/A mvwinwchstr(), mvwinwstr(), waddwchstr(), waddwstr(),
2N/A winswstr(), winwchstr();
2N/A
2N/A#endif /* __STDC__ */
2N/A
2N/A#else /* NOMACROS || __lint */
2N/A
2N/A/*
2N/A * The defines from here down to the #endif for NOMACROS
2N/A * define macros, which may be more efficient than their
2N/A * function versions. The functions may be accessed by defining
2N/A * NOMACROS in C code. This is useful for debugging purposes.
2N/A */
2N/A
2N/A#include <unctrl.h>
2N/A
2N/A/* pseudo functions for stdscr */
2N/A#define addch(ch) waddch(stdscr, ch)
2N/A#define addnstr(s, n) waddnstr(stdscr, s, n)
2N/A#define addstr(str) waddstr(stdscr, str)
2N/A#define attroff(at) wattroff(stdscr, at)
2N/A#define attron(at) wattron(stdscr, at)
2N/A#define attrset(at) wattrset(stdscr, at)
2N/A#define bkgd(c) wbkgd(stdscr, c)
2N/A#define border(ls, rs, ts, bs, tl, tr, bl, br) \
2N/A wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
2N/A#define clear() wclear(stdscr)
2N/A#define clrtobot() wclrtobot(stdscr)
2N/A#define clrtoeol() wclrtoeol(stdscr)
2N/A#define delch() wdelch(stdscr)
2N/A#define deleteln() wdeleteln(stdscr)
2N/A#define echochar(ch) wechochar(stdscr, ch)
2N/A#define erase() werase(stdscr)
2N/A#define getch() wgetch(stdscr)
2N/A#define getstr(str) wgetstr(stdscr, str)
2N/A#define inch() winch(stdscr)
2N/A#define insch(c) winsch(stdscr, c)
2N/A#define insdelln(id) winsdelln(stdscr, id)
2N/A#define insertln() winsertln(stdscr)
2N/A#define insnstr(s, n) winsnstr(stdscr, s, n)
2N/A#define insstr(s) winsstr(stdscr, s)
2N/A#define move(y, x) wmove(stdscr, y, x)
2N/A#define refresh() wrefresh(stdscr)
2N/A#define scrl(n) wscrl(stdscr, n)
2N/A#define setscrreg(t, b) wsetscrreg(stdscr, t, b)
2N/A#define standend() wstandend(stdscr)
2N/A#define standout() wstandout(stdscr)
2N/A#define timeout(tm) wtimeout(stdscr, tm)
2N/A#define hline(c, num) whline(stdscr, c, num)
2N/A#define vline(c, num) wvline(stdscr, c, num)
2N/A#define addchstr(str) waddchstr(stdscr, str)
2N/A#define addchnstr(str, n) waddchnstr(stdscr, str, n)
2N/A#define instr(str) winstr(stdscr, (str))
2N/A#define innstr(str, n) winnstr(stdscr, (str), (n))
2N/A#define inchstr(str) winchstr(stdscr, str)
2N/A#define inchnstr(str, n) winchnstr(stdscr, str, n)
2N/A#define bkgdset(c) wbkgdset(stdscr, c)
2N/A
2N/A#define addnwstr(ws, n) waddnwstr(stdscr, ws, n)
2N/A#define addwch(ch) waddwch(stdscr, ch)
2N/A#define addwchnstr(str, n) waddwchnstr(stdscr, str, n)
2N/A#define addwchstr(str) waddwchstr(stdscr, str)
2N/A#define addwstr(ws) waddwstr(stdscr, ws)
2N/A#define echowchar(ch) wechowchar(stdscr, ch)
2N/A#define getnwstr(ws, n) wgetnwstr(stdscr, ws, n)
2N/A#define getwch() wgetwch(stdscr)
2N/A#define getwstr(ws) wgetwstr(stdscr, ws)
2N/A#define innwstr(ws, n) winnwstr(stdscr, ws, n)
2N/A#define insnwstr(ws, n) winsnwstr(stdscr, ws, n)
2N/A#define inswch(c) winswch(stdscr, c)
2N/A#define inswstr(ws) winswstr(stdscr, ws)
2N/A#define inwch() winwch(stdscr)
2N/A#define inwchnstr(str, n) winwchnstr(stdscr, str, n)
2N/A#define inwchstr(str) winwchstr(stdscr, str)
2N/A#define inwstr(ws) winwstr(stdscr, ws)
2N/A
2N/A#define adjcurspos() wadjcurspos(stdscr)
2N/A#define movenextch() wmovenextch(stdscr)
2N/A#define moveprevch() wmoveprevch(stdscr)
2N/A
2N/A/* functions to define environment flags of a window */
2N/A#ifdef CURS_PERFORMANCE
2N/A#define wbkgdset(win, c) \
2N/A (((win)->_attrs = (((win)->_attrs & ~((win)->_bkgd & A_ATTRIBUTES)) | \
2N/A (c & A_ATTRIBUTES))), ((win)->_bkgd = (c)))
2N/A#define syncok(win, bf) ((win)->_parent ? (win)->_sync = (bf) : ERR)
2N/A#define notimeout(win, bf) \
2N/A (((win)->_notimeout = ((bf) ? TRUE : FALSE)), OK)
2N/A#define clearok(win, bf) (((win)->_clear = (bf)), OK)
2N/A#define leaveok(win, bf) (((win)->_leave = (bf)), OK)
2N/A#define scrollok(win, bf) (((win)->_scroll = ((bf) ? TRUE : FALSE)), OK)
2N/A#define idcok(win, bf) ((win)->_use_idc = ((bf) ? TRUE : FALSE))
2N/A#define nodelay(win, bf) (((win)->_delay = (bf) ? 0 : -1), OK)
2N/A#define is_wintouched(win) ((win)->_flags & _WINCHANGED)
2N/A#define is_linetouched(win, line) \
2N/A ((((line) >= (win)->_maxy) || ((line) < 0)) ? ERR : \
2N/A (((win)->_firstch[(line)] == _INFINITY) ? FALSE : TRUE))
2N/A
2N/A#define subwin(win, nl, nc, by, bx) \
2N/A derwin((win), (nl), (nc), (by-win->_begy), (bx-win->_begx))
2N/A#define touchwin(win) wtouchln((win), 0, (win)->_maxy, TRUE)
2N/A#define redrawwin(win) wredrawln((win), 0, (win)->_maxy)
2N/A#define winchstr(win, str) \
2N/A winchnstr((win), str, ((win)->_maxx - (win)->_curx))
2N/A#define winstr(win, str) \
2N/A winnstr((win), str, ((win)->_maxx - (win)->_curx))
2N/A#define untouchwin(win) wtouchln((win), 0, ((win)->_maxy), FALSE)
2N/A#define winch(win) ((win)->_y[(win)->_cury][(win)->_curx])
2N/A
2N/A#define wtimeout(win, tm) ((win)->_delay = (tm))
2N/A#define use_env(bf) (_use_env = (bf))
2N/A
2N/A#else /* CURS_PERFORMANCE */
2N/A
2N/A#ifdef __STDC__
2N/A
2N/Aextern void wbkgdset(WINDOW *, chtype);
2N/Aextern void idcok(WINDOW *, bool);
2N/Aextern void wtimeout(WINDOW *, int);
2N/Aextern void use_env(int); /* int sb. char */
2N/A
2N/Aextern int syncok(WINDOW *, bool);
2N/Aextern int notimeout(WINDOW *, bool);
2N/Aextern int clearok(WINDOW *, bool);
2N/Aextern int leaveok(WINDOW *, bool);
2N/Aextern int scrollok(WINDOW *, bool);
2N/Aextern int nodelay(WINDOW *, bool);
2N/Aextern int is_linetouched(WINDOW *, int);
2N/Aextern int is_wintouched(WINDOW *);
2N/Aextern int touchwin(WINDOW *);
2N/Aextern int redrawwin(WINDOW *);
2N/Aextern int winchstr(WINDOW *, chtype *);
2N/Aextern int winstr(WINDOW *, char *);
2N/Aextern int untouchwin(WINDOW *);
2N/A
2N/Aextern chtype winch(WINDOW *);
2N/A
2N/Aextern WINDOW *subwin(WINDOW *, int, int, int, int);
2N/A
2N/A#else /* __STDC__ */
2N/A
2N/Aextern void wbkgdset(), idcok(), wtimeout(), use_env();
2N/A
2N/Aextern int syncok(), notimeout(), clearok(), leaveok(),
2N/A scrollok(), nodelay(), is_linetouched(), is_wintouched(),
2N/A touchwin(), redrawwin(), winchstr(), winstr(),
2N/A untouchwin();
2N/A
2N/Aextern chtype winch();
2N/A
2N/Aextern WINDOW *subwin();
2N/A
2N/A#endif /* __STDC__ */
2N/A
2N/A#endif /* CURS_PERFORMANCE */
2N/A
2N/A/* functions for move and update */
2N/A#define mvaddch(y, x, ch) \
2N/A mvwaddch(stdscr, y, x, ch)
2N/A#define mvaddnstr(y, x, s, n) \
2N/A mvwaddnstr(stdscr, y, x, s, n)
2N/A#define mvaddstr(y, x, str) \
2N/A mvwaddstr(stdscr, y, x, str)
2N/A#define mvdelch(y, x) \
2N/A mvwdelch(stdscr, y, x)
2N/A#define mvgetch(y, x) \
2N/A mvwgetch(stdscr, y, x)
2N/A#define mvgetstr(y, x, str) \
2N/A mvwgetstr(stdscr, y, x, str)
2N/A#define mvinch(y, x) \
2N/A mvwinch(stdscr, y, x)
2N/A#define mvinsch(y, x, c) \
2N/A mvwinsch(stdscr, y, x, c)
2N/A#define mvinsnstr(y, x, s, n) \
2N/A mvwinsnstr(stdscr, y, x, s, n)
2N/A#define mvinsstr(y, x, s) \
2N/A mvwinsstr(stdscr, y, x, s)
2N/A#define mvaddchstr(y, x, str) \
2N/A mvwaddchstr(stdscr, y, x, str)
2N/A#define mvaddchnstr(y, x, str, n) \
2N/A mvwaddchnstr(stdscr, y, x, str, n)
2N/A#define mvinstr(y, x, str) \
2N/A mvwinstr(stdscr, y, x, (str))
2N/A#define mvinnstr(y, x, str, n) \
2N/A mvwinnstr(stdscr, y, x, (str), (n))
2N/A#define mvinchstr(y, x, str) \
2N/A mvwinchstr(stdscr, y, x, str)
2N/A#define mvinchnstr(y, x, str, n) \
2N/A mvwinchnstr(stdscr, y, x, str, n)
2N/A#define mvhline(y, x, c, num) \
2N/A mvwhline(stdscr, y, x, c, num)
2N/A#define mvvline(y, x, c, num) \
2N/A mvwvline(stdscr, y, x, c, num)
2N/A
2N/A#define mvaddnwstr(y, x, ws, n) \
2N/A mvwaddnwstr(stdscr, y, x, ws, n)
2N/A#define mvaddwch(y, x, ch) \
2N/A mvwaddwch(stdscr, y, x, ch)
2N/A#define mvaddwchnstr(y, x, str, n) \
2N/A mvwaddwchnstr(stdscr, y, x, str, n)
2N/A#define mvaddwchstr(y, x, str) \
2N/A mvwaddwchstr(stdscr, y, x, str)
2N/A#define mvaddwstr(y, x, ws) \
2N/A mvwaddwstr(stdscr, y, x, ws)
2N/A#define mvgetnwstr(y, x, ws, n) \
2N/A mvwgetnwstr(stdscr, y, x, ws, n)
2N/A#define mvgetwch(y, x) \
2N/A mvwgetwch(stdscr, y, x)
2N/A#define mvgetwstr(y, x, ws) \
2N/A mvwgetwstr(stdscr, y, x, ws)
2N/A#define mvinnwstr(y, x, ws, n) \
2N/A mvwinnwstr(stdscr, y, x, ws, n)
2N/A#define mvinsnwstr(y, x, ws, n) \
2N/A mvwinsnwstr(stdscr, y, x, ws, n)
2N/A#define mvinswch(y, x, c) \
2N/A mvwinswch(stdscr, y, x, c)
2N/A#define mvinswstr(y, x, ws) \
2N/A mvwinswstr(stdscr, y, x, ws)
2N/A#define mvinwch(y, x) \
2N/A mvwinwch(stdscr, y, x)
2N/A#define mvinwchnstr(y, x, str, n) \
2N/A mvwinwchnstr(stdscr, y, x, str, n)
2N/A#define mvinwchstr(y, x, str) \
2N/A mvwinwchstr(stdscr, y, x, str)
2N/A#define mvinwstr(y, x, ws) \
2N/A mvwinwstr(stdscr, y, x, ws)
2N/A
2N/A#define mvwaddch(win, y, x, ch) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddch(win, ch))
2N/A#define mvwaddnstr(win, y, x, s, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddnstr(win, s, n))
2N/A#define mvwaddstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddstr(win, str))
2N/A#define mvwdelch(win, y, x) \
2N/A (wmove(win, y, x) == ERR ? ERR : wdelch(win))
2N/A#define mvwgetch(win, y, x) \
2N/A (wmove(win, y, x) == ERR ? ERR : wgetch(win))
2N/A#define mvwgetstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : wgetstr(win, str))
2N/A#define mvwinch(win, y, x) \
2N/A (wmove(win, y, x) == ERR ? (chtype)ERR : winch(win))
2N/A#define mvwinsch(win, y, x, c) \
2N/A (wmove(win, y, x) == ERR ? ERR : winsch(win, c))
2N/A#define mvwinsnstr(win, y, x, s, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winsnstr(win, s, n))
2N/A#define mvwinsstr(win, y, x, s) \
2N/A (wmove(win, y, x) == ERR ? ERR : winsstr(win, s))
2N/A#define mvwhline(win, y, x, c, num) \
2N/A (wmove(win, y, x) == ERR ? ERR : whline(win, c, num))
2N/A#define mvwvline(win, y, x, c, num) \
2N/A (wmove(win, y, x) == ERR ? ERR : wvline(win, c, num))
2N/A#define mvwaddchstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddchstr(win, str))
2N/A#define mvwaddchnstr(win, y, x, str, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddchnstr(win, str, n))
2N/A#define mvwinstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : winstr(win, str))
2N/A#define mvwinnstr(win, y, x, str, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winnstr(win, str, n))
2N/A#define mvwinchstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : winchstr(win, str))
2N/A#define mvwinchnstr(win, y, x, str, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winchnstr(win, str, n))
2N/A#define mvwaddnwstr(win, y, x, ws, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddnwstr(win, ws, n))
2N/A#define mvwaddwch(win, y, x, ch) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddwch(win, ch))
2N/A#define mvwaddwchnstr(win, y, x, str, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddwchnstr(win, str, n))
2N/A#define mvwaddwchstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddwchstr(win, str))
2N/A#define mvwaddwstr(win, y, x, ws) \
2N/A (wmove(win, y, x) == ERR ? ERR : waddwstr(win, ws))
2N/A#define mvwgetnwstr(win, y, x, ws, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : wgetnwstr(win, ws, n))
2N/A#define mvwgetwch(win, y, x) \
2N/A (wmove(win, y, x) == ERR ? ERR : wgetwch(win))
2N/A#define mvwgetwstr(win, y, x, ws) \
2N/A (wmove(win, y, x) == ERR ? ERR : wgetwstr(win, ws))
2N/A#define mvwinnwstr(win, y, x, ws, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winnwstr(win, ws, n))
2N/A#define mvwinsnwstr(win, y, x, ws, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winsnwstr(win, ws, n))
2N/A#define mvwinswch(win, y, x, c) \
2N/A (wmove(win, y, x) == ERR ? ERR : winswch(win, c))
2N/A#define mvwinswstr(win, y, x, ws) \
2N/A (wmove(win, y, x) == ERR ? ERR : winswstr(win, ws))
2N/A#define mvwinwch(win, y, x) \
2N/A (wmove(win, y, x) == ERR ?(chtype) ERR : winwch(win))
2N/A#define mvwinwchnstr(win, y, x, str, n) \
2N/A (wmove(win, y, x) == ERR ? ERR : winwchnstr(win, str, n))
2N/A#define mvwinwchstr(win, y, x, str) \
2N/A (wmove(win, y, x) == ERR ? ERR : winwchstr(win, str))
2N/A#define mvwinwstr(win, y, x, ws) \
2N/A (wmove(win, y, x) == ERR ? ERR : winwstr(win, ws))
2N/A
2N/A#define waddwchstr(win, str) waddwchnstr(win, str, -1)
2N/A#define winwchstr(win, str) winwchnstr(win, str, -1)
2N/A#define waddwstr(win, ws) waddnwstr(win, ws, -1)
2N/A#define winswstr(win, ws) winsnwstr(win, ws, -1)
2N/A
2N/A#ifdef CURS_MACROS
2N/A#define overlay(src, dst) _overlap((src), (dst), TRUE)
2N/A#define overwrite(src, dst) _overlap((src), (dst), FALSE)
2N/A#define wdeleteln(win) winsdelln((win), -1)
2N/A#define winsertln(win) winsdelln((win), 1)
2N/A#define wstandend(win) wattrset((win), A_NORMAL)
2N/A#define wstandout(win) wattron((win), A_STANDOUT)
2N/A#define beep() _ring(TRUE)
2N/A#define flash() _ring(FALSE)
2N/A#define scroll(win) wscrl((win), 1)
2N/A#define slk_init(f) slk_start(((f == 0) ? 3 : 2), NULL)
2N/A#define scr_init(file) _scr_all(file, 0)
2N/A#define scr_restore(file) _scr_all(file, 1)
2N/A#define scr_set(file) _scr_all(file, 2)
2N/A#define subpad(win, nl, nc, by, bx) derwin((win), (nl), (nc), (by), (bx))
2N/A#define box(win, v, h) wborder((win), (v), (v), (h), (h), 0, 0, 0, 0)
2N/A#define newterm(type, fout, fin) newscreen((type), 0, 0, 0, (fout), (fin))
2N/A#define touchline(win, y, n) wtouchln((win), (y), (n), TRUE)
2N/A
2N/A#define waddstr(win, str) waddnstr((win), (str), -1)
2N/A#define werase(win) (wmove((win), 0, 0), wclrtobot(win))
2N/A#define wclear(win) (clearok((win), TRUE), werase(win))
2N/A#define intrflush(win, flag) _setqiflush(flag)
2N/A#define meta(win, flag) _meta(flag)
2N/A
2N/A#define setterm(name) setupterm((name), 1, (char *)NULL)
2N/A#define gettmode() (OK)
2N/A#define halfdelay(tens) ttimeout((tens)*100)
2N/A
2N/A#define echo() _setecho(TRUE)
2N/A#define noecho() _setecho(FALSE)
2N/A#define nl() _setnonl(FALSE)
2N/A#define nonl() _setnonl(TRUE)
2N/A
2N/A#else /* CURS_MACROS */
2N/A
2N/A#ifdef __STDC__
2N/A
2N/Aextern int overlay(WINDOW *, WINDOW *);
2N/Aextern int overwrite(WINDOW *, WINDOW *);
2N/Aextern int wdeleteln(WINDOW *);
2N/Aextern int winsertln(WINDOW *);
2N/Aextern int wstandend(WINDOW *);
2N/Aextern int wstandout(WINDOW *);
2N/Aextern int beep(void);
2N/Aextern int flash(void);
2N/Aextern int scroll(WINDOW *);
2N/Aextern int slk_init(int);
2N/Aextern int scr_init(char *);
2N/Aextern int scr_restore(char *);
2N/Aextern int box(WINDOW *, chtype, chtype);
2N/Aextern int touchline(WINDOW *, int, int);
2N/Aextern int waddstr(WINDOW *, char *);
2N/Aextern int werase(WINDOW *);
2N/Aextern int wclear(WINDOW *);
2N/Aextern int intrflush(WINDOW *, int);
2N/Aextern int meta(WINDOW *, int);
2N/Aextern int setterm(char *);
2N/Aextern int gettmode(void);
2N/Aextern int halfdelay(int);
2N/Aextern int echo(void);
2N/Aextern int noecho(void);
2N/Aextern int nl(void);
2N/Aextern int nonl(void);
2N/A
2N/Aextern WINDOW *subpad(WINDOW *, int, int, int, int);
2N/A
2N/Aextern SCREEN *newterm(char *, FILE *, FILE *);
2N/A
2N/A#else /* __STDC__ */
2N/A
2N/Aextern int overlay(), overwrite(), wdeleteln(), winsertln(),
2N/A wstandend(), wstandout(), beep(), flash(),
2N/A scroll(), slk_init(), scr_init(), scr_restore(),
2N/A box(), touchline(), waddstr(), werase(),
2N/A wclear(), intrflush(), meta(), setterm(), gettmode(),
2N/A halfdelay(), echo(), noecho(), nl(), nonl();
2N/A
2N/Aextern WINDOW *subpad();
2N/A
2N/Aextern SCREEN *newterm();
2N/A
2N/A#endif /* __STDC__ */
2N/A#endif /* CURS_MACROS */
2N/A
2N/A#define garbagedlines wredrawln
2N/A#define garbagedwin redrawwin
2N/A
2N/A#define crmode cbreak
2N/A#define nocrmode nocbreak
2N/A#define saveterm def_prog_mode
2N/A#define fixterm reset_prog_mode
2N/A#define resetterm reset_shell_mode
2N/A
2N/A#define waddchstr(win, str) waddchnstr((win), (str), -1)
2N/A#define winsstr(win, str) winsnstr((win), (str), -1)
2N/A
2N/A/* iocontrol functions */
2N/A#define qiflush() _setqiflush(TRUE)
2N/A#define noqiflush() _setqiflush(FALSE)
2N/A
2N/A#define set_term setcurscreen
2N/A
2N/A#endif /* NOMACROS || __lint */
2N/A
2N/A/*
2N/A * Standard alternate character set. The current ACS world is evolving,
2N/A * so we support only a widely available subset: the line drawing characters
2N/A * from the VT100, plus a few from the Teletype 5410v1. Eventually there
2N/A * may be support of more sophisticated ACS line drawing, such as that
2N/A * in the Teletype 5410, the HP line drawing set, and the like. There may
2N/A * be support for some non line oriented characters as well.
2N/A *
2N/A * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
2N/A * is the right, b is the bottom, and l is the left. t, r, b, and l might
2N/A * be B (blank), S (single), D (double), or T (thick). The subset defined
2N/A * here only uses B and S.
2N/A */
2N/A
2N/A#define ACS_BSSB (acs_map['l'])
2N/A#define ACS_SSBB (acs_map['m'])
2N/A#define ACS_BBSS (acs_map['k'])
2N/A#define ACS_SBBS (acs_map['j'])
2N/A#define ACS_SBSS (acs_map['u'])
2N/A#define ACS_SSSB (acs_map['t'])
2N/A#define ACS_SSBS (acs_map['v'])
2N/A#define ACS_BSSS (acs_map['w'])
2N/A#define ACS_BSBS (acs_map['q'])
2N/A#define ACS_SBSB (acs_map['x'])
2N/A#define ACS_SSSS (acs_map['n'])
2N/A
2N/A/*
2N/A * Human readable names for the most commonly used characters.
2N/A * "Upper", "right", etc. are chosen to be consistent with the vt100 manual.
2N/A */
2N/A
2N/A#define ACS_ULCORNER ACS_BSSB
2N/A#define ACS_LLCORNER ACS_SSBB
2N/A#define ACS_URCORNER ACS_BBSS
2N/A#define ACS_LRCORNER ACS_SBBS
2N/A#define ACS_RTEE ACS_SBSS
2N/A#define ACS_LTEE ACS_SSSB
2N/A#define ACS_BTEE ACS_SSBS
2N/A#define ACS_TTEE ACS_BSSS
2N/A#define ACS_HLINE ACS_BSBS
2N/A#define ACS_VLINE ACS_SBSB
2N/A#define ACS_PLUS ACS_SSSS
2N/A#define ACS_S1 (acs_map['o']) /* scan line 1 */
2N/A#define ACS_S9 (acs_map['s']) /* scan line 9 */
2N/A#define ACS_DIAMOND (acs_map['`']) /* diamond */
2N/A#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */
2N/A#define ACS_DEGREE (acs_map['f']) /* degree symbol */
2N/A#define ACS_PLMINUS (acs_map['g']) /* plus/minus */
2N/A#define ACS_BULLET (acs_map['~']) /* bullet */
2N/A /* Teletype 5410v1 symbols */
2N/A#define ACS_LARROW (acs_map[',']) /* arrow pointing left */
2N/A#define ACS_RARROW (acs_map['+']) /* arrow pointing right */
2N/A#define ACS_DARROW (acs_map['.']) /* arrow pointing down */
2N/A#define ACS_UARROW (acs_map['-']) /* arrow pointing up */
2N/A#define ACS_BOARD (acs_map['h']) /* board of squares */
2N/A#define ACS_LANTERN (acs_map['i']) /* lantern symbol */
2N/A#define ACS_BLOCK (acs_map['0']) /* solid square block */
2N/A
2N/A.
2N/A$a
2N/A
2N/A/*
2N/A * The definition for 'reg' is not standard, and is provided for
2N/A * compatibility reasons. User's are discouraged from using this.
2N/A */
2N/A#define reg register
2N/A
2N/A/* Various video attributes */
2N/A#define A_STANDOUT 000010000000
2N/A#define _STANDOUT A_STANDOUT /* for compatibility with old curses */
2N/A#define A_UNDERLINE 000020000000
2N/A#define A_REVERSE 000040000000
2N/A#define A_BLINK 000100000000
2N/A#define A_DIM 000200000000
2N/A#define A_BOLD 000400000000
2N/A#define A_ALTCHARSET 001000000000
2N/A
2N/A/* The next two are subject to change so don't depend on them */
2N/A#define A_INVIS 010000000000
2N/A#define A_PROTECT 020000000000U
2N/A
2N/A#define A_NORMAL 000000000000
2N/A#define A_ATTRIBUTES 031777700000U /* 0xCFFF8000 */
2N/A#define A_CHARTEXT 006000077777 /* 0x30007FFF */
2N/A#define A_COLOR 000007700000
2N/A
2N/A#define A_WATTRIBUTES 031770000000U /* 0xCFE00000 */
2N/A#define A_WCHARTEXT 006007777777 /* 0x301FFFFF */
2N/A
2N/A#define COLOR_PAIR(n) ((n) << 15)
2N/A#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 15)
2N/A
2N/A/* definition of 8 basic color */
2N/A#define COLOR_BLACK 0
2N/A#define COLOR_RED 1
2N/A#define COLOR_GREEN 2
2N/A#define COLOR_YELLOW 3
2N/A#define COLOR_BLUE 4
2N/A#define COLOR_MAGENTA 5
2N/A#define COLOR_CYAN 6
2N/A#define COLOR_WHITE 7
2N/A
2N/A/* mouse related macros: don't change these definitions or bit-masks. */
2N/A/* they are interdependent (used by _map_button() in tgetch() */
2N/A#define BUTTON_RELEASED 0
2N/A#define BUTTON_PRESSED 1
2N/A#define BUTTON_CLICKED 2
2N/A#define BUTTON_DOUBLE_CLICKED 3
2N/A#define BUTTON_TRIPLE_CLICKED 4
2N/A
2N/A#define MOUSE_X_POS (Mouse_status.x)
2N/A#define MOUSE_Y_POS (Mouse_status.y)
2N/A#define A_BUTTON_CHANGED (Mouse_status.changes & 7)
2N/A#define MOUSE_MOVED (Mouse_status.changes & 8)
2N/A#define MOUSE_POS_REPORT (Mouse_status.changes & 16)
2N/A#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1)))
2N/A#define BUTTON_STATUS(x) (Mouse_status.button[(x)-1])
2N/A
2N/A/* definition of mouse bit-masks */
2N/A#define BUTTON1_RELEASED 000000000001
2N/A#define BUTTON1_PRESSED 000000000002
2N/A#define BUTTON1_CLICKED 000000000004
2N/A#define BUTTON1_DOUBLE_CLICKED 000000000010
2N/A#define BUTTON1_TRIPLE_CLICKED 000000000020
2N/A#define BUTTON2_RELEASED 000000000040
2N/A#define BUTTON2_PRESSED 000000000100
2N/A#define BUTTON2_CLICKED 000000000200
2N/A#define BUTTON2_DOUBLE_CLICKED 000000000400
2N/A#define BUTTON2_TRIPLE_CLICKED 000000001000
2N/A#define BUTTON3_RELEASED 000000002000
2N/A#define BUTTON3_PRESSED 000000004000
2N/A#define BUTTON3_CLICKED 000000010000
2N/A#define BUTTON3_DOUBLE_CLICKED 000000020000
2N/A#define BUTTON3_TRIPLE_CLICKED 000000040000
2N/A#define ALL_MOUSE_EVENTS 000000077777
2N/A#define REPORT_MOUSE_POSITION 000000100000
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _CURSES_H */
2N/A.
2N/A0r copyright.h
2N/Ag/\@(\#)curses\.ed/s//\@(\#)curses\.h/
2N/Aw curses.h