1*0Sstevel@tonic-gatee keycaps 2*0Sstevel@tonic-gateH 3*0Sstevel@tonic-gateg/.*KEY_/s//KEY_/ 4*0Sstevel@tonic-gateg/KEY_F([1-9]/d 5*0Sstevel@tonic-gateg'\(KEY_[^,]*\),[ ]*\([0-9][0-9]*\),[ ]*\(.*\)'s''#define \1 \2 /* \3 */' 6*0Sstevel@tonic-gatew ./tmp/keycaps 7*0Sstevel@tonic-gatee !sort +2n ./tmp/keycaps 8*0Sstevel@tonic-gateg'\(KEY_[^ ] \)'s''\1 ' 9*0Sstevel@tonic-gateg'\(KEY_[^ ][^ ] \)'s''\1 ' 10*0Sstevel@tonic-gateg'\(KEY_[^ ][^ ][^ ] \)'s''\1 ' 11*0Sstevel@tonic-gate1i 12*0Sstevel@tonic-gate/* Funny "characters" enabled for various special function keys for input */ 13*0Sstevel@tonic-gate/* This list is created from caps and curses.ed. Do not edit it! */ 14*0Sstevel@tonic-gate#define KEY_MIN 0401 /* Minimum curses key */ 15*0Sstevel@tonic-gate#define KEY_BREAK 0401 /* break key (unreliable) */ 16*0Sstevel@tonic-gate. 17*0Sstevel@tonic-gate/KEY_F(0)/s//KEY_F0 / 18*0Sstevel@tonic-gatea 19*0Sstevel@tonic-gate#define KEY_F(n) (KEY_F0+(n)) /* Space for 64 function keys */ 20*0Sstevel@tonic-gate /* is reserved. */ 21*0Sstevel@tonic-gate. 22*0Sstevel@tonic-gate/KEY_ENTER/a 23*0Sstevel@tonic-gate#define KEY_SRESET 0530 /* soft (partial) reset (unreliable) */ 24*0Sstevel@tonic-gate#define KEY_RESET 0531 /* reset or hard reset (unreliable) */ 25*0Sstevel@tonic-gate. 26*0Sstevel@tonic-gate/KEY_A1/i 27*0Sstevel@tonic-gate /* The keypad is arranged like this: */ 28*0Sstevel@tonic-gate /* a1 up a3 */ 29*0Sstevel@tonic-gate /* left b2 right */ 30*0Sstevel@tonic-gate /* c1 down c3 */ 31*0Sstevel@tonic-gate. 32*0Sstevel@tonic-gate$a 33*0Sstevel@tonic-gate#define KEY_MAX 0777 /* Maximum curses key */ 34*0Sstevel@tonic-gate. 35*0Sstevel@tonic-gate1i 36*0Sstevel@tonic-gate#ifndef _CURSES_H 37*0Sstevel@tonic-gate#define _CURSES_H 38*0Sstevel@tonic-gate 39*0Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gate/* 42*0Sstevel@tonic-gate * curses.h - this file is automatically made from caps and 43*0Sstevel@tonic-gate * curses.ed. Don't make changes directly to curses.h! 44*0Sstevel@tonic-gate */ 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate#include <widec.h> 47*0Sstevel@tonic-gate 48*0Sstevel@tonic-gate#include <stdio.h> 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gate#ifdef __cplusplus 51*0Sstevel@tonic-gateextern "C" { 52*0Sstevel@tonic-gate#endif 53*0Sstevel@tonic-gate 54*0Sstevel@tonic-gate#define CSMAX 4 55*0Sstevel@tonic-gate 56*0Sstevel@tonic-gate/* 57*0Sstevel@tonic-gate * This trick is used to distinguish between SYSV and V7 systems. 58*0Sstevel@tonic-gate * We assume that L_ctermid is only defined in stdio.h in SYSV 59*0Sstevel@tonic-gate * systems, but not in V7 or Berkeley UNIX. 60*0Sstevel@tonic-gate */ 61*0Sstevel@tonic-gate#ifdef L_ctermid 62*0Sstevel@tonic-gate#ifdef SYSV 63*0Sstevel@tonic-gate#undef SYSV 64*0Sstevel@tonic-gate#endif 65*0Sstevel@tonic-gate#define SYSV 66*0Sstevel@tonic-gate#endif 67*0Sstevel@tonic-gate/* Some V7 systems define L_ctermid - we list those here */ 68*0Sstevel@tonic-gate#ifdef BSD 69*0Sstevel@tonic-gate#undef SYSV 70*0Sstevel@tonic-gate#endif 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate#ifdef SYSV 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate#include <termio.h> 75*0Sstevel@tonic-gatetypedef struct termio SGTTY; 76*0Sstevel@tonic-gatetypedef struct termios SGTTYS; 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate#else /* !SYSV */ 79*0Sstevel@tonic-gate 80*0Sstevel@tonic-gate#ifndef _SGTTYB_ 81*0Sstevel@tonic-gate#include <sgtty.h> 82*0Sstevel@tonic-gate#endif /* _SGTTYB_ */ 83*0Sstevel@tonic-gatetypedef struct sgttyb SGTTY; 84*0Sstevel@tonic-gate 85*0Sstevel@tonic-gate/* 86*0Sstevel@tonic-gate * Here we attempt to improve portability by providing some #defines 87*0Sstevel@tonic-gate * for SYSV functions on non-SYSV systems. 88*0Sstevel@tonic-gate */ 89*0Sstevel@tonic-gate#define memcpy(dst, src, len) bcopy((src), (dst), (len)) 90*0Sstevel@tonic-gate#define strchr index 91*0Sstevel@tonic-gate#define strrchr rindex 92*0Sstevel@tonic-gate#endif /* SYSV */ 93*0Sstevel@tonic-gate 94*0Sstevel@tonic-gate/* 95*0Sstevel@tonic-gate * bool is a built-in type in standard C++ and as such is not 96*0Sstevel@tonic-gate * defined here when using standard C++. However, the GNU compiler 97*0Sstevel@tonic-gate * fixincludes utility nonetheless creates it's own version of this 98*0Sstevel@tonic-gate * header for use by gcc and g++. In that version it adds a redundant 99*0Sstevel@tonic-gate * guard for __cplusplus. To avoid the creation of a gcc/g++ specific 100*0Sstevel@tonic-gate * header we need to include the following magic comment: 101*0Sstevel@tonic-gate * 102*0Sstevel@tonic-gate * we must use the C++ compiler's type 103*0Sstevel@tonic-gate * 104*0Sstevel@tonic-gate * The above comment should not be removed or changed until GNU 105*0Sstevel@tonic-gate * gcc/fixinc/inclhack.def is updated to bypass this header. 106*0Sstevel@tonic-gate */ 107*0Sstevel@tonic-gate#if !defined(__cplusplus) && !defined(_BOOL) 108*0Sstevel@tonic-gatetypedef char bool; 109*0Sstevel@tonic-gate#endif /* !defined(__cplusplus) && !defined(_BOOL) */ 110*0Sstevel@tonic-gate 111*0Sstevel@tonic-gate#define _VR3_COMPAT_CODE 112*0Sstevel@tonic-gate/* 113*0Sstevel@tonic-gate * chtype is the type used to store a character together with attributes. 114*0Sstevel@tonic-gate * It can be set to "char" to save space, or "long" to get more attributes. 115*0Sstevel@tonic-gate */ 116*0Sstevel@tonic-gate#ifdef CHTYPE 117*0Sstevel@tonic-gatetypedef CHTYPE chtype; 118*0Sstevel@tonic-gate#else 119*0Sstevel@tonic-gate#ifdef _LP64 120*0Sstevel@tonic-gatetypedef unsigned int chtype; 121*0Sstevel@tonic-gate#else 122*0Sstevel@tonic-gatetypedef unsigned long chtype; 123*0Sstevel@tonic-gate#endif /* _LP64 */ 124*0Sstevel@tonic-gate#endif /* CHTYPE */ 125*0Sstevel@tonic-gate 126*0Sstevel@tonic-gate/* 127*0Sstevel@tonic-gate * Define for the 'old' definition of chtype is required 128*0Sstevel@tonic-gate * when we are running in compatibility mode 129*0Sstevel@tonic-gate */ 130*0Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE 131*0Sstevel@tonic-gatetypedef unsigned short _ochtype; 132*0Sstevel@tonic-gate#endif 133*0Sstevel@tonic-gate 134*0Sstevel@tonic-gate/* TRUE and FALSE get defined so many times, */ 135*0Sstevel@tonic-gate/* let's not get in the way of other definitions. */ 136*0Sstevel@tonic-gate#if !defined(TRUE) || ((TRUE) != 1) 137*0Sstevel@tonic-gate#define TRUE (1) 138*0Sstevel@tonic-gate#endif 139*0Sstevel@tonic-gate#if !defined(FALSE) || ((FALSE) != 0) 140*0Sstevel@tonic-gate#define FALSE (0) 141*0Sstevel@tonic-gate#endif 142*0Sstevel@tonic-gate#if !defined(ERR) || ((ERR) != -1) 143*0Sstevel@tonic-gate#define ERR (-1) 144*0Sstevel@tonic-gate#endif 145*0Sstevel@tonic-gate#if !defined(OK) || ((OK) != 0) 146*0Sstevel@tonic-gate#define OK (0) 147*0Sstevel@tonic-gate#endif 148*0Sstevel@tonic-gate 149*0Sstevel@tonic-gate/* short-hand notations */ 150*0Sstevel@tonic-gatetypedef struct _win_st WINDOW; 151*0Sstevel@tonic-gatetypedef struct screen SCREEN; 152*0Sstevel@tonic-gatetypedef struct _Mouse MOUSE_STATUS; 153*0Sstevel@tonic-gate 154*0Sstevel@tonic-gatestruct _win_st 155*0Sstevel@tonic-gate{ 156*0Sstevel@tonic-gate short _cury, _curx; /* current coordinates */ 157*0Sstevel@tonic-gate short _maxy, _maxx; /* max coordinates */ 158*0Sstevel@tonic-gate short _begy, _begx; /* (0,0) screen coordinates */ 159*0Sstevel@tonic-gate char _flags; 160*0Sstevel@tonic-gate short _yoffset; /* actual begy is _begy+_yoffset */ 161*0Sstevel@tonic-gate bool _clear, /* clearok() info */ 162*0Sstevel@tonic-gate _leave, /* leaveok() info */ 163*0Sstevel@tonic-gate _immed, /* window in immediate mode */ 164*0Sstevel@tonic-gate _sync; /* auto syncup of parent */ 165*0Sstevel@tonic-gate WINDOW *_padwin; /* "pad" area for current window */ 166*0Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE 167*0Sstevel@tonic-gate _ochtype **_y16; /* MUST stay at this offset in WINDOW */ 168*0Sstevel@tonic-gate#endif 169*0Sstevel@tonic-gate short *_firstch; /* first change in line */ 170*0Sstevel@tonic-gate short *_lastch; /* last change in line */ 171*0Sstevel@tonic-gate short _tmarg, _bmarg; /* scrolling region bounds */ 172*0Sstevel@tonic-gate /* MUST stay at this offset in WINDOW */ 173*0Sstevel@tonic-gate unsigned _scroll : 1; /* scrollok() info */ 174*0Sstevel@tonic-gate unsigned _use_idl : 1; 175*0Sstevel@tonic-gate unsigned _use_keypad : 1; 176*0Sstevel@tonic-gate unsigned _notimeout : 1; 177*0Sstevel@tonic-gate unsigned _use_idc : 1; 178*0Sstevel@tonic-gate chtype _attrs; /* current window attributes */ 179*0Sstevel@tonic-gate chtype _bkgd; /* background, normally blank */ 180*0Sstevel@tonic-gate int _delay; /* delay period on wgetch */ 181*0Sstevel@tonic-gate /* 0: for nodelay */ 182*0Sstevel@tonic-gate /* <0: for infinite delay */ 183*0Sstevel@tonic-gate /* >0: delay time in millisec */ 184*0Sstevel@tonic-gate short _ndescs; /* number of descendants */ 185*0Sstevel@tonic-gate short _parx, _pary; /* coords relative to parent (0,0) */ 186*0Sstevel@tonic-gate WINDOW *_parent; /* the parent if this is a subwin */ 187*0Sstevel@tonic-gate chtype **_y; /* lines of data */ 188*0Sstevel@tonic-gate short _nbyte; /* number of bytes to come */ 189*0Sstevel@tonic-gate short _index; /* index to hold coming char */ 190*0Sstevel@tonic-gate char _waitc[CSMAX]; /* array to hold partial m-width char */ 191*0Sstevel@tonic-gate bool _insmode; /* TRUE for inserting, */ 192*0Sstevel@tonic-gate /* FALSE for adding */ 193*0Sstevel@tonic-gate}; 194*0Sstevel@tonic-gate 195*0Sstevel@tonic-gate/* _lastch is initially set to this, _firstch is set to win->_maxx */ 196*0Sstevel@tonic-gate#define _NOCHANGE -1 197*0Sstevel@tonic-gate#define _INFINITY 16000 /* no line can be longer than this */ 198*0Sstevel@tonic-gate 199*0Sstevel@tonic-gate/* values for win->_flags */ 200*0Sstevel@tonic-gate#define _ISPAD 001 201*0Sstevel@tonic-gate#define _WINCHANGED 002 202*0Sstevel@tonic-gate#define _WINMOVED 004 203*0Sstevel@tonic-gate#define _WINSDEL 010 204*0Sstevel@tonic-gate#define _CANT_BE_IMMED 020 205*0Sstevel@tonic-gate#define _WIN_ADD_ONE 040 206*0Sstevel@tonic-gate#define _WIN_INS_ONE 100 207*0Sstevel@tonic-gate 208*0Sstevel@tonic-gatestruct _Mouse { 209*0Sstevel@tonic-gate int x, y; 210*0Sstevel@tonic-gate short button[3]; 211*0Sstevel@tonic-gate int changes; 212*0Sstevel@tonic-gate}; 213*0Sstevel@tonic-gate 214*0Sstevel@tonic-gate#define CURS_STUPID 0 215*0Sstevel@tonic-gate#define CURS_UNKNOWN 1 216*0Sstevel@tonic-gate#define CURS_BAD_MALLOC 2 217*0Sstevel@tonic-gate 218*0Sstevel@tonic-gate/* 219*0Sstevel@tonic-gate * Various tricks to shut up lint about things that are perfectly fine. 220*0Sstevel@tonic-gate */ 221*0Sstevel@tonic-gate#if defined(__lint) && !defined(CURSES) /* if not internal to curses source */ 222*0Sstevel@tonic-gatestruct screen { 223*0Sstevel@tonic-gate int _nobody_; 224*0Sstevel@tonic-gate}; 225*0Sstevel@tonic-gate#endif /* __lint */ 226*0Sstevel@tonic-gate 227*0Sstevel@tonic-gate/* common external variables */ 228*0Sstevel@tonic-gate 229*0Sstevel@tonic-gateextern int LINES, COLS, TABSIZE, COLORS, COLOR_PAIRS; 230*0Sstevel@tonic-gate 231*0Sstevel@tonic-gateextern short curs_errno; 232*0Sstevel@tonic-gate 233*0Sstevel@tonic-gateextern WINDOW *stdscr, *curscr; 234*0Sstevel@tonic-gate 235*0Sstevel@tonic-gateextern MOUSE_STATUS Mouse_status; 236*0Sstevel@tonic-gate 237*0Sstevel@tonic-gateextern char ttytype[]; 238*0Sstevel@tonic-gate 239*0Sstevel@tonic-gateextern char curs_parm_err[], 240*0Sstevel@tonic-gate *curs_err_strings[]; 241*0Sstevel@tonic-gate 242*0Sstevel@tonic-gate/* Function declarations */ 243*0Sstevel@tonic-gate 244*0Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE 245*0Sstevel@tonic-gate 246*0Sstevel@tonic-gateextern _ochtype *acs_map; 247*0Sstevel@tonic-gateextern chtype *acs32map; 248*0Sstevel@tonic-gate 249*0Sstevel@tonic-gate/* definitions for Vr3 source compatibility */ 250*0Sstevel@tonic-gate 251*0Sstevel@tonic-gate#define initscr initscr32 252*0Sstevel@tonic-gate#define newterm newterm32 253*0Sstevel@tonic-gate#define waddch w32addch 254*0Sstevel@tonic-gate#define wechochar w32echochar 255*0Sstevel@tonic-gate#define pechochar p32echochar 256*0Sstevel@tonic-gate#define winsch w32insch 257*0Sstevel@tonic-gate#define vidputs vid32puts 258*0Sstevel@tonic-gate#define vidattr vid32attr 259*0Sstevel@tonic-gate#define wattroff w32attroff 260*0Sstevel@tonic-gate#define wattron w32attron 261*0Sstevel@tonic-gate#define wattrset w32attrset 262*0Sstevel@tonic-gate#define acs_map acs32map 263*0Sstevel@tonic-gate#define box box32 264*0Sstevel@tonic-gate 265*0Sstevel@tonic-gate#ifdef __STDC__ 266*0Sstevel@tonic-gateextern WINDOW *initscr(void); 267*0Sstevel@tonic-gateextern SCREEN *newterm(char *, FILE *, FILE *); 268*0Sstevel@tonic-gate#else 269*0Sstevel@tonic-gateextern WINDOW *initscr(); 270*0Sstevel@tonic-gateextern SCREEN *newterm(); 271*0Sstevel@tonic-gate#endif 272*0Sstevel@tonic-gate 273*0Sstevel@tonic-gate/* declarations for mini-curses */ 274*0Sstevel@tonic-gate 275*0Sstevel@tonic-gate#ifdef __STDC__ 276*0Sstevel@tonic-gateextern WINDOW *m_initscr(void); 277*0Sstevel@tonic-gate 278*0Sstevel@tonic-gateextern SCREEN *m_newterm(char *, FILE *, FILE *); 279*0Sstevel@tonic-gate 280*0Sstevel@tonic-gateextern int m_addch(int), m_addstr(char *), m_clear(void), m_erase(void), 281*0Sstevel@tonic-gate m_move(int, int), m_refresh(void); 282*0Sstevel@tonic-gate 283*0Sstevel@tonic-gate#else /* __STDC__ */ 284*0Sstevel@tonic-gateextern WINDOW *m_initscr(); 285*0Sstevel@tonic-gate 286*0Sstevel@tonic-gateextern SCREEN *m_newterm(); 287*0Sstevel@tonic-gate 288*0Sstevel@tonic-gateextern int m_addch(), m_addstr(), m_clear(), m_erase(), 289*0Sstevel@tonic-gate m_move(), m_refresh(); 290*0Sstevel@tonic-gate 291*0Sstevel@tonic-gate#endif /* __STDC__ */ 292*0Sstevel@tonic-gate 293*0Sstevel@tonic-gate#else /* _VR3_COMPAT_CODE */ 294*0Sstevel@tonic-gate 295*0Sstevel@tonic-gateextern chtype *acs_map; 296*0Sstevel@tonic-gate 297*0Sstevel@tonic-gate#endif /* _VR3_COMPAT_CODE */ 298*0Sstevel@tonic-gate 299*0Sstevel@tonic-gate#ifdef __STDC__ 300*0Sstevel@tonic-gate 301*0Sstevel@tonic-gateextern SCREEN *newscreen(char *, int, int, int, FILE *, FILE *); 302*0Sstevel@tonic-gateextern SCREEN *setcurscreen(SCREEN *); 303*0Sstevel@tonic-gate 304*0Sstevel@tonic-gateextern WINDOW *initscr(void); 305*0Sstevel@tonic-gateextern WINDOW *newwin(int, int, int, int); 306*0Sstevel@tonic-gateextern WINDOW *newpad(int, int); 307*0Sstevel@tonic-gateextern WINDOW *derwin(WINDOW *, int, int, int, int); 308*0Sstevel@tonic-gateextern WINDOW *dupwin(WINDOW *); 309*0Sstevel@tonic-gateextern WINDOW *getwin(FILE *); 310*0Sstevel@tonic-gate 311*0Sstevel@tonic-gateextern int wgetch(WINDOW *); /* it can return KEY_*, for instance. */ 312*0Sstevel@tonic-gate 313*0Sstevel@tonic-gateextern char *longname(void); /* long name of terminal */ 314*0Sstevel@tonic-gateextern char *termname(void); /* effective terminal name */ 315*0Sstevel@tonic-gateextern char *keyname(int); /* name of token returned by wgetch() */ 316*0Sstevel@tonic-gateextern char *slk_label(int); 317*0Sstevel@tonic-gateextern char erasechar(void); 318*0Sstevel@tonic-gateextern char killchar(void); 319*0Sstevel@tonic-gateextern char *unctrl(int); 320*0Sstevel@tonic-gate 321*0Sstevel@tonic-gateextern chtype termattrs(void); 322*0Sstevel@tonic-gate 323*0Sstevel@tonic-gateextern void vidupdate(chtype, chtype, int (*)(char)); 324*0Sstevel@tonic-gateextern void wsyncup(WINDOW *); 325*0Sstevel@tonic-gateextern void wsyncdown(WINDOW *); 326*0Sstevel@tonic-gateextern void delscreen(SCREEN *); 327*0Sstevel@tonic-gateextern void curserr(void); 328*0Sstevel@tonic-gateextern void _setqiflush(int); 329*0Sstevel@tonic-gateextern void wcursyncup(WINDOW *); 330*0Sstevel@tonic-gate 331*0Sstevel@tonic-gateextern int cbreak(void); 332*0Sstevel@tonic-gateextern int nocbreak(void); 333*0Sstevel@tonic-gateextern int reset_prog_mode(void); 334*0Sstevel@tonic-gateextern int reset_shell_mode(void); 335*0Sstevel@tonic-gateextern int def_prog_mode(void); 336*0Sstevel@tonic-gateextern int _setecho(int); 337*0Sstevel@tonic-gateextern int _setnonl(int); 338*0Sstevel@tonic-gateextern int def_shell_mode(void); 339*0Sstevel@tonic-gateextern int raw(void); 340*0Sstevel@tonic-gateextern int savetty(void); 341*0Sstevel@tonic-gateextern int traceon(void); 342*0Sstevel@tonic-gateextern int _meta(int); 343*0Sstevel@tonic-gateextern int traceoff(void); 344*0Sstevel@tonic-gateextern int noraw(void); 345*0Sstevel@tonic-gateextern int flushinp(void); 346*0Sstevel@tonic-gateextern int _getsyx(int *, int *); 347*0Sstevel@tonic-gateextern int _ring(bool); 348*0Sstevel@tonic-gateextern int resetty(void); 349*0Sstevel@tonic-gateextern int ripoffline(int, int (*)(WINDOW *, int)); 350*0Sstevel@tonic-gateextern int setsyx(int, int); 351*0Sstevel@tonic-gateextern int slk_refresh(void); 352*0Sstevel@tonic-gateextern int slk_restore(void); 353*0Sstevel@tonic-gateextern int wstandend(WINDOW *); 354*0Sstevel@tonic-gateextern int wstandout(WINDOW *); 355*0Sstevel@tonic-gateextern int wattroff(WINDOW *, chtype); 356*0Sstevel@tonic-gateextern int wattron(WINDOW *, chtype); 357*0Sstevel@tonic-gateextern int wattrset(WINDOW *, chtype); 358*0Sstevel@tonic-gateextern int wrefresh(WINDOW *); 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gateextern int copywin(WINDOW *, WINDOW *, int, int, int, int, int, int, int); 361*0Sstevel@tonic-gateextern int curs_set(int); 362*0Sstevel@tonic-gateextern int delay_output(int); 363*0Sstevel@tonic-gateextern int delwin(WINDOW *); 364*0Sstevel@tonic-gateextern int doupdate(void); 365*0Sstevel@tonic-gateextern int drainio(int); 366*0Sstevel@tonic-gateextern int endwin(void); 367*0Sstevel@tonic-gateextern int isendwin(void); 368*0Sstevel@tonic-gateextern int baudrate(void); 369*0Sstevel@tonic-gateextern int has_ic(void); 370*0Sstevel@tonic-gateextern int has_il(void); 371*0Sstevel@tonic-gateextern int keypad(WINDOW *, bool); 372*0Sstevel@tonic-gateextern int mvcur(int, int, int, int); 373*0Sstevel@tonic-gate 374*0Sstevel@tonic-gateextern int mvprintw(int, int, ...); 375*0Sstevel@tonic-gateextern int mvscanw(int, int, ...); 376*0Sstevel@tonic-gateextern int mvwprintw(WINDOW *, int, int, ...); 377*0Sstevel@tonic-gateextern int mvwscanw(WINDOW *, int, int, ...); 378*0Sstevel@tonic-gateextern int printw(char *, ...); 379*0Sstevel@tonic-gateextern int scanw(char *, ...); 380*0Sstevel@tonic-gateextern int wprintw(WINDOW *, ...); 381*0Sstevel@tonic-gateextern int wscanw(WINDOW *, ...); 382*0Sstevel@tonic-gate 383*0Sstevel@tonic-gate /* __va_list is the ANSI-C safe definition of the */ 384*0Sstevel@tonic-gate /* va_list type as allowed to be defined in stdlib.h. */ 385*0Sstevel@tonic-gate /* <stdio.h> provides the nested include of <va_list.h> */ 386*0Sstevel@tonic-gate /* which provides this namespace safe definition. */ 387*0Sstevel@tonic-gate /* Either <stdarg.h> or <varargs.h> must be included to */ 388*0Sstevel@tonic-gate /* use these interfaces. */ 389*0Sstevel@tonic-gate 390*0Sstevel@tonic-gateextern int vwprintw(WINDOW *, char *, __va_list); 391*0Sstevel@tonic-gateextern int vwscanw(WINDOW *, char *, __va_list); 392*0Sstevel@tonic-gate 393*0Sstevel@tonic-gateextern int mvwin(WINDOW *, int, int); 394*0Sstevel@tonic-gateextern int mvderwin(WINDOW *, int, int); 395*0Sstevel@tonic-gateextern int napms(int); 396*0Sstevel@tonic-gateextern int newkey(char *, short, bool); 397*0Sstevel@tonic-gateextern int filter(void); 398*0Sstevel@tonic-gateextern int pechochar(WINDOW *, chtype); 399*0Sstevel@tonic-gateextern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 400*0Sstevel@tonic-gateextern int prefresh(WINDOW *, int, int, int, int, int, int); 401*0Sstevel@tonic-gate 402*0Sstevel@tonic-gateextern int putwin(WINDOW *, FILE *); 403*0Sstevel@tonic-gateextern int wredrawln(WINDOW *, int, int); 404*0Sstevel@tonic-gateextern int scr_dump(char *); 405*0Sstevel@tonic-gateextern int setupterm(char *, int, int *); 406*0Sstevel@tonic-gate 407*0Sstevel@tonic-gateextern int slk_attron(chtype); 408*0Sstevel@tonic-gateextern int slk_attroff(chtype); 409*0Sstevel@tonic-gateextern int slk_attrset(chtype); 410*0Sstevel@tonic-gateextern int slk_clear(void); 411*0Sstevel@tonic-gateextern int slk_noutrefresh(void); 412*0Sstevel@tonic-gateextern int slk_set(int, char *, int); 413*0Sstevel@tonic-gateextern int slk_start(int, int *); 414*0Sstevel@tonic-gateextern int slk_touch(void); 415*0Sstevel@tonic-gateextern int start_color(void); 416*0Sstevel@tonic-gateextern int typeahead(int); 417*0Sstevel@tonic-gate 418*0Sstevel@tonic-gateextern bool can_change_color(void); 419*0Sstevel@tonic-gateextern bool has_colors(void); 420*0Sstevel@tonic-gate 421*0Sstevel@tonic-gateextern int waddch(WINDOW *, chtype); 422*0Sstevel@tonic-gateextern int waddchnstr(WINDOW *, chtype *, int); 423*0Sstevel@tonic-gateextern int waddnstr(WINDOW *, char *, int); 424*0Sstevel@tonic-gateextern int wbkgd(WINDOW *, chtype); 425*0Sstevel@tonic-gateextern int wborder(WINDOW *, chtype, chtype, chtype, chtype, 426*0Sstevel@tonic-gate chtype, chtype, chtype, chtype); 427*0Sstevel@tonic-gateextern int wclrtobot(WINDOW *); 428*0Sstevel@tonic-gateextern int wclrtoeol(WINDOW *); 429*0Sstevel@tonic-gateextern int wdelch(WINDOW *); 430*0Sstevel@tonic-gateextern int wechochar(WINDOW *, chtype); 431*0Sstevel@tonic-gateextern int wgetstr(WINDOW *, char *); 432*0Sstevel@tonic-gateextern int wgetnstr(WINDOW *, char *, int); 433*0Sstevel@tonic-gateextern int whline(WINDOW *, chtype, int); 434*0Sstevel@tonic-gateextern int wvline(WINDOW *, chtype, int); 435*0Sstevel@tonic-gateextern int winchnstr(WINDOW *, chtype *, int); 436*0Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *); 437*0Sstevel@tonic-gateextern int winnstr(WINDOW *, char *, int); 438*0Sstevel@tonic-gateextern int winsch(WINDOW *, chtype); 439*0Sstevel@tonic-gateextern int winsdelln(WINDOW *, int); /* internal */ 440*0Sstevel@tonic-gateextern int winsnstr(WINDOW *, char *, int); 441*0Sstevel@tonic-gateextern int winstr(WINDOW *, char *); 442*0Sstevel@tonic-gateextern int wmove(WINDOW *, int, int); 443*0Sstevel@tonic-gateextern int wnoutrefresh(WINDOW *); 444*0Sstevel@tonic-gateextern int wredrawln(WINDOW *, int, int); 445*0Sstevel@tonic-gateextern int wscrl(WINDOW *, int); 446*0Sstevel@tonic-gateextern int wsetscrreg(WINDOW *, int, int); 447*0Sstevel@tonic-gateextern int wtouchln(WINDOW *, int, int, int); 448*0Sstevel@tonic-gate 449*0Sstevel@tonic-gateextern int crmode(void); 450*0Sstevel@tonic-gateextern int nocrmode(void); 451*0Sstevel@tonic-gateextern int ungetch(int); 452*0Sstevel@tonic-gate 453*0Sstevel@tonic-gateextern int mouse_set(long int); 454*0Sstevel@tonic-gateextern int mouse_on(long int); 455*0Sstevel@tonic-gateextern int mouse_off(long int); 456*0Sstevel@tonic-gateextern int request_mouse_pos(void); 457*0Sstevel@tonic-gateextern int map_button(unsigned long); 458*0Sstevel@tonic-gate 459*0Sstevel@tonic-gateextern void wmouse_position(WINDOW *, int *, int *); 460*0Sstevel@tonic-gate 461*0Sstevel@tonic-gateextern unsigned long getmouse(void), getbmap(void); 462*0Sstevel@tonic-gate 463*0Sstevel@tonic-gate /* the following declarations take integers as arguments */ 464*0Sstevel@tonic-gate /* to keep the CI5 compiler happy. what we really want */ 465*0Sstevel@tonic-gate /* to pass is given in comments. (by the way, we don't */ 466*0Sstevel@tonic-gate /* save anything by passing short or bool, since compiler */ 467*0Sstevel@tonic-gate /* expands them to integers any way */ 468*0Sstevel@tonic-gate 469*0Sstevel@tonic-gateextern int pair_content(short, short *, short *); 470*0Sstevel@tonic-gateextern int color_content(short, short *, short *, short *); /* as above */ 471*0Sstevel@tonic-gateextern int init_color(short, short, short, short); 472*0Sstevel@tonic-gateextern int init_pair(short, short, short); 473*0Sstevel@tonic-gateextern int idlok(WINDOW *, bool); 474*0Sstevel@tonic-gate 475*0Sstevel@tonic-gateextern void immedok(WINDOW *, bool); 476*0Sstevel@tonic-gate 477*0Sstevel@tonic-gateextern chtype winwch(WINDOW *); 478*0Sstevel@tonic-gate 479*0Sstevel@tonic-gateextern int pechowchar(WINDOW *, chtype); 480*0Sstevel@tonic-gateextern int ungetwch(const wchar_t); 481*0Sstevel@tonic-gateextern int waddnwstr(WINDOW *, wchar_t *, int); 482*0Sstevel@tonic-gateextern int waddwch(WINDOW *, chtype); 483*0Sstevel@tonic-gateextern int waddwchnstr(WINDOW *, chtype *, int); 484*0Sstevel@tonic-gateextern int wechowchar(WINDOW *, chtype); 485*0Sstevel@tonic-gateextern int wgetnwstr(WINDOW *, wchar_t *, int); 486*0Sstevel@tonic-gateextern int wgetwch(WINDOW *); 487*0Sstevel@tonic-gateextern int wgetwstr(WINDOW *, wchar_t *); 488*0Sstevel@tonic-gateextern int winnwstr(WINDOW *, wchar_t *, int); 489*0Sstevel@tonic-gateextern int winsnwstr(WINDOW *, wchar_t *, int); 490*0Sstevel@tonic-gateextern int winswch(WINDOW *, chtype); 491*0Sstevel@tonic-gateextern int winwchnstr(WINDOW *, chtype *, int); 492*0Sstevel@tonic-gateextern int winwstr(WINDOW *, wchar_t *); 493*0Sstevel@tonic-gate 494*0Sstevel@tonic-gate#else /* __STDC__ */ 495*0Sstevel@tonic-gate 496*0Sstevel@tonic-gateextern SCREEN *newscreen(), /* termname, lines, cols, tabsiz, fout, fin */ 497*0Sstevel@tonic-gate *setcurscreen(); /* screenptr */ 498*0Sstevel@tonic-gate 499*0Sstevel@tonic-gateextern WINDOW *initscr(), 500*0Sstevel@tonic-gate *newwin(), /* nlines, ncols, begy, begx */ 501*0Sstevel@tonic-gate *newpad(), /* nlines, ncols */ 502*0Sstevel@tonic-gate *derwin(), /* orig, nlines, ncols, begy, begx */ 503*0Sstevel@tonic-gate *dupwin(), /* orig */ 504*0Sstevel@tonic-gate *getwin(); /* file */ 505*0Sstevel@tonic-gate 506*0Sstevel@tonic-gateextern int wgetch(); /* because it can return KEY_*, for instance. */ 507*0Sstevel@tonic-gate 508*0Sstevel@tonic-gateextern char *longname(), /* long name of terminal */ 509*0Sstevel@tonic-gate *termname(), /* effective terminal name */ 510*0Sstevel@tonic-gate *keyname(), /* (int) name of token returned by wgetch() */ 511*0Sstevel@tonic-gate *slk_label(), /* index */ 512*0Sstevel@tonic-gate erasechar(), 513*0Sstevel@tonic-gate killchar(), 514*0Sstevel@tonic-gate *unctrl(); 515*0Sstevel@tonic-gate 516*0Sstevel@tonic-gateextern chtype termattrs(); 517*0Sstevel@tonic-gate 518*0Sstevel@tonic-gateextern void vidupdate(), wsyncup(), wsyncdown(), 519*0Sstevel@tonic-gate delkeymap(), 520*0Sstevel@tonic-gate delscreen(), curserr(), 521*0Sstevel@tonic-gate _setqiflush(), 522*0Sstevel@tonic-gate immedok(), 523*0Sstevel@tonic-gate wcursyncup(); 524*0Sstevel@tonic-gate 525*0Sstevel@tonic-gateextern int cbreak(), nocbreak(), 526*0Sstevel@tonic-gate reset_prog_mode(), reset_shell_mode(), def_prog_mode(), 527*0Sstevel@tonic-gate _setecho(), _setnonl(), 528*0Sstevel@tonic-gate def_shell_mode(), raw(), 529*0Sstevel@tonic-gate savetty(), traceon(), _meta(), 530*0Sstevel@tonic-gate traceoff(), noraw(), flushinp(), _getsyx(), 531*0Sstevel@tonic-gate _ring(), resetty(), ripoffline(), setsyx(), slk_refresh(), 532*0Sstevel@tonic-gate slk_restore(), wstandend(), wstandout(), 533*0Sstevel@tonic-gate wattroff(), wattron(), wattrset(), wrefresh(); 534*0Sstevel@tonic-gate 535*0Sstevel@tonic-gateextern int color_cont(), copywin(), curs_set(), delay_output(), delwin(), 536*0Sstevel@tonic-gate doupdate(), drainio(), endwin(), isendwin(), 537*0Sstevel@tonic-gate baudrate(), has_ic(), has_il(), idlok(), 538*0Sstevel@tonic-gate init_color(), init_pair(), keypad(), mvcur(); 539*0Sstevel@tonic-gate 540*0Sstevel@tonic-gateextern int mvprintw(), mvscanw(), mvwprintw(), mvwscanw(), 541*0Sstevel@tonic-gate printw(), scanw(), wprintw(), wscanw(), vwprintw(), vwscanw(); 542*0Sstevel@tonic-gate 543*0Sstevel@tonic-gateextern int mvwin(), mvderwin(), napms(), newkey(), filter(), 544*0Sstevel@tonic-gate pair_content(), pechochar(), pnoutrefresh(), prefresh(); 545*0Sstevel@tonic-gate 546*0Sstevel@tonic-gateextern int putwin(), wredrawln(), scr_dump(), setupterm(); 547*0Sstevel@tonic-gate 548*0Sstevel@tonic-gateextern int slk_attrof(), slk_attrof(), slk_attrset(), 549*0Sstevel@tonic-gate slk_clear(), slk_noutrefresh(), slk_set(), 550*0Sstevel@tonic-gate slk_start(), slk_touch(), start_color(), 551*0Sstevel@tonic-gate typeahead(); 552*0Sstevel@tonic-gate 553*0Sstevel@tonic-gateextern bool can_change_color(), has_colors(); 554*0Sstevel@tonic-gate 555*0Sstevel@tonic-gateextern int waddch(), waddchnstr(), waddnstr(), wbkgd(), 556*0Sstevel@tonic-gate wborder(), wclrtobot(), wclrtoeol(), wdelch(), wechochar(), 557*0Sstevel@tonic-gate wgetstr(), wgetnstr(), whline(), wvline(), winchnstr(), 558*0Sstevel@tonic-gate winchstr(), winnstr(), winsch(), 559*0Sstevel@tonic-gate winsdelln(), /* internal */ 560*0Sstevel@tonic-gate winsnstr(), winstr(), wmove(), wnoutrefresh(), wredrawln(), 561*0Sstevel@tonic-gate wscrl(), wsetscrreg(), wtouchln(); 562*0Sstevel@tonic-gate 563*0Sstevel@tonic-gateextern int crmode(), nocrmode(), ungetch(); 564*0Sstevel@tonic-gate 565*0Sstevel@tonic-gateextern int mouse_set(), mouse_on(), mouse_off(), 566*0Sstevel@tonic-gate request_mouse_pos(), map_button(); 567*0Sstevel@tonic-gate 568*0Sstevel@tonic-gateextern void wmouse_position(); 569*0Sstevel@tonic-gate 570*0Sstevel@tonic-gateextern unsigned long getmouse(), getbmap(); 571*0Sstevel@tonic-gate 572*0Sstevel@tonic-gateextern chtype winwch(); 573*0Sstevel@tonic-gate 574*0Sstevel@tonic-gateextern int pechowchar(), ungetwch(), waddnwstr(), waddwch(), 575*0Sstevel@tonic-gate waddwchnstr(), wechowchar(), wgetnwstr(), wgetwch(), 576*0Sstevel@tonic-gate wgetwstr(), winnwstr(), winsnwstr(), winswch(), 577*0Sstevel@tonic-gate winwchnstr(), winwstr(); 578*0Sstevel@tonic-gate 579*0Sstevel@tonic-gate#endif /* __STDC__ */ 580*0Sstevel@tonic-gate 581*0Sstevel@tonic-gate#define getsyx(y, x) _getsyx(&(y), &(x)) 582*0Sstevel@tonic-gate 583*0Sstevel@tonic-gate/* 584*0Sstevel@tonic-gate * Functions to get at the window structure. 585*0Sstevel@tonic-gate */ 586*0Sstevel@tonic-gate 587*0Sstevel@tonic-gate#define getyx(win, y, x) ((y) = getcury(win), (x) = getcurx(win)) 588*0Sstevel@tonic-gate#define getbegyx(win, y, x) ((y) = getbegy(win), (x) = getbegx(win)) 589*0Sstevel@tonic-gate#define getmaxyx(win, y, x) ((y) = getmaxy(win), (x) = getmaxx(win)) 590*0Sstevel@tonic-gate#define getparyx(win, y, x) ((y) = getpary(win), (x) = getparx(win)) 591*0Sstevel@tonic-gate 592*0Sstevel@tonic-gate#if defined(CURS_PERFORMANCE) && !defined(__lint) 593*0Sstevel@tonic-gate#define getcury(win) ((win)->_cury) 594*0Sstevel@tonic-gate#define getcurx(win) ((win)->_curx) 595*0Sstevel@tonic-gate#define getbegy(win) ((win)->_begy) 596*0Sstevel@tonic-gate#define getbegx(win) ((win)->_begx) 597*0Sstevel@tonic-gate#define getmaxy(win) ((win)->_maxy) 598*0Sstevel@tonic-gate#define getmaxx(win) ((win)->_maxx) 599*0Sstevel@tonic-gate#define getpary(win) ((win)->_pary) 600*0Sstevel@tonic-gate#define getparx(win) ((win)->_parx) 601*0Sstevel@tonic-gate#define getbkgd(win) ((win)->_bkgd) 602*0Sstevel@tonic-gate#define getattrs(win) ((win)->_attrs) 603*0Sstevel@tonic-gate#else /* defined(CURS_PERFORMANCE) && !defined(__lint) */ 604*0Sstevel@tonic-gate 605*0Sstevel@tonic-gate#ifdef __STDC__ 606*0Sstevel@tonic-gateextern int getcury(WINDOW *); 607*0Sstevel@tonic-gateextern int getcurx(WINDOW *); 608*0Sstevel@tonic-gateextern int getbegy(WINDOW *); 609*0Sstevel@tonic-gateextern int getbegx(WINDOW *); 610*0Sstevel@tonic-gateextern int getmaxy(WINDOW *); 611*0Sstevel@tonic-gateextern int getmaxx(WINDOW *); 612*0Sstevel@tonic-gateextern int getpary(WINDOW *); 613*0Sstevel@tonic-gateextern int getparx(WINDOW *); 614*0Sstevel@tonic-gate 615*0Sstevel@tonic-gateextern chtype getbkgd(WINDOW *); 616*0Sstevel@tonic-gateextern chtype getattrs(WINDOW *); 617*0Sstevel@tonic-gate 618*0Sstevel@tonic-gate#else /* __STDC__ */ 619*0Sstevel@tonic-gateextern int getcury(), getcurx(), getbegy(), getbegx(), 620*0Sstevel@tonic-gate getmaxy(), getmaxx(), getpary(), getparx(); 621*0Sstevel@tonic-gate 622*0Sstevel@tonic-gateextern chtype getbkgd(), getattrs(); 623*0Sstevel@tonic-gate 624*0Sstevel@tonic-gate#endif /* __STDC__ */ 625*0Sstevel@tonic-gate#endif /* defined(CURS_PERFORMANCE) && !defined(__lint) */ 626*0Sstevel@tonic-gate 627*0Sstevel@tonic-gate#if defined(NOMACROS) || defined(__lint) 628*0Sstevel@tonic-gate 629*0Sstevel@tonic-gate#ifdef __STDC__ 630*0Sstevel@tonic-gate 631*0Sstevel@tonic-gateextern SCREEN *newterm(char *, FILE *, FILE *); 632*0Sstevel@tonic-gateextern SCREEN *set_term(SCREEN *); 633*0Sstevel@tonic-gate 634*0Sstevel@tonic-gateextern WINDOW *subpad(WINDOW *, int, int, int, int); 635*0Sstevel@tonic-gateextern WINDOW *subwin(WINDOW *, int, int, int, int); 636*0Sstevel@tonic-gate 637*0Sstevel@tonic-gateextern char *unctrl(int); 638*0Sstevel@tonic-gate 639*0Sstevel@tonic-gateextern chtype inch(void); 640*0Sstevel@tonic-gateextern chtype winch(WINDOW *); 641*0Sstevel@tonic-gateextern chtype mvinch(int, int); 642*0Sstevel@tonic-gateextern chtype mvwinch(WINDOW *, int, int); 643*0Sstevel@tonic-gate 644*0Sstevel@tonic-gateextern int addch(chtype); 645*0Sstevel@tonic-gateextern int addchnstr(chtype *, int); 646*0Sstevel@tonic-gateextern int addchstr(chtype *); 647*0Sstevel@tonic-gateextern int addnstr(char *, int); 648*0Sstevel@tonic-gateextern int addstr(char *); 649*0Sstevel@tonic-gateextern int attroff(chtype); 650*0Sstevel@tonic-gateextern int attron(chtype); 651*0Sstevel@tonic-gateextern int attrset(chtype); 652*0Sstevel@tonic-gateextern int beep(void); 653*0Sstevel@tonic-gateextern int bkgd(chtype); 654*0Sstevel@tonic-gateextern int border(chtype, chtype, chtype, chtype, 655*0Sstevel@tonic-gate chtype, chtype, chtype, chtype); 656*0Sstevel@tonic-gateextern int box(WINDOW *, chtype, chtype); 657*0Sstevel@tonic-gateextern int clear(void); 658*0Sstevel@tonic-gateextern int clearok(WINDOW *, bool); 659*0Sstevel@tonic-gateextern int clrtobot(void); 660*0Sstevel@tonic-gateextern int clrtoeol(void); 661*0Sstevel@tonic-gateextern int crmode(void); 662*0Sstevel@tonic-gateextern int delch(void); 663*0Sstevel@tonic-gateextern int deleteln(void); 664*0Sstevel@tonic-gateextern int echo(void); 665*0Sstevel@tonic-gateextern int echochar(chtype); 666*0Sstevel@tonic-gateextern int erase(void); 667*0Sstevel@tonic-gateextern int fixterm(void); 668*0Sstevel@tonic-gateextern int flash(void); 669*0Sstevel@tonic-gateextern int garbagedlines(WINDOW *, int, int); 670*0Sstevel@tonic-gateextern int garbagedwin(WINDOW *); 671*0Sstevel@tonic-gateextern int getch(void); 672*0Sstevel@tonic-gateextern int getstr(char *); 673*0Sstevel@tonic-gateextern int gettmode(void); 674*0Sstevel@tonic-gateextern int halfdelay(int); 675*0Sstevel@tonic-gateextern int hline(chtype, int); 676*0Sstevel@tonic-gateextern int inchnstr(chtype *, int); 677*0Sstevel@tonic-gateextern int inchstr(chtype *); 678*0Sstevel@tonic-gateextern int innstr(char *, int); 679*0Sstevel@tonic-gateextern int insch(chtype); 680*0Sstevel@tonic-gateextern int insdelln(int); 681*0Sstevel@tonic-gateextern int insertln(void); 682*0Sstevel@tonic-gateextern int insnstr(char *, int); 683*0Sstevel@tonic-gateextern int insstr(char *); 684*0Sstevel@tonic-gateextern int instr(char *); 685*0Sstevel@tonic-gateextern int intrflush(WINDOW *, int); 686*0Sstevel@tonic-gateextern int is_linetouched(WINDOW *, int); 687*0Sstevel@tonic-gateextern int is_wintouched(WINDOW *); 688*0Sstevel@tonic-gateextern int leaveok(WINDOW *, bool); 689*0Sstevel@tonic-gateextern int meta(WINDOW *, int); 690*0Sstevel@tonic-gateextern int move(int, int); 691*0Sstevel@tonic-gateextern int mvaddch(int, int, chtype); 692*0Sstevel@tonic-gateextern int mvaddchnstr(int, int, chtype *, int); 693*0Sstevel@tonic-gateextern int mvaddchstr(int, int, chtype *); 694*0Sstevel@tonic-gateextern int mvaddnstr(int, int, char *, int); 695*0Sstevel@tonic-gateextern int mvaddstr(int, int, char *); 696*0Sstevel@tonic-gateextern int mvdelch(int, int); 697*0Sstevel@tonic-gateextern int mvgetch(int, int); 698*0Sstevel@tonic-gateextern int mvgetstr(int, int, char *); 699*0Sstevel@tonic-gateextern int mvhline(int, int, chtype, int); 700*0Sstevel@tonic-gateextern int mvinchnstr(int, int, chtype *, int); 701*0Sstevel@tonic-gateextern int mvinchstr(int, int, chtype *); 702*0Sstevel@tonic-gateextern int mvinnstr(int, int, char *, int); 703*0Sstevel@tonic-gateextern int mvinsch(int, int, chtype); 704*0Sstevel@tonic-gateextern int mvinsnstr(int, int, char *, int); 705*0Sstevel@tonic-gateextern int mvinsstr(int, int, char *); 706*0Sstevel@tonic-gateextern int mvinstr(int, int, char *); 707*0Sstevel@tonic-gateextern int mvvline(int, int, chtype, int); 708*0Sstevel@tonic-gateextern int mvwaddch(WINDOW *, int, int, chtype); 709*0Sstevel@tonic-gateextern int mvwaddchnstr(WINDOW *, int, int, chtype *, int); 710*0Sstevel@tonic-gateextern int mvwaddchstr(WINDOW *, int, int, chtype *); 711*0Sstevel@tonic-gateextern int mvwaddnstr(WINDOW *, int, int, char *, int); 712*0Sstevel@tonic-gateextern int mvwaddstr(WINDOW *, int, int, char *); 713*0Sstevel@tonic-gateextern int mvwdelch(WINDOW *, int, int); 714*0Sstevel@tonic-gateextern int mvwgetch(WINDOW *, int, int); 715*0Sstevel@tonic-gateextern int mvwgetstr(WINDOW *, int, int, char *); 716*0Sstevel@tonic-gateextern int mvwhline(WINDOW *, int, int, chtype, int); 717*0Sstevel@tonic-gateextern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 718*0Sstevel@tonic-gateextern int mvwinchstr(WINDOW *, int, int, chtype *); 719*0Sstevel@tonic-gateextern int mvwinnstr(WINDOW *, int, int, char *, int); 720*0Sstevel@tonic-gateextern int mvwinsch(WINDOW *, int, int, chtype); 721*0Sstevel@tonic-gateextern int mvwinsnstr(WINDOW *, int, int, char *, int); 722*0Sstevel@tonic-gateextern int mvwinsstr(WINDOW *, int, int, char *); 723*0Sstevel@tonic-gateextern int mvwinstr(WINDOW *, int, int, char *); 724*0Sstevel@tonic-gateextern int mvwvline(WINDOW *, int, int, chtype, int); 725*0Sstevel@tonic-gateextern int nl(void); 726*0Sstevel@tonic-gateextern int nocrmode(void); 727*0Sstevel@tonic-gateextern int nodelay(WINDOW *, bool); 728*0Sstevel@tonic-gateextern int noecho(void); 729*0Sstevel@tonic-gateextern int nonl(void); 730*0Sstevel@tonic-gateextern int notimeout(WINDOW *, bool); 731*0Sstevel@tonic-gateextern int overlay(WINDOW *, WINDOW *); 732*0Sstevel@tonic-gateextern int overwrite(WINDOW *, WINDOW *); 733*0Sstevel@tonic-gateextern int redrawwin(WINDOW *); 734*0Sstevel@tonic-gateextern int refresh(void); 735*0Sstevel@tonic-gateextern int resetterm(void); 736*0Sstevel@tonic-gateextern int saveterm(void); 737*0Sstevel@tonic-gateextern int scr_init(char *); 738*0Sstevel@tonic-gateextern int scr_restore(char *); 739*0Sstevel@tonic-gateextern int scr_set(char *); 740*0Sstevel@tonic-gateextern int scrl(int); 741*0Sstevel@tonic-gateextern int scroll(WINDOW *); 742*0Sstevel@tonic-gateextern int scrollok(WINDOW *, bool); 743*0Sstevel@tonic-gateextern int setscrreg(int, int); 744*0Sstevel@tonic-gateextern int setterm(char *); 745*0Sstevel@tonic-gateextern int slk_init(int); 746*0Sstevel@tonic-gateextern int standend(void); 747*0Sstevel@tonic-gateextern int standout(void); 748*0Sstevel@tonic-gateextern int syncok(WINDOW *, bool); 749*0Sstevel@tonic-gateextern int touchline(WINDOW *, int, int); 750*0Sstevel@tonic-gateextern int touchwin(WINDOW *); 751*0Sstevel@tonic-gateextern int untouchwin(WINDOW *); 752*0Sstevel@tonic-gateextern int vline(chtype, int); 753*0Sstevel@tonic-gateextern int waddchstr(WINDOW *, chtype *); 754*0Sstevel@tonic-gateextern int waddstr(WINDOW *, char *); 755*0Sstevel@tonic-gateextern int wclear(WINDOW *); 756*0Sstevel@tonic-gateextern int wdeleteln(WINDOW *); 757*0Sstevel@tonic-gateextern int werase(WINDOW *); 758*0Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *); 759*0Sstevel@tonic-gateextern int winsertln(WINDOW *); 760*0Sstevel@tonic-gateextern int winsstr(WINDOW *, char *); 761*0Sstevel@tonic-gateextern int winstr(WINDOW *, char *); 762*0Sstevel@tonic-gateextern int wstandend(WINDOW *); 763*0Sstevel@tonic-gateextern int wstandout(WINDOW *); 764*0Sstevel@tonic-gate 765*0Sstevel@tonic-gateextern void bkgdset(chtype); 766*0Sstevel@tonic-gateextern void idcok(WINDOW *, bool); 767*0Sstevel@tonic-gateextern void noqiflush(void); 768*0Sstevel@tonic-gateextern void wbkgdset(WINDOW *, chtype); 769*0Sstevel@tonic-gateextern void qiflush(void); 770*0Sstevel@tonic-gateextern void timeout(int); 771*0Sstevel@tonic-gateextern void wtimeout(WINDOW *, int); 772*0Sstevel@tonic-gateextern void use_env(int); /* int sb. char */ 773*0Sstevel@tonic-gate 774*0Sstevel@tonic-gateextern chtype inwch(void); 775*0Sstevel@tonic-gateextern chtype mvinwch(int, int); 776*0Sstevel@tonic-gateextern chtype mvwinwch(WINDOW *, int, int); 777*0Sstevel@tonic-gate 778*0Sstevel@tonic-gateextern int addnwstr(wchar_t *, int); 779*0Sstevel@tonic-gateextern int addwch(chtype); 780*0Sstevel@tonic-gateextern int addwchnstr(chtype *, int); 781*0Sstevel@tonic-gateextern int addwchstr(chtype *); 782*0Sstevel@tonic-gateextern int addwstr(wchar_t *); 783*0Sstevel@tonic-gateextern int echowchar(chtype); 784*0Sstevel@tonic-gateextern int getnwstr(wchar_t *, int); 785*0Sstevel@tonic-gateextern int getwch(void); 786*0Sstevel@tonic-gateextern int getwstr(wchar_t *); 787*0Sstevel@tonic-gateextern int innwstr(wchar_t *, int); 788*0Sstevel@tonic-gateextern int insnwstr(wchar_t *, int); 789*0Sstevel@tonic-gateextern int inswch(chtype); 790*0Sstevel@tonic-gateextern int inswstr(wchar_t *); 791*0Sstevel@tonic-gateextern int inwchnstr(chtype *, int); 792*0Sstevel@tonic-gateextern int inwchstr(chtype *); 793*0Sstevel@tonic-gateextern int inwstr(wchar_t *); 794*0Sstevel@tonic-gateextern int mvaddnwstr(int, int, wchar_t *, int); 795*0Sstevel@tonic-gateextern int mvaddwch(int, int, chtype); 796*0Sstevel@tonic-gateextern int mvaddwchnstr(int, int, chtype *, int); 797*0Sstevel@tonic-gateextern int mvaddwchstr(int, int, chtype *); 798*0Sstevel@tonic-gateextern int mvaddwstr(int, int, wchar_t *); 799*0Sstevel@tonic-gateextern int mvgetnwstr(int, int, wchar_t *, int); 800*0Sstevel@tonic-gateextern int mvgetwch(int, int); 801*0Sstevel@tonic-gateextern int mvgetwstr(int, int, wchar_t *); 802*0Sstevel@tonic-gateextern int mvinnwstr(int, int, wchar_t *, int); 803*0Sstevel@tonic-gateextern int mvinsnwstr(int, int, wchar_t *, int); 804*0Sstevel@tonic-gateextern int mvinswch(int, int, chtype); 805*0Sstevel@tonic-gateextern int mvinswstr(int, int, wchar_t *); 806*0Sstevel@tonic-gateextern int mvinwchnstr(int, int, chtype *, int); 807*0Sstevel@tonic-gateextern int mvinwchstr(int, int, chtype *); 808*0Sstevel@tonic-gateextern int mvinwstr(int, int, wchar_t *); 809*0Sstevel@tonic-gateextern int mvwaddnwstr(WINDOW *, int, int, wchar_t *, int); 810*0Sstevel@tonic-gateextern int mvwaddwch(WINDOW *, int, int, chtype); 811*0Sstevel@tonic-gateextern int mvwaddwchnstr(WINDOW *, int, int, chtype *, int); 812*0Sstevel@tonic-gateextern int mvwaddwchstr(WINDOW *, int, int, chtype *); 813*0Sstevel@tonic-gateextern int mvwaddwstr(WINDOW *, int, int, wchar_t *); 814*0Sstevel@tonic-gateextern int mvwgetnwstr(WINDOW *, int, int, wchar_t *, int); 815*0Sstevel@tonic-gateextern int mvwgetwch(WINDOW *, int, int); 816*0Sstevel@tonic-gateextern int mvwgetwstr(WINDOW *, int, int, wchar_t *); 817*0Sstevel@tonic-gateextern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int); 818*0Sstevel@tonic-gateextern int mvwinsnwstr(WINDOW *, int, int, wchar_t *, int); 819*0Sstevel@tonic-gateextern int mvwinswch(WINDOW *, int, int, chtype); 820*0Sstevel@tonic-gateextern int mvwinswstr(WINDOW *, int, int, wchar_t *); 821*0Sstevel@tonic-gateextern int mvwinwchnstr(WINDOW *, int, int, chtype *, int); 822*0Sstevel@tonic-gateextern int mvwinwchstr(WINDOW *, int, int, chtype *); 823*0Sstevel@tonic-gateextern int mvwinwstr(WINDOW *, int, int, wchar_t *); 824*0Sstevel@tonic-gateextern int waddwchstr(WINDOW *, chtype *); 825*0Sstevel@tonic-gateextern int waddwstr(WINDOW *, wchar_t *); 826*0Sstevel@tonic-gateextern int winswstr(WINDOW *, wchar_t *); 827*0Sstevel@tonic-gateextern int winwchstr(WINDOW *, chtype *); 828*0Sstevel@tonic-gate 829*0Sstevel@tonic-gate#else /* __STDC__ */ 830*0Sstevel@tonic-gate 831*0Sstevel@tonic-gateextern SCREEN *newterm(), /* termname, fout, fin */ 832*0Sstevel@tonic-gateextern SCREEN *set_term(); /* screenptr */ 833*0Sstevel@tonic-gate 834*0Sstevel@tonic-gateextern WINDOW *subpad(), 835*0Sstevel@tonic-gateextern WINDOW *subwin(); 836*0Sstevel@tonic-gate 837*0Sstevel@tonic-gateextern chtype inch(), winch(), mvinch(), mvwinch(); 838*0Sstevel@tonic-gate 839*0Sstevel@tonic-gateextern char *unctrl(); 840*0Sstevel@tonic-gate 841*0Sstevel@tonic-gateextern int addch(), addchnstr(), addchstr(), addnstr(), addstr(), 842*0Sstevel@tonic-gate attroff(), attron(), attrset(), beep(), bkgd(), 843*0Sstevel@tonic-gate border(), box(), clear(), clearok(), clrtobot(), clrtoeol(), 844*0Sstevel@tonic-gate crmode(), delch(), deleteln(), echo(), echochar(), 845*0Sstevel@tonic-gate erase(), 846*0Sstevel@tonic-gate/* MORE */ fixterm(), 847*0Sstevel@tonic-gate flash(), garbagedlines(), garbagedwin(), 848*0Sstevel@tonic-gate getch(), getstr(), gettmode(), halfdelay(), hline(), 849*0Sstevel@tonic-gate inchnstr(), inchstr(), innstr(), insch(), 850*0Sstevel@tonic-gate insdelln(), insertln(), insnstr(), insstr(), instr(), 851*0Sstevel@tonic-gate intrflush(), 852*0Sstevel@tonic-gate is_linetouched(), is_wintouched(), leaveok(), meta(), 853*0Sstevel@tonic-gate move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(), 854*0Sstevel@tonic-gate mvaddstr(), mvdelch(), mvgetch(), mvgetstr(), mvhline(), 855*0Sstevel@tonic-gate mvinchnstr(), mvinchstr(), mvinnstr(), mvinsch(), mvinsnstr(), 856*0Sstevel@tonic-gate mvinsstr(), mvinstr(), mvvline(), mvwaddch(), mvwaddchnstr(), 857*0Sstevel@tonic-gate mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(), 858*0Sstevel@tonic-gate mvwgetch(), mvwgetstr(), mvwhline(), mvwinchnstr(), 859*0Sstevel@tonic-gate mvwinchstr(), mvwinnstr(), mvwinsch(), mvwinsnstr(), 860*0Sstevel@tonic-gate mvwinsstr(), mvwinstr(), mvwvline(), 861*0Sstevel@tonic-gate nl(), nocrmode(), nodelay(), 862*0Sstevel@tonic-gate noecho(), nonl(), notimeout(), 863*0Sstevel@tonic-gate overlay(), overwrite(), redrawwin(), refresh(), 864*0Sstevel@tonic-gate resetterm(), saveterm(), scr_init(), 865*0Sstevel@tonic-gate scr_restore(), scr_set(), scrl(), 866*0Sstevel@tonic-gate scroll(), scrollok(), setscrreg(), setterm(), 867*0Sstevel@tonic-gate slk_init(), standend(), standout(), 868*0Sstevel@tonic-gate syncok(), touchline(), touchwin(), untouchwin(), vline(), 869*0Sstevel@tonic-gate waddchstr(), waddstr(), wclear(), 870*0Sstevel@tonic-gate wdeleteln(), werase(), winchstr(), winsertln(), 871*0Sstevel@tonic-gate winsstr(), winstr(), wstandend(), wstandout(); 872*0Sstevel@tonic-gate 873*0Sstevel@tonic-gateextern void bkgdset(), wbkgdset(), idcok(), noqiflush(), 874*0Sstevel@tonic-gate qiflush(), timeout(), wtimeout(), use_env(); 875*0Sstevel@tonic-gate 876*0Sstevel@tonic-gateextern unsigned long getmouse(), getbmap(); 877*0Sstevel@tonic-gate 878*0Sstevel@tonic-gateextern chtype inwch(), mvinwch(), mvwinwch(); 879*0Sstevel@tonic-gate 880*0Sstevel@tonic-gateextern int addnwstr(), addwch(), addwchnstr(), addwchstr(), 881*0Sstevel@tonic-gate addwstr(), echowchar(), getnwstr(), getwch(), 882*0Sstevel@tonic-gate getwstr(), innwstr(), insnwstr(), inswch(), 883*0Sstevel@tonic-gate inswstr(), inwchnstr(), inwchstr(), inwstr(), 884*0Sstevel@tonic-gate mvaddnwstr(), mvaddwch(), mvaddwchnstr(), mvaddwchstr(), 885*0Sstevel@tonic-gate mvaddwstr(), mvgetnwstr(), mvgetwch(), mvgetwstr(), 886*0Sstevel@tonic-gate mvinnwstr(), mvinsnwstr(), mvinswch(), mvinswstr(), 887*0Sstevel@tonic-gate mvinwchnstr(), mvinwchstr(), mvinwstr(), mvwaddnwstr(), 888*0Sstevel@tonic-gate mvwaddwch(), mvwaddwchnstr(), mvwaddwchstr(), mvwaddwstr(), 889*0Sstevel@tonic-gate mvwgetnwstr(), mvwgetwch(), mvwgetwstr(), mvwinnwstr(), 890*0Sstevel@tonic-gate mvwinsnwstr(), mvwinswch(), mvwinswstr(), mvwinwchnstr(), 891*0Sstevel@tonic-gate mvwinwchstr(), mvwinwstr(), waddwchstr(), waddwstr(), 892*0Sstevel@tonic-gate winswstr(), winwchstr(); 893*0Sstevel@tonic-gate 894*0Sstevel@tonic-gate#endif /* __STDC__ */ 895*0Sstevel@tonic-gate 896*0Sstevel@tonic-gate#else /* NOMACROS || __lint */ 897*0Sstevel@tonic-gate 898*0Sstevel@tonic-gate/* 899*0Sstevel@tonic-gate * The defines from here down to the #endif for NOMACROS 900*0Sstevel@tonic-gate * define macros, which may be more efficient than their 901*0Sstevel@tonic-gate * function versions. The functions may be accessed by defining 902*0Sstevel@tonic-gate * NOMACROS in C code. This is useful for debugging purposes. 903*0Sstevel@tonic-gate */ 904*0Sstevel@tonic-gate 905*0Sstevel@tonic-gate#include <unctrl.h> 906*0Sstevel@tonic-gate 907*0Sstevel@tonic-gate/* pseudo functions for stdscr */ 908*0Sstevel@tonic-gate#define addch(ch) waddch(stdscr, ch) 909*0Sstevel@tonic-gate#define addnstr(s, n) waddnstr(stdscr, s, n) 910*0Sstevel@tonic-gate#define addstr(str) waddstr(stdscr, str) 911*0Sstevel@tonic-gate#define attroff(at) wattroff(stdscr, at) 912*0Sstevel@tonic-gate#define attron(at) wattron(stdscr, at) 913*0Sstevel@tonic-gate#define attrset(at) wattrset(stdscr, at) 914*0Sstevel@tonic-gate#define bkgd(c) wbkgd(stdscr, c) 915*0Sstevel@tonic-gate#define border(ls, rs, ts, bs, tl, tr, bl, br) \ 916*0Sstevel@tonic-gate wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) 917*0Sstevel@tonic-gate#define clear() wclear(stdscr) 918*0Sstevel@tonic-gate#define clrtobot() wclrtobot(stdscr) 919*0Sstevel@tonic-gate#define clrtoeol() wclrtoeol(stdscr) 920*0Sstevel@tonic-gate#define delch() wdelch(stdscr) 921*0Sstevel@tonic-gate#define deleteln() wdeleteln(stdscr) 922*0Sstevel@tonic-gate#define echochar(ch) wechochar(stdscr, ch) 923*0Sstevel@tonic-gate#define erase() werase(stdscr) 924*0Sstevel@tonic-gate#define getch() wgetch(stdscr) 925*0Sstevel@tonic-gate#define getstr(str) wgetstr(stdscr, str) 926*0Sstevel@tonic-gate#define inch() winch(stdscr) 927*0Sstevel@tonic-gate#define insch(c) winsch(stdscr, c) 928*0Sstevel@tonic-gate#define insdelln(id) winsdelln(stdscr, id) 929*0Sstevel@tonic-gate#define insertln() winsertln(stdscr) 930*0Sstevel@tonic-gate#define insnstr(s, n) winsnstr(stdscr, s, n) 931*0Sstevel@tonic-gate#define insstr(s) winsstr(stdscr, s) 932*0Sstevel@tonic-gate#define move(y, x) wmove(stdscr, y, x) 933*0Sstevel@tonic-gate#define refresh() wrefresh(stdscr) 934*0Sstevel@tonic-gate#define scrl(n) wscrl(stdscr, n) 935*0Sstevel@tonic-gate#define setscrreg(t, b) wsetscrreg(stdscr, t, b) 936*0Sstevel@tonic-gate#define standend() wstandend(stdscr) 937*0Sstevel@tonic-gate#define standout() wstandout(stdscr) 938*0Sstevel@tonic-gate#define timeout(tm) wtimeout(stdscr, tm) 939*0Sstevel@tonic-gate#define hline(c, num) whline(stdscr, c, num) 940*0Sstevel@tonic-gate#define vline(c, num) wvline(stdscr, c, num) 941*0Sstevel@tonic-gate#define addchstr(str) waddchstr(stdscr, str) 942*0Sstevel@tonic-gate#define addchnstr(str, n) waddchnstr(stdscr, str, n) 943*0Sstevel@tonic-gate#define instr(str) winstr(stdscr, (str)) 944*0Sstevel@tonic-gate#define innstr(str, n) winnstr(stdscr, (str), (n)) 945*0Sstevel@tonic-gate#define inchstr(str) winchstr(stdscr, str) 946*0Sstevel@tonic-gate#define inchnstr(str, n) winchnstr(stdscr, str, n) 947*0Sstevel@tonic-gate#define bkgdset(c) wbkgdset(stdscr, c) 948*0Sstevel@tonic-gate 949*0Sstevel@tonic-gate#define addnwstr(ws, n) waddnwstr(stdscr, ws, n) 950*0Sstevel@tonic-gate#define addwch(ch) waddwch(stdscr, ch) 951*0Sstevel@tonic-gate#define addwchnstr(str, n) waddwchnstr(stdscr, str, n) 952*0Sstevel@tonic-gate#define addwchstr(str) waddwchstr(stdscr, str) 953*0Sstevel@tonic-gate#define addwstr(ws) waddwstr(stdscr, ws) 954*0Sstevel@tonic-gate#define echowchar(ch) wechowchar(stdscr, ch) 955*0Sstevel@tonic-gate#define getnwstr(ws, n) wgetnwstr(stdscr, ws, n) 956*0Sstevel@tonic-gate#define getwch() wgetwch(stdscr) 957*0Sstevel@tonic-gate#define getwstr(ws) wgetwstr(stdscr, ws) 958*0Sstevel@tonic-gate#define innwstr(ws, n) winnwstr(stdscr, ws, n) 959*0Sstevel@tonic-gate#define insnwstr(ws, n) winsnwstr(stdscr, ws, n) 960*0Sstevel@tonic-gate#define inswch(c) winswch(stdscr, c) 961*0Sstevel@tonic-gate#define inswstr(ws) winswstr(stdscr, ws) 962*0Sstevel@tonic-gate#define inwch() winwch(stdscr) 963*0Sstevel@tonic-gate#define inwchnstr(str, n) winwchnstr(stdscr, str, n) 964*0Sstevel@tonic-gate#define inwchstr(str) winwchstr(stdscr, str) 965*0Sstevel@tonic-gate#define inwstr(ws) winwstr(stdscr, ws) 966*0Sstevel@tonic-gate 967*0Sstevel@tonic-gate#define adjcurspos() wadjcurspos(stdscr) 968*0Sstevel@tonic-gate#define movenextch() wmovenextch(stdscr) 969*0Sstevel@tonic-gate#define moveprevch() wmoveprevch(stdscr) 970*0Sstevel@tonic-gate 971*0Sstevel@tonic-gate/* functions to define environment flags of a window */ 972*0Sstevel@tonic-gate#ifdef CURS_PERFORMANCE 973*0Sstevel@tonic-gate#define wbkgdset(win, c) \ 974*0Sstevel@tonic-gate (((win)->_attrs = (((win)->_attrs & ~((win)->_bkgd & A_ATTRIBUTES)) | \ 975*0Sstevel@tonic-gate (c & A_ATTRIBUTES))), ((win)->_bkgd = (c))) 976*0Sstevel@tonic-gate#define syncok(win, bf) ((win)->_parent ? (win)->_sync = (bf) : ERR) 977*0Sstevel@tonic-gate#define notimeout(win, bf) \ 978*0Sstevel@tonic-gate (((win)->_notimeout = ((bf) ? TRUE : FALSE)), OK) 979*0Sstevel@tonic-gate#define clearok(win, bf) (((win)->_clear = (bf)), OK) 980*0Sstevel@tonic-gate#define leaveok(win, bf) (((win)->_leave = (bf)), OK) 981*0Sstevel@tonic-gate#define scrollok(win, bf) (((win)->_scroll = ((bf) ? TRUE : FALSE)), OK) 982*0Sstevel@tonic-gate#define idcok(win, bf) ((win)->_use_idc = ((bf) ? TRUE : FALSE)) 983*0Sstevel@tonic-gate#define nodelay(win, bf) (((win)->_delay = (bf) ? 0 : -1), OK) 984*0Sstevel@tonic-gate#define is_wintouched(win) ((win)->_flags & _WINCHANGED) 985*0Sstevel@tonic-gate#define is_linetouched(win, line) \ 986*0Sstevel@tonic-gate ((((line) >= (win)->_maxy) || ((line) < 0)) ? ERR : \ 987*0Sstevel@tonic-gate (((win)->_firstch[(line)] == _INFINITY) ? FALSE : TRUE)) 988*0Sstevel@tonic-gate 989*0Sstevel@tonic-gate#define subwin(win, nl, nc, by, bx) \ 990*0Sstevel@tonic-gate derwin((win), (nl), (nc), (by-win->_begy), (bx-win->_begx)) 991*0Sstevel@tonic-gate#define touchwin(win) wtouchln((win), 0, (win)->_maxy, TRUE) 992*0Sstevel@tonic-gate#define redrawwin(win) wredrawln((win), 0, (win)->_maxy) 993*0Sstevel@tonic-gate#define winchstr(win, str) \ 994*0Sstevel@tonic-gate winchnstr((win), str, ((win)->_maxx - (win)->_curx)) 995*0Sstevel@tonic-gate#define winstr(win, str) \ 996*0Sstevel@tonic-gate winnstr((win), str, ((win)->_maxx - (win)->_curx)) 997*0Sstevel@tonic-gate#define untouchwin(win) wtouchln((win), 0, ((win)->_maxy), FALSE) 998*0Sstevel@tonic-gate#define winch(win) ((win)->_y[(win)->_cury][(win)->_curx]) 999*0Sstevel@tonic-gate 1000*0Sstevel@tonic-gate#define wtimeout(win, tm) ((win)->_delay = (tm)) 1001*0Sstevel@tonic-gate#define use_env(bf) (_use_env = (bf)) 1002*0Sstevel@tonic-gate 1003*0Sstevel@tonic-gate#else /* CURS_PERFORMANCE */ 1004*0Sstevel@tonic-gate 1005*0Sstevel@tonic-gate#ifdef __STDC__ 1006*0Sstevel@tonic-gate 1007*0Sstevel@tonic-gateextern void wbkgdset(WINDOW *, chtype); 1008*0Sstevel@tonic-gateextern void idcok(WINDOW *, bool); 1009*0Sstevel@tonic-gateextern void wtimeout(WINDOW *, int); 1010*0Sstevel@tonic-gateextern void use_env(int); /* int sb. char */ 1011*0Sstevel@tonic-gate 1012*0Sstevel@tonic-gateextern int syncok(WINDOW *, bool); 1013*0Sstevel@tonic-gateextern int notimeout(WINDOW *, bool); 1014*0Sstevel@tonic-gateextern int clearok(WINDOW *, bool); 1015*0Sstevel@tonic-gateextern int leaveok(WINDOW *, bool); 1016*0Sstevel@tonic-gateextern int scrollok(WINDOW *, bool); 1017*0Sstevel@tonic-gateextern int nodelay(WINDOW *, bool); 1018*0Sstevel@tonic-gateextern int is_linetouched(WINDOW *, int); 1019*0Sstevel@tonic-gateextern int is_wintouched(WINDOW *); 1020*0Sstevel@tonic-gateextern int touchwin(WINDOW *); 1021*0Sstevel@tonic-gateextern int redrawwin(WINDOW *); 1022*0Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *); 1023*0Sstevel@tonic-gateextern int winstr(WINDOW *, char *); 1024*0Sstevel@tonic-gateextern int untouchwin(WINDOW *); 1025*0Sstevel@tonic-gate 1026*0Sstevel@tonic-gateextern chtype winch(WINDOW *); 1027*0Sstevel@tonic-gate 1028*0Sstevel@tonic-gateextern WINDOW *subwin(WINDOW *, int, int, int, int); 1029*0Sstevel@tonic-gate 1030*0Sstevel@tonic-gate#else /* __STDC__ */ 1031*0Sstevel@tonic-gate 1032*0Sstevel@tonic-gateextern void wbkgdset(), idcok(), wtimeout(), use_env(); 1033*0Sstevel@tonic-gate 1034*0Sstevel@tonic-gateextern int syncok(), notimeout(), clearok(), leaveok(), 1035*0Sstevel@tonic-gate scrollok(), nodelay(), is_linetouched(), is_wintouched(), 1036*0Sstevel@tonic-gate touchwin(), redrawwin(), winchstr(), winstr(), 1037*0Sstevel@tonic-gate untouchwin(); 1038*0Sstevel@tonic-gate 1039*0Sstevel@tonic-gateextern chtype winch(); 1040*0Sstevel@tonic-gate 1041*0Sstevel@tonic-gateextern WINDOW *subwin(); 1042*0Sstevel@tonic-gate 1043*0Sstevel@tonic-gate#endif /* __STDC__ */ 1044*0Sstevel@tonic-gate 1045*0Sstevel@tonic-gate#endif /* CURS_PERFORMANCE */ 1046*0Sstevel@tonic-gate 1047*0Sstevel@tonic-gate/* functions for move and update */ 1048*0Sstevel@tonic-gate#define mvaddch(y, x, ch) \ 1049*0Sstevel@tonic-gate mvwaddch(stdscr, y, x, ch) 1050*0Sstevel@tonic-gate#define mvaddnstr(y, x, s, n) \ 1051*0Sstevel@tonic-gate mvwaddnstr(stdscr, y, x, s, n) 1052*0Sstevel@tonic-gate#define mvaddstr(y, x, str) \ 1053*0Sstevel@tonic-gate mvwaddstr(stdscr, y, x, str) 1054*0Sstevel@tonic-gate#define mvdelch(y, x) \ 1055*0Sstevel@tonic-gate mvwdelch(stdscr, y, x) 1056*0Sstevel@tonic-gate#define mvgetch(y, x) \ 1057*0Sstevel@tonic-gate mvwgetch(stdscr, y, x) 1058*0Sstevel@tonic-gate#define mvgetstr(y, x, str) \ 1059*0Sstevel@tonic-gate mvwgetstr(stdscr, y, x, str) 1060*0Sstevel@tonic-gate#define mvinch(y, x) \ 1061*0Sstevel@tonic-gate mvwinch(stdscr, y, x) 1062*0Sstevel@tonic-gate#define mvinsch(y, x, c) \ 1063*0Sstevel@tonic-gate mvwinsch(stdscr, y, x, c) 1064*0Sstevel@tonic-gate#define mvinsnstr(y, x, s, n) \ 1065*0Sstevel@tonic-gate mvwinsnstr(stdscr, y, x, s, n) 1066*0Sstevel@tonic-gate#define mvinsstr(y, x, s) \ 1067*0Sstevel@tonic-gate mvwinsstr(stdscr, y, x, s) 1068*0Sstevel@tonic-gate#define mvaddchstr(y, x, str) \ 1069*0Sstevel@tonic-gate mvwaddchstr(stdscr, y, x, str) 1070*0Sstevel@tonic-gate#define mvaddchnstr(y, x, str, n) \ 1071*0Sstevel@tonic-gate mvwaddchnstr(stdscr, y, x, str, n) 1072*0Sstevel@tonic-gate#define mvinstr(y, x, str) \ 1073*0Sstevel@tonic-gate mvwinstr(stdscr, y, x, (str)) 1074*0Sstevel@tonic-gate#define mvinnstr(y, x, str, n) \ 1075*0Sstevel@tonic-gate mvwinnstr(stdscr, y, x, (str), (n)) 1076*0Sstevel@tonic-gate#define mvinchstr(y, x, str) \ 1077*0Sstevel@tonic-gate mvwinchstr(stdscr, y, x, str) 1078*0Sstevel@tonic-gate#define mvinchnstr(y, x, str, n) \ 1079*0Sstevel@tonic-gate mvwinchnstr(stdscr, y, x, str, n) 1080*0Sstevel@tonic-gate#define mvhline(y, x, c, num) \ 1081*0Sstevel@tonic-gate mvwhline(stdscr, y, x, c, num) 1082*0Sstevel@tonic-gate#define mvvline(y, x, c, num) \ 1083*0Sstevel@tonic-gate mvwvline(stdscr, y, x, c, num) 1084*0Sstevel@tonic-gate 1085*0Sstevel@tonic-gate#define mvaddnwstr(y, x, ws, n) \ 1086*0Sstevel@tonic-gate mvwaddnwstr(stdscr, y, x, ws, n) 1087*0Sstevel@tonic-gate#define mvaddwch(y, x, ch) \ 1088*0Sstevel@tonic-gate mvwaddwch(stdscr, y, x, ch) 1089*0Sstevel@tonic-gate#define mvaddwchnstr(y, x, str, n) \ 1090*0Sstevel@tonic-gate mvwaddwchnstr(stdscr, y, x, str, n) 1091*0Sstevel@tonic-gate#define mvaddwchstr(y, x, str) \ 1092*0Sstevel@tonic-gate mvwaddwchstr(stdscr, y, x, str) 1093*0Sstevel@tonic-gate#define mvaddwstr(y, x, ws) \ 1094*0Sstevel@tonic-gate mvwaddwstr(stdscr, y, x, ws) 1095*0Sstevel@tonic-gate#define mvgetnwstr(y, x, ws, n) \ 1096*0Sstevel@tonic-gate mvwgetnwstr(stdscr, y, x, ws, n) 1097*0Sstevel@tonic-gate#define mvgetwch(y, x) \ 1098*0Sstevel@tonic-gate mvwgetwch(stdscr, y, x) 1099*0Sstevel@tonic-gate#define mvgetwstr(y, x, ws) \ 1100*0Sstevel@tonic-gate mvwgetwstr(stdscr, y, x, ws) 1101*0Sstevel@tonic-gate#define mvinnwstr(y, x, ws, n) \ 1102*0Sstevel@tonic-gate mvwinnwstr(stdscr, y, x, ws, n) 1103*0Sstevel@tonic-gate#define mvinsnwstr(y, x, ws, n) \ 1104*0Sstevel@tonic-gate mvwinsnwstr(stdscr, y, x, ws, n) 1105*0Sstevel@tonic-gate#define mvinswch(y, x, c) \ 1106*0Sstevel@tonic-gate mvwinswch(stdscr, y, x, c) 1107*0Sstevel@tonic-gate#define mvinswstr(y, x, ws) \ 1108*0Sstevel@tonic-gate mvwinswstr(stdscr, y, x, ws) 1109*0Sstevel@tonic-gate#define mvinwch(y, x) \ 1110*0Sstevel@tonic-gate mvwinwch(stdscr, y, x) 1111*0Sstevel@tonic-gate#define mvinwchnstr(y, x, str, n) \ 1112*0Sstevel@tonic-gate mvwinwchnstr(stdscr, y, x, str, n) 1113*0Sstevel@tonic-gate#define mvinwchstr(y, x, str) \ 1114*0Sstevel@tonic-gate mvwinwchstr(stdscr, y, x, str) 1115*0Sstevel@tonic-gate#define mvinwstr(y, x, ws) \ 1116*0Sstevel@tonic-gate mvwinwstr(stdscr, y, x, ws) 1117*0Sstevel@tonic-gate 1118*0Sstevel@tonic-gate#define mvwaddch(win, y, x, ch) \ 1119*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddch(win, ch)) 1120*0Sstevel@tonic-gate#define mvwaddnstr(win, y, x, s, n) \ 1121*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddnstr(win, s, n)) 1122*0Sstevel@tonic-gate#define mvwaddstr(win, y, x, str) \ 1123*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddstr(win, str)) 1124*0Sstevel@tonic-gate#define mvwdelch(win, y, x) \ 1125*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wdelch(win)) 1126*0Sstevel@tonic-gate#define mvwgetch(win, y, x) \ 1127*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wgetch(win)) 1128*0Sstevel@tonic-gate#define mvwgetstr(win, y, x, str) \ 1129*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wgetstr(win, str)) 1130*0Sstevel@tonic-gate#define mvwinch(win, y, x) \ 1131*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? (chtype)ERR : winch(win)) 1132*0Sstevel@tonic-gate#define mvwinsch(win, y, x, c) \ 1133*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winsch(win, c)) 1134*0Sstevel@tonic-gate#define mvwinsnstr(win, y, x, s, n) \ 1135*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winsnstr(win, s, n)) 1136*0Sstevel@tonic-gate#define mvwinsstr(win, y, x, s) \ 1137*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winsstr(win, s)) 1138*0Sstevel@tonic-gate#define mvwhline(win, y, x, c, num) \ 1139*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : whline(win, c, num)) 1140*0Sstevel@tonic-gate#define mvwvline(win, y, x, c, num) \ 1141*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wvline(win, c, num)) 1142*0Sstevel@tonic-gate#define mvwaddchstr(win, y, x, str) \ 1143*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddchstr(win, str)) 1144*0Sstevel@tonic-gate#define mvwaddchnstr(win, y, x, str, n) \ 1145*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddchnstr(win, str, n)) 1146*0Sstevel@tonic-gate#define mvwinstr(win, y, x, str) \ 1147*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winstr(win, str)) 1148*0Sstevel@tonic-gate#define mvwinnstr(win, y, x, str, n) \ 1149*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winnstr(win, str, n)) 1150*0Sstevel@tonic-gate#define mvwinchstr(win, y, x, str) \ 1151*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winchstr(win, str)) 1152*0Sstevel@tonic-gate#define mvwinchnstr(win, y, x, str, n) \ 1153*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winchnstr(win, str, n)) 1154*0Sstevel@tonic-gate#define mvwaddnwstr(win, y, x, ws, n) \ 1155*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddnwstr(win, ws, n)) 1156*0Sstevel@tonic-gate#define mvwaddwch(win, y, x, ch) \ 1157*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddwch(win, ch)) 1158*0Sstevel@tonic-gate#define mvwaddwchnstr(win, y, x, str, n) \ 1159*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddwchnstr(win, str, n)) 1160*0Sstevel@tonic-gate#define mvwaddwchstr(win, y, x, str) \ 1161*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddwchstr(win, str)) 1162*0Sstevel@tonic-gate#define mvwaddwstr(win, y, x, ws) \ 1163*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : waddwstr(win, ws)) 1164*0Sstevel@tonic-gate#define mvwgetnwstr(win, y, x, ws, n) \ 1165*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wgetnwstr(win, ws, n)) 1166*0Sstevel@tonic-gate#define mvwgetwch(win, y, x) \ 1167*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wgetwch(win)) 1168*0Sstevel@tonic-gate#define mvwgetwstr(win, y, x, ws) \ 1169*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : wgetwstr(win, ws)) 1170*0Sstevel@tonic-gate#define mvwinnwstr(win, y, x, ws, n) \ 1171*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winnwstr(win, ws, n)) 1172*0Sstevel@tonic-gate#define mvwinsnwstr(win, y, x, ws, n) \ 1173*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winsnwstr(win, ws, n)) 1174*0Sstevel@tonic-gate#define mvwinswch(win, y, x, c) \ 1175*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winswch(win, c)) 1176*0Sstevel@tonic-gate#define mvwinswstr(win, y, x, ws) \ 1177*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winswstr(win, ws)) 1178*0Sstevel@tonic-gate#define mvwinwch(win, y, x) \ 1179*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ?(chtype) ERR : winwch(win)) 1180*0Sstevel@tonic-gate#define mvwinwchnstr(win, y, x, str, n) \ 1181*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winwchnstr(win, str, n)) 1182*0Sstevel@tonic-gate#define mvwinwchstr(win, y, x, str) \ 1183*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winwchstr(win, str)) 1184*0Sstevel@tonic-gate#define mvwinwstr(win, y, x, ws) \ 1185*0Sstevel@tonic-gate (wmove(win, y, x) == ERR ? ERR : winwstr(win, ws)) 1186*0Sstevel@tonic-gate 1187*0Sstevel@tonic-gate#define waddwchstr(win, str) waddwchnstr(win, str, -1) 1188*0Sstevel@tonic-gate#define winwchstr(win, str) winwchnstr(win, str, -1) 1189*0Sstevel@tonic-gate#define waddwstr(win, ws) waddnwstr(win, ws, -1) 1190*0Sstevel@tonic-gate#define winswstr(win, ws) winsnwstr(win, ws, -1) 1191*0Sstevel@tonic-gate 1192*0Sstevel@tonic-gate#ifdef CURS_MACROS 1193*0Sstevel@tonic-gate#define overlay(src, dst) _overlap((src), (dst), TRUE) 1194*0Sstevel@tonic-gate#define overwrite(src, dst) _overlap((src), (dst), FALSE) 1195*0Sstevel@tonic-gate#define wdeleteln(win) winsdelln((win), -1) 1196*0Sstevel@tonic-gate#define winsertln(win) winsdelln((win), 1) 1197*0Sstevel@tonic-gate#define wstandend(win) wattrset((win), A_NORMAL) 1198*0Sstevel@tonic-gate#define wstandout(win) wattron((win), A_STANDOUT) 1199*0Sstevel@tonic-gate#define beep() _ring(TRUE) 1200*0Sstevel@tonic-gate#define flash() _ring(FALSE) 1201*0Sstevel@tonic-gate#define scroll(win) wscrl((win), 1) 1202*0Sstevel@tonic-gate#define slk_init(f) slk_start(((f == 0) ? 3 : 2), NULL) 1203*0Sstevel@tonic-gate#define scr_init(file) _scr_all(file, 0) 1204*0Sstevel@tonic-gate#define scr_restore(file) _scr_all(file, 1) 1205*0Sstevel@tonic-gate#define scr_set(file) _scr_all(file, 2) 1206*0Sstevel@tonic-gate#define subpad(win, nl, nc, by, bx) derwin((win), (nl), (nc), (by), (bx)) 1207*0Sstevel@tonic-gate#define box(win, v, h) wborder((win), (v), (v), (h), (h), 0, 0, 0, 0) 1208*0Sstevel@tonic-gate#define newterm(type, fout, fin) newscreen((type), 0, 0, 0, (fout), (fin)) 1209*0Sstevel@tonic-gate#define touchline(win, y, n) wtouchln((win), (y), (n), TRUE) 1210*0Sstevel@tonic-gate 1211*0Sstevel@tonic-gate#define waddstr(win, str) waddnstr((win), (str), -1) 1212*0Sstevel@tonic-gate#define werase(win) (wmove((win), 0, 0), wclrtobot(win)) 1213*0Sstevel@tonic-gate#define wclear(win) (clearok((win), TRUE), werase(win)) 1214*0Sstevel@tonic-gate#define intrflush(win, flag) _setqiflush(flag) 1215*0Sstevel@tonic-gate#define meta(win, flag) _meta(flag) 1216*0Sstevel@tonic-gate 1217*0Sstevel@tonic-gate#define setterm(name) setupterm((name), 1, (char *)NULL) 1218*0Sstevel@tonic-gate#define gettmode() (OK) 1219*0Sstevel@tonic-gate#define halfdelay(tens) ttimeout((tens)*100) 1220*0Sstevel@tonic-gate 1221*0Sstevel@tonic-gate#define echo() _setecho(TRUE) 1222*0Sstevel@tonic-gate#define noecho() _setecho(FALSE) 1223*0Sstevel@tonic-gate#define nl() _setnonl(FALSE) 1224*0Sstevel@tonic-gate#define nonl() _setnonl(TRUE) 1225*0Sstevel@tonic-gate 1226*0Sstevel@tonic-gate#else /* CURS_MACROS */ 1227*0Sstevel@tonic-gate 1228*0Sstevel@tonic-gate#ifdef __STDC__ 1229*0Sstevel@tonic-gate 1230*0Sstevel@tonic-gateextern int overlay(WINDOW *, WINDOW *); 1231*0Sstevel@tonic-gateextern int overwrite(WINDOW *, WINDOW *); 1232*0Sstevel@tonic-gateextern int wdeleteln(WINDOW *); 1233*0Sstevel@tonic-gateextern int winsertln(WINDOW *); 1234*0Sstevel@tonic-gateextern int wstandend(WINDOW *); 1235*0Sstevel@tonic-gateextern int wstandout(WINDOW *); 1236*0Sstevel@tonic-gateextern int beep(void); 1237*0Sstevel@tonic-gateextern int flash(void); 1238*0Sstevel@tonic-gateextern int scroll(WINDOW *); 1239*0Sstevel@tonic-gateextern int slk_init(int); 1240*0Sstevel@tonic-gateextern int scr_init(char *); 1241*0Sstevel@tonic-gateextern int scr_restore(char *); 1242*0Sstevel@tonic-gateextern int box(WINDOW *, chtype, chtype); 1243*0Sstevel@tonic-gateextern int touchline(WINDOW *, int, int); 1244*0Sstevel@tonic-gateextern int waddstr(WINDOW *, char *); 1245*0Sstevel@tonic-gateextern int werase(WINDOW *); 1246*0Sstevel@tonic-gateextern int wclear(WINDOW *); 1247*0Sstevel@tonic-gateextern int intrflush(WINDOW *, int); 1248*0Sstevel@tonic-gateextern int meta(WINDOW *, int); 1249*0Sstevel@tonic-gateextern int setterm(char *); 1250*0Sstevel@tonic-gateextern int gettmode(void); 1251*0Sstevel@tonic-gateextern int halfdelay(int); 1252*0Sstevel@tonic-gateextern int echo(void); 1253*0Sstevel@tonic-gateextern int noecho(void); 1254*0Sstevel@tonic-gateextern int nl(void); 1255*0Sstevel@tonic-gateextern int nonl(void); 1256*0Sstevel@tonic-gate 1257*0Sstevel@tonic-gateextern WINDOW *subpad(WINDOW *, int, int, int, int); 1258*0Sstevel@tonic-gate 1259*0Sstevel@tonic-gateextern SCREEN *newterm(char *, FILE *, FILE *); 1260*0Sstevel@tonic-gate 1261*0Sstevel@tonic-gate#else /* __STDC__ */ 1262*0Sstevel@tonic-gate 1263*0Sstevel@tonic-gateextern int overlay(), overwrite(), wdeleteln(), winsertln(), 1264*0Sstevel@tonic-gate wstandend(), wstandout(), beep(), flash(), 1265*0Sstevel@tonic-gate scroll(), slk_init(), scr_init(), scr_restore(), 1266*0Sstevel@tonic-gate box(), touchline(), waddstr(), werase(), 1267*0Sstevel@tonic-gate wclear(), intrflush(), meta(), setterm(), gettmode(), 1268*0Sstevel@tonic-gate halfdelay(), echo(), noecho(), nl(), nonl(); 1269*0Sstevel@tonic-gate 1270*0Sstevel@tonic-gateextern WINDOW *subpad(); 1271*0Sstevel@tonic-gate 1272*0Sstevel@tonic-gateextern SCREEN *newterm(); 1273*0Sstevel@tonic-gate 1274*0Sstevel@tonic-gate#endif /* __STDC__ */ 1275*0Sstevel@tonic-gate#endif /* CURS_MACROS */ 1276*0Sstevel@tonic-gate 1277*0Sstevel@tonic-gate#define garbagedlines wredrawln 1278*0Sstevel@tonic-gate#define garbagedwin redrawwin 1279*0Sstevel@tonic-gate 1280*0Sstevel@tonic-gate#define crmode cbreak 1281*0Sstevel@tonic-gate#define nocrmode nocbreak 1282*0Sstevel@tonic-gate#define saveterm def_prog_mode 1283*0Sstevel@tonic-gate#define fixterm reset_prog_mode 1284*0Sstevel@tonic-gate#define resetterm reset_shell_mode 1285*0Sstevel@tonic-gate 1286*0Sstevel@tonic-gate#define waddchstr(win, str) waddchnstr((win), (str), -1) 1287*0Sstevel@tonic-gate#define winsstr(win, str) winsnstr((win), (str), -1) 1288*0Sstevel@tonic-gate 1289*0Sstevel@tonic-gate/* iocontrol functions */ 1290*0Sstevel@tonic-gate#define qiflush() _setqiflush(TRUE) 1291*0Sstevel@tonic-gate#define noqiflush() _setqiflush(FALSE) 1292*0Sstevel@tonic-gate 1293*0Sstevel@tonic-gate#define set_term setcurscreen 1294*0Sstevel@tonic-gate 1295*0Sstevel@tonic-gate#endif /* NOMACROS || __lint */ 1296*0Sstevel@tonic-gate 1297*0Sstevel@tonic-gate/* 1298*0Sstevel@tonic-gate * Standard alternate character set. The current ACS world is evolving, 1299*0Sstevel@tonic-gate * so we support only a widely available subset: the line drawing characters 1300*0Sstevel@tonic-gate * from the VT100, plus a few from the Teletype 5410v1. Eventually there 1301*0Sstevel@tonic-gate * may be support of more sophisticated ACS line drawing, such as that 1302*0Sstevel@tonic-gate * in the Teletype 5410, the HP line drawing set, and the like. There may 1303*0Sstevel@tonic-gate * be support for some non line oriented characters as well. 1304*0Sstevel@tonic-gate * 1305*0Sstevel@tonic-gate * Line drawing ACS names are of the form ACS_trbl, where t is the top, r 1306*0Sstevel@tonic-gate * is the right, b is the bottom, and l is the left. t, r, b, and l might 1307*0Sstevel@tonic-gate * be B (blank), S (single), D (double), or T (thick). The subset defined 1308*0Sstevel@tonic-gate * here only uses B and S. 1309*0Sstevel@tonic-gate */ 1310*0Sstevel@tonic-gate 1311*0Sstevel@tonic-gate#define ACS_BSSB (acs_map['l']) 1312*0Sstevel@tonic-gate#define ACS_SSBB (acs_map['m']) 1313*0Sstevel@tonic-gate#define ACS_BBSS (acs_map['k']) 1314*0Sstevel@tonic-gate#define ACS_SBBS (acs_map['j']) 1315*0Sstevel@tonic-gate#define ACS_SBSS (acs_map['u']) 1316*0Sstevel@tonic-gate#define ACS_SSSB (acs_map['t']) 1317*0Sstevel@tonic-gate#define ACS_SSBS (acs_map['v']) 1318*0Sstevel@tonic-gate#define ACS_BSSS (acs_map['w']) 1319*0Sstevel@tonic-gate#define ACS_BSBS (acs_map['q']) 1320*0Sstevel@tonic-gate#define ACS_SBSB (acs_map['x']) 1321*0Sstevel@tonic-gate#define ACS_SSSS (acs_map['n']) 1322*0Sstevel@tonic-gate 1323*0Sstevel@tonic-gate/* 1324*0Sstevel@tonic-gate * Human readable names for the most commonly used characters. 1325*0Sstevel@tonic-gate * "Upper", "right", etc. are chosen to be consistent with the vt100 manual. 1326*0Sstevel@tonic-gate */ 1327*0Sstevel@tonic-gate 1328*0Sstevel@tonic-gate#define ACS_ULCORNER ACS_BSSB 1329*0Sstevel@tonic-gate#define ACS_LLCORNER ACS_SSBB 1330*0Sstevel@tonic-gate#define ACS_URCORNER ACS_BBSS 1331*0Sstevel@tonic-gate#define ACS_LRCORNER ACS_SBBS 1332*0Sstevel@tonic-gate#define ACS_RTEE ACS_SBSS 1333*0Sstevel@tonic-gate#define ACS_LTEE ACS_SSSB 1334*0Sstevel@tonic-gate#define ACS_BTEE ACS_SSBS 1335*0Sstevel@tonic-gate#define ACS_TTEE ACS_BSSS 1336*0Sstevel@tonic-gate#define ACS_HLINE ACS_BSBS 1337*0Sstevel@tonic-gate#define ACS_VLINE ACS_SBSB 1338*0Sstevel@tonic-gate#define ACS_PLUS ACS_SSSS 1339*0Sstevel@tonic-gate#define ACS_S1 (acs_map['o']) /* scan line 1 */ 1340*0Sstevel@tonic-gate#define ACS_S9 (acs_map['s']) /* scan line 9 */ 1341*0Sstevel@tonic-gate#define ACS_DIAMOND (acs_map['`']) /* diamond */ 1342*0Sstevel@tonic-gate#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */ 1343*0Sstevel@tonic-gate#define ACS_DEGREE (acs_map['f']) /* degree symbol */ 1344*0Sstevel@tonic-gate#define ACS_PLMINUS (acs_map['g']) /* plus/minus */ 1345*0Sstevel@tonic-gate#define ACS_BULLET (acs_map['~']) /* bullet */ 1346*0Sstevel@tonic-gate /* Teletype 5410v1 symbols */ 1347*0Sstevel@tonic-gate#define ACS_LARROW (acs_map[',']) /* arrow pointing left */ 1348*0Sstevel@tonic-gate#define ACS_RARROW (acs_map['+']) /* arrow pointing right */ 1349*0Sstevel@tonic-gate#define ACS_DARROW (acs_map['.']) /* arrow pointing down */ 1350*0Sstevel@tonic-gate#define ACS_UARROW (acs_map['-']) /* arrow pointing up */ 1351*0Sstevel@tonic-gate#define ACS_BOARD (acs_map['h']) /* board of squares */ 1352*0Sstevel@tonic-gate#define ACS_LANTERN (acs_map['i']) /* lantern symbol */ 1353*0Sstevel@tonic-gate#define ACS_BLOCK (acs_map['0']) /* solid square block */ 1354*0Sstevel@tonic-gate 1355*0Sstevel@tonic-gate. 1356*0Sstevel@tonic-gate$a 1357*0Sstevel@tonic-gate 1358*0Sstevel@tonic-gate/* 1359*0Sstevel@tonic-gate * The definition for 'reg' is not standard, and is provided for 1360*0Sstevel@tonic-gate * compatibility reasons. User's are discouraged from using this. 1361*0Sstevel@tonic-gate */ 1362*0Sstevel@tonic-gate#define reg register 1363*0Sstevel@tonic-gate 1364*0Sstevel@tonic-gate/* Various video attributes */ 1365*0Sstevel@tonic-gate#define A_STANDOUT 000010000000 1366*0Sstevel@tonic-gate#define _STANDOUT A_STANDOUT /* for compatability with old curses */ 1367*0Sstevel@tonic-gate#define A_UNDERLINE 000020000000 1368*0Sstevel@tonic-gate#define A_REVERSE 000040000000 1369*0Sstevel@tonic-gate#define A_BLINK 000100000000 1370*0Sstevel@tonic-gate#define A_DIM 000200000000 1371*0Sstevel@tonic-gate#define A_BOLD 000400000000 1372*0Sstevel@tonic-gate#define A_ALTCHARSET 001000000000 1373*0Sstevel@tonic-gate 1374*0Sstevel@tonic-gate/* The next two are subject to change so don't depend on them */ 1375*0Sstevel@tonic-gate#define A_INVIS 010000000000 1376*0Sstevel@tonic-gate#define A_PROTECT 020000000000U 1377*0Sstevel@tonic-gate 1378*0Sstevel@tonic-gate#define A_NORMAL 000000000000 1379*0Sstevel@tonic-gate#define A_ATTRIBUTES 031777700000U /* 0xCFFF8000 */ 1380*0Sstevel@tonic-gate#define A_CHARTEXT 006000077777 /* 0x30007FFF */ 1381*0Sstevel@tonic-gate#define A_COLOR 000007700000 1382*0Sstevel@tonic-gate 1383*0Sstevel@tonic-gate#define A_WATTRIBUTES 031770000000U /* 0xCFE00000 */ 1384*0Sstevel@tonic-gate#define A_WCHARTEXT 006007777777 /* 0x301FFFFF */ 1385*0Sstevel@tonic-gate 1386*0Sstevel@tonic-gate#define COLOR_PAIR(n) ((n) << 15) 1387*0Sstevel@tonic-gate#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 15) 1388*0Sstevel@tonic-gate 1389*0Sstevel@tonic-gate/* definition of 8 basic color */ 1390*0Sstevel@tonic-gate#define COLOR_BLACK 0 1391*0Sstevel@tonic-gate#define COLOR_RED 1 1392*0Sstevel@tonic-gate#define COLOR_GREEN 2 1393*0Sstevel@tonic-gate#define COLOR_YELLOW 3 1394*0Sstevel@tonic-gate#define COLOR_BLUE 4 1395*0Sstevel@tonic-gate#define COLOR_MAGENTA 5 1396*0Sstevel@tonic-gate#define COLOR_CYAN 6 1397*0Sstevel@tonic-gate#define COLOR_WHITE 7 1398*0Sstevel@tonic-gate 1399*0Sstevel@tonic-gate/* mouse related macros: don't change these definitions or bit-masks. */ 1400*0Sstevel@tonic-gate/* they are interdependent (used by _map_button() in tgetch() */ 1401*0Sstevel@tonic-gate#define BUTTON_RELEASED 0 1402*0Sstevel@tonic-gate#define BUTTON_PRESSED 1 1403*0Sstevel@tonic-gate#define BUTTON_CLICKED 2 1404*0Sstevel@tonic-gate#define BUTTON_DOUBLE_CLICKED 3 1405*0Sstevel@tonic-gate#define BUTTON_TRIPLE_CLICKED 4 1406*0Sstevel@tonic-gate 1407*0Sstevel@tonic-gate#define MOUSE_X_POS (Mouse_status.x) 1408*0Sstevel@tonic-gate#define MOUSE_Y_POS (Mouse_status.y) 1409*0Sstevel@tonic-gate#define A_BUTTON_CHANGED (Mouse_status.changes & 7) 1410*0Sstevel@tonic-gate#define MOUSE_MOVED (Mouse_status.changes & 8) 1411*0Sstevel@tonic-gate#define MOUSE_POS_REPORT (Mouse_status.changes & 16) 1412*0Sstevel@tonic-gate#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1))) 1413*0Sstevel@tonic-gate#define BUTTON_STATUS(x) (Mouse_status.button[(x)-1]) 1414*0Sstevel@tonic-gate 1415*0Sstevel@tonic-gate/* definition of mouse bit-masks */ 1416*0Sstevel@tonic-gate#define BUTTON1_RELEASED 000000000001 1417*0Sstevel@tonic-gate#define BUTTON1_PRESSED 000000000002 1418*0Sstevel@tonic-gate#define BUTTON1_CLICKED 000000000004 1419*0Sstevel@tonic-gate#define BUTTON1_DOUBLE_CLICKED 000000000010 1420*0Sstevel@tonic-gate#define BUTTON1_TRIPLE_CLICKED 000000000020 1421*0Sstevel@tonic-gate#define BUTTON2_RELEASED 000000000040 1422*0Sstevel@tonic-gate#define BUTTON2_PRESSED 000000000100 1423*0Sstevel@tonic-gate#define BUTTON2_CLICKED 000000000200 1424*0Sstevel@tonic-gate#define BUTTON2_DOUBLE_CLICKED 000000000400 1425*0Sstevel@tonic-gate#define BUTTON2_TRIPLE_CLICKED 000000001000 1426*0Sstevel@tonic-gate#define BUTTON3_RELEASED 000000002000 1427*0Sstevel@tonic-gate#define BUTTON3_PRESSED 000000004000 1428*0Sstevel@tonic-gate#define BUTTON3_CLICKED 000000010000 1429*0Sstevel@tonic-gate#define BUTTON3_DOUBLE_CLICKED 000000020000 1430*0Sstevel@tonic-gate#define BUTTON3_TRIPLE_CLICKED 000000040000 1431*0Sstevel@tonic-gate#define ALL_MOUSE_EVENTS 000000077777 1432*0Sstevel@tonic-gate#define REPORT_MOUSE_POSITION 000000100000 1433*0Sstevel@tonic-gate 1434*0Sstevel@tonic-gate#ifdef __cplusplus 1435*0Sstevel@tonic-gate} 1436*0Sstevel@tonic-gate#endif 1437*0Sstevel@tonic-gate 1438*0Sstevel@tonic-gate#endif /* _CURSES_H */ 1439*0Sstevel@tonic-gate. 1440*0Sstevel@tonic-gate0r copyright.h 1441*0Sstevel@tonic-gate/copyright\.h/d 1442*0Sstevel@tonic-gate. 1443*0Sstevel@tonic-gate1,$s/\@(\#)curses\.ed/\@(\#)curses\.h/ 1444*0Sstevel@tonic-gatew curses.h 1445