home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / gcc-lib / i486-unknown-sco3.2v5.0.0elf / 2.6-95q2 / include / oldstyle / tinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-12  |  36.4 KB  |  968 lines

  1. #ifndef _PARAMS
  2. #if defined(__STDC__) || defined(__cplusplus)
  3. #define _PARAMS(ARGS) ARGS
  4. #else
  5. #define _PARAMS(ARGS) ()
  6. #endif
  7. #endif /* _PARAMS */
  8. #ident    "oldstyle @(#)curses:common/lib/xlibcurses/screen/curses.ed    1.60.2.6"
  9. #ident    "oldstyle @(#) curses.ed 20.1 94/12/04 "
  10. /*
  11. *    Copyright (C) 1993-1995 The Santa Cruz Operation, Inc.
  12.  *        All Rights Reserved.
  13.  *
  14.  *
  15.  *    This Module contains Proprietary Information of
  16.  *    The Santa Cruz Operation Inc., and should be treated as Confidential.
  17.  */
  18.  
  19. /*    Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc.    */
  20. /*    Copyright (c) 1988, 1990 AT&T    */
  21. /*      All Rights Reserved      */
  22.  
  23. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  24. /*    UNIX System Laboratories, Inc.                         */
  25. /*    The copyright notice above does not evidence any       */
  26. /*    actual or intended publication of such source code.    */
  27.  
  28.  
  29. #ident "oldstyle @(#) copyright.h 20.1 94/12/04 "
  30.  
  31. #ident  "oldstyle $Header: copyright.h 1.2 91/06/26 $"
  32.  
  33. /*
  34.  * curses.h - this file is automatically made from caps and
  35.  *    curses.ed. Don't make changes directly to curses.h!
  36.  */
  37. #ifndef _TINFO_H
  38. #define _TINFO_H    /* define prevents multiple includes */
  39.  
  40. #ident    "oldstyle @(#) curses.ed 20.1 94/12/04 "
  41.  
  42.  
  43.  
  44.  
  45.  
  46. #pragma    pack(4)
  47.  
  48. #ifndef _WCHAR_T
  49. #define _WCHAR_T
  50. typedef long    wchar_t;
  51. #endif
  52.  
  53. #define    CSMAX    4
  54.  
  55. #include  <stdio.h>
  56.  
  57. /*
  58.  *  Use _M_SYSV rather than L_ctermid to determine SYSVness
  59.  */
  60. #define    SYSV
  61.  
  62. #ifdef SYSV
  63. # ifndef _TERMIO_H
  64. #  include <termio.h>
  65. # endif /* _TERMIO_H */
  66.     typedef struct termio SGTTY;
  67. #else /* !SYSV */
  68. # ifndef _SGTTY_
  69. #  include <sgtty.h>
  70. # endif /* _SGTTY_ */
  71.     typedef struct sgttyb SGTTY;
  72. /*
  73.  * Here we attempt to improve portability by providing some #defines
  74.  * for SYSV functions on non-SYSV systems.
  75.  */
  76.  
  77. # define memcpy(dst, src, len)    bcopy((src), (dst), (len))
  78. # define strchr            index
  79. # define strrchr        rindex
  80. #endif /* SYSV */
  81.  
  82. typedef    unsigned char bool;
  83.  
  84. #define _VR3_COMPAT_CODE
  85. /*
  86.  * chtype is the type used to store a character together with attributes.
  87.  * It can be set to "char" to save space, or "long" to get more attributes.
  88.  */
  89. #ifdef    CHTYPE
  90.     typedef    CHTYPE chtype;
  91. #else
  92.     typedef unsigned long chtype;
  93. #endif /* CHTYPE */
  94.  
  95. /*
  96.     Define for the 'old' definition of chtype is required
  97.     when we are running in compatibility mode
  98. */
  99. #ifdef _VR3_COMPAT_CODE
  100. typedef unsigned short _ochtype;
  101. #endif
  102.  
  103. /* TRUE and FALSE get defined so many times, */
  104. /* let's not get in the way of other definitions. */
  105. #if    !defined(TRUE) || ((TRUE) != 1)
  106. #define    TRUE    (1)
  107. #endif
  108. #if    !defined(FALSE) || ((FALSE) != 0)
  109. #define    FALSE    (0)
  110. #endif
  111. #if    !defined(ERR) || ((ERR) != -1)
  112. #define    ERR    (-1)
  113. #endif
  114. #if    !defined(OK) || ((OK) != 0)
  115. #define    OK    (0)
  116. #endif
  117.  
  118. #define CURS_STUPID    0
  119. #define CURS_UNKNOWN    1
  120. #define CURS_BAD_MALLOC    2
  121.  
  122. /*  backwards compatibility */
  123. #define STUPID    CURS_STUPID
  124. #define UNKNOWN CURS_UNKNOWN
  125.  
  126. /*  backwards compatibility */
  127. #ifdef    PERFORMANCE
  128. #define    CURS_PERFORMANCE
  129. #endif    
  130.  
  131. /* short-hand notations */
  132. typedef struct _win_st    WINDOW;
  133. typedef struct screen    SCREEN;
  134. typedef struct _Mouse    MOUSE_STATUS;
  135.  
  136. struct _win_st
  137. {
  138.     short        _cury, _curx;    /* current coordinates */
  139.     short        _maxy, _maxx;    /* max coordinates */
  140.     short        _begy, _begx;    /* (0,0) screen coordinates */
  141.     unsigned char    _flags;
  142.     short        _yoffset;    /* actual begy is _begy+_yoffset */
  143.     bool        _clear,        /* clearok() info */
  144.             _leave,        /* leaveok() info */
  145.             _immed,        /* window in immediate mode */
  146.             _sync;        /* auto syncup of parent */
  147.     WINDOW        *_padwin;    /* "pad" area for current window */
  148. #ifdef    _VR3_COMPAT_CODE
  149.     _ochtype    **_y16;        /* MUST stay at this offset in WINDOW */
  150. #endif
  151.     short        *_firstch;    /* first change in line */
  152.     short        *_lastch;    /* last change in line */
  153.     short        _tmarg, _bmarg;    /* scrolling region bounds */
  154.                     /* MUST stay at this offset in WINDOW */
  155.     unsigned    _scroll        : 1;    /* scrollok() info */
  156.     unsigned    _use_idl    : 1;    
  157.     unsigned    _use_keypad    : 1;
  158.     unsigned    _notimeout    : 1;
  159.     unsigned    _use_idc    : 1;    
  160.     chtype        _attrs;        /* current window attributes */
  161.     chtype        _bkgd;        /* background, normally blank */
  162.     int        _delay;        /* delay period on wgetch
  163.                      * 0:  for nodelay
  164.                      * <0: for infinite delay
  165.                      * >0: delay time in units of millisec
  166.                      */
  167.     short        _ndescs;    /* number of descendants */
  168.     short        _parx, _pary;    /* coords relative to parent (0,0) */
  169.     WINDOW        *_parent;    /* the parent if this is a subwin */
  170.     chtype        **_y;            /* lines of data */
  171.     short        _nbyte;        /* number of bytes to come */
  172.     short        _index;        /* index to store coming char */
  173.     char        _waitc[CSMAX];    /* array to store partial m-width char*/
  174.     bool        _insmode;    /* TRUE for inserting, */
  175.                     /* FALSE for adding */
  176. };
  177.  
  178. /* _lastch is initially set to this, _firstch is set to win->_maxx */
  179. #define    _NOCHANGE    -1
  180. #define _INFINITY    16000    /* no line can be longer than this */
  181.  
  182. /* values for win->_flags */
  183. #define    _ISPAD        001
  184. #define    _WINCHANGED    002
  185. #define    _WINMOVED    004
  186. #define    _WINSDEL    010
  187. #define    _CANT_BE_IMMED    020
  188. #define    _WIN_ADD_ONE    040
  189. #define    _WIN_INS_ONE    100
  190.  
  191. struct _Mouse {
  192.     int x, y;
  193.     short button[3];
  194.     int   changes;
  195. };
  196.  
  197. /*
  198.  * Various tricks to shut up lint about things that are perfectly fine.
  199.  */
  200. #if    defined(lint) && !defined(CURSES) /* if not internal to curses source */
  201.  struct screen {
  202.      int _nobody_;
  203.  };
  204. #endif /* lint */
  205.  
  206. /* common external variables */
  207.  
  208.  
  209. extern    int    LINES, COLS, TABSIZE, COLORS, COLOR_PAIRS;
  210. extern    short    curs_errno;
  211. extern    WINDOW    *stdscr, *curscr;
  212. extern  MOUSE_STATUS    Mouse_status;
  213. extern    char    curs_parm_err[], *curs_err_strings[];
  214. extern    unsigned char    ttytype[];
  215.  
  216.  
  217. /* Function declarations */
  218.  
  219.  
  220. #ifdef    _VR3_COMPAT_CODE
  221.  
  222. extern    _ochtype    *acs_map;
  223. extern    chtype        *acs32map;
  224.  
  225. /* definitions for Vr3 source compatibility */
  226.  
  227. #define initscr        initscr32
  228. #define newterm        newterm32
  229. #define waddch        w32addch
  230. #define wechochar    w32echochar
  231. #define pechochar    p32echochar
  232. #define winsch        w32insch
  233. #define vidputs        vid32puts
  234. #define vidattr        vid32attr
  235. #define wattroff    w32attroff
  236. #define wattron        w32attron
  237. #define wattrset    w32attrset
  238. #define acs_map        acs32map
  239. #define box        box32
  240.  
  241. extern    WINDOW    *initscr();
  242. extern    SCREEN    *newterm();
  243.  
  244. /* declarations for mini-curses */
  245.  
  246. extern    WINDOW    *m_initscr();
  247.  
  248. extern    SCREEN    *m_newterm _PARAMS((char *, FILE *, FILE *));
  249.  
  250. extern    int    m_addch _PARAMS((int)), m_addstr _PARAMS((char *)), m_clear(), m_erase(),
  251.         m_move _PARAMS((int, int)), m_refresh();
  252.  
  253.  
  254. #else    /* _VR3_COMPAT_CODE */
  255.  
  256. extern    chtype    *acs_map;
  257.  
  258. #endif    /* _VR3_COMPAT_CODE */
  259.  
  260.  
  261.  
  262. extern    SCREEN    *newscreen _PARAMS((char *, int, int, int, FILE *, FILE *)),
  263.         *setcurscreen _PARAMS((SCREEN *));
  264.  
  265. extern    WINDOW    *initscr(),
  266.         *newwin _PARAMS((int, int, int, int)),
  267.         *newpad _PARAMS((int, int)),
  268.         *derwin _PARAMS((WINDOW *, int, int, int, int)),
  269.         *dupwin _PARAMS((WINDOW *)),
  270.         *getwin _PARAMS((FILE *));
  271.  
  272. extern    int    wgetch _PARAMS((WINDOW *)); /* because it can return KEY_*, for instance. */
  273.  
  274. extern    unsigned char    *longname(),    /* long name of terminal */
  275.         *keyname _PARAMS((int)), /* name of token returned by wgetch() */
  276.         *slk_label _PARAMS((int)),
  277.         erasechar(),
  278.         killchar(),
  279.         *unctrl _PARAMS((int));
  280.  
  281. extern    chtype    termattrs();
  282.  
  283. extern    void    vidupdate _PARAMS((int , int , int (*) (char))), wsyncup _PARAMS((WINDOW *)), wsyncdown _PARAMS((WINDOW *)),
  284.         delkeymap(), 
  285.         delscreen _PARAMS((SCREEN *)), curserr(),
  286.         _setqiflush _PARAMS((int)), 
  287.         immedok _PARAMS((WINDOW *, int)), 
  288.         wcursyncup _PARAMS((WINDOW *));
  289.  
  290. extern    int    cbreak(), nocbreak(), 
  291.         reset_prog_mode(), reset_shell_mode(), def_prog_mode(),
  292.         _setecho _PARAMS((int)), _setnonl _PARAMS((int)),
  293.         def_shell_mode(), raw(),
  294.         savetty(), traceon(), _meta _PARAMS((int)), 
  295.         traceoff(), noraw(), flushinp(), _getsyx _PARAMS((int *, int *)),
  296.         _ring _PARAMS((int)), resetty(), ripoffline _PARAMS((int, int (*) (WINDOW *, int))), setsyx _PARAMS((int, int)), slk_refresh(),
  297.         slk_restore(), wstandend(), wstandout(),
  298.         wattroff(), wattron(), wattrset(), wrefresh _PARAMS((WINDOW *));
  299.  
  300. extern    int    color_cont(), copywin _PARAMS((WINDOW *, WINDOW *, int, int, int, int, int, int, int)), curs_set _PARAMS((int)), delay_output _PARAMS((int)), delwin _PARAMS((WINDOW *)),
  301.         doupdate(), draino(), endwin(), isendwin(),
  302.         baudrate(), has_ic(), has_il(), idlok _PARAMS((WINDOW *, int)), 
  303.         init_color _PARAMS((int, int, int, int)), init_pair _PARAMS((int, int, int)), keypad _PARAMS((WINDOW *, int)), mvcur _PARAMS((int, int, int, int));
  304.  
  305. extern    int    mvprintw _PARAMS((int, int, ...)), mvscanw _PARAMS((int, int, ...)), mvwprintw _PARAMS((WINDOW *, int, int, ...)), mvwscanw _PARAMS((WINDOW *, int, int, ...)),
  306.         printw _PARAMS((char *, ...)), scanw _PARAMS((char *, ...)), wprintw _PARAMS((WINDOW *, ...)), wscanw _PARAMS((WINDOW *, ...)), vwprintw _PARAMS((WINDOW *, char *, void *)), vwscanw _PARAMS((WINDOW *, char *, void *));
  307.  
  308. extern    int    mvwin _PARAMS((WINDOW *, int, int)), mvderwin _PARAMS((WINDOW *, int, int)), napms _PARAMS((int)), newkey _PARAMS((char *, int, int)), _overlay _PARAMS((WINDOW *, WINDOW *, int)),
  309.         pair_content _PARAMS((int, short int *, short int *)), pechochar(), pnoutrefresh _PARAMS((WINDOW *, int, int, int, int, int, int)), prefresh _PARAMS((WINDOW *, int, int, int, int, int, int));
  310.  
  311. extern    void    filter();
  312.  
  313. extern     int    putwin _PARAMS((WINDOW *, FILE *)), wredrawln(), scr_dump _PARAMS((char *)), setupterm _PARAMS((char *, int, int *));
  314.  
  315. extern    int    slk_attrof(), slk_attrof(), slk_attrset _PARAMS((int )),
  316.         slk_clear(), slk_noutrefresh(), slk_set _PARAMS((int, char *, int)),
  317.         slk_start _PARAMS((int, int *)), slk_touch(), start_color(),
  318.         typeahead _PARAMS((int));
  319.  
  320. extern    bool    can_change_color(), has_colors();
  321.         
  322. extern    int    waddch(), waddchnstr _PARAMS((WINDOW *, int *, int)), waddnstr _PARAMS((WINDOW *, char *, int)), wbkgd _PARAMS((WINDOW *, int )),
  323.         wborder _PARAMS((WINDOW *, int , int , int , int , int , int , int , int )), wclrtobot _PARAMS((WINDOW *)), wclrtoeol _PARAMS((WINDOW *)), wdelch _PARAMS((WINDOW *)), wechochar(),
  324.         wgetstr _PARAMS((WINDOW *, char *)), wgetnstr _PARAMS((WINDOW *, char *, int)), whline _PARAMS((WINDOW *, int , int)), wvline _PARAMS((WINDOW *, int , int)), winchnstr _PARAMS((WINDOW *, int *, int)),
  325.         winchstr(), winnstr _PARAMS((WINDOW *, char *, int)), winsch(),
  326.         winsdelln _PARAMS((WINDOW *, int)),        /*internal */
  327.         winsnstr _PARAMS((WINDOW *, char *, int)), winstr(), wmove _PARAMS((WINDOW *, int, int)), wnoutrefresh _PARAMS((WINDOW *)), wredrawln _PARAMS((WINDOW *, int, int)),
  328.         wscrl _PARAMS((WINDOW *, int)), wsetscrreg _PARAMS((WINDOW *, int, int)), wtouchln _PARAMS((WINDOW *, int, int, int));
  329.  
  330. extern    int    crmode(), nocrmode(), ungetch _PARAMS((int));
  331.  
  332. extern    int    mouse_set _PARAMS((long int)), mouse_on _PARAMS((long int)), mouse_off _PARAMS((long int)),
  333.         request_mouse_pos(), map_button _PARAMS((long unsigned int));
  334.         
  335. extern void    wmouse_position _PARAMS((WINDOW *, int *, int *));
  336.  
  337. extern unsigned long getmouse(), getbmap();
  338.  
  339. extern chtype    winwch();
  340.  
  341. extern int    pechowchar(), ungetwch(), waddnwstr(), waddwch(),
  342.         waddwchnstr(), wechowchar(), wgetnwstr(), wgetwch(),
  343.         wgetwstr(), winnwstr(), winsnwstr(), winswch(),
  344.         winwchnstr(), winwstr();
  345.  
  346.  
  347. #define getsyx(y,x)        _getsyx(&(y),&(x))
  348.  
  349. /* 
  350.  * Functions to get at the window structure.
  351.  */
  352.  
  353. #define getyx(win,y,x)        ((y) = getcury(win), (x) = getcurx(win))
  354. #define    getbegyx(win,y,x)    ((y) = getbegy(win), (x) = getbegx(win))
  355. #define    getmaxyx(win,y,x)    ((y) = getmaxy(win), (x) = getmaxx(win))
  356. #define    getparyx(win,y,x)    ((y) = getpary(win), (x) = getparx(win))
  357.  
  358. #if    defined(CURS_PERFORMANCE) && !defined(lint)
  359. #define getcury(win)        ((win)->_cury)
  360. #define getcurx(win)        ((win)->_curx)
  361. #define    getbegy(win)        ((win)->_begy)
  362. #define    getbegx(win)        ((win)->_begx)
  363. #define    getmaxy(win)        ((win)->_maxy)
  364. #define    getmaxx(win)        ((win)->_maxx)
  365. #define    getpary(win)        ((win)->_pary)
  366. #define    getparx(win)        ((win)->_parx)
  367. #define getbkgd(win)        ((win)->_bkgd)
  368. #define getattrs(win)        ((win)->_attrs)
  369.  
  370. #else     /* defined(CURS_PERFORMANCE) && !defined(lint) */
  371.  
  372. extern    int    getcury _PARAMS((WINDOW *)), getcurx _PARAMS((WINDOW *)), getbegy _PARAMS((WINDOW *)), getbegx _PARAMS((WINDOW *)),
  373.         getmaxy _PARAMS((WINDOW *)), getmaxx _PARAMS((WINDOW *)), getpary _PARAMS((WINDOW *)), getparx _PARAMS((WINDOW *));
  374.  
  375. extern chtype    getbkgd _PARAMS((WINDOW *)), getattrs _PARAMS((WINDOW *));
  376.  
  377.  
  378. #endif    /* defined(CURS_PERFORMANCE) && !defined(lint) */
  379.  
  380. #if    defined(NOMACROS) || defined(lint)
  381.  
  382.  
  383. extern    SCREEN    *newterm(/*termname,fout,fin*/),
  384.         *set_term(/*screenptr*/);
  385.  
  386. extern    WINDOW    *subpad(),
  387.         *subwin();
  388.  
  389. extern    chtype    inch(), winch(), mvinch(), mvwinch();
  390.  
  391. extern    unsigned char    *unctrl();
  392.  
  393. extern int    addch(), addchnstr(), addchstr(), addnstr(), addstr(),
  394.         attroff(), attron(), attrset(), beep(), bkgd(),
  395.         border(), box(), clear(), clearok(), clrtobot(), clrtoeol(),
  396.         crmode(), delch(), deleteln(), echo(), echochar(),
  397.         erase(),
  398. /* MORE */    fixterm(),
  399.         flash(), garbagedlines(), garbagedwin(),
  400.         getch(), getstr(), gettmode(), halfdelay(), hline(),
  401.         inchnstr(), inchstr(), innstr(), insch(),
  402.         insdelln(), insertln(), insnstr(), insstr(), instr(),
  403.         intrflush(),
  404.         is_linetouched(), is_wintouched(), leaveok(), meta(),
  405.         move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(),
  406.         mvaddstr(), mvdelch(), mvgetch(), mvgetstr(), mvhline(),
  407.         mvinchnstr(), mvinchstr(), mvinnstr(), mvinsch(), mvinsnstr(),
  408.         mvinsstr(), mvinstr(), mvvline(), mvwaddch(), mvwaddchnstr(),
  409.         mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(),
  410.         mvwgetch(), mvwgetstr(), mvwhline(), mvwinchnstr(),
  411.         mvwinchstr(), mvwinnstr(), mvwinsch(), mvwinsnstr(),
  412.         mvwinsstr(), mvwinstr(), mvwvline(),
  413.         nl(), nocrmode(), nodelay(),
  414.         noecho(), nonl(), notimeout(),
  415.         overlay(), overwrite(), redrawwin(), refresh(),
  416.         resetterm(), saveterm(), scr_init(),
  417.         scr_restore(), scr_set(), scrl(),
  418.         scroll(), scrollok(), setscrreg(), setterm(),
  419.         slk_init(), standend(), standout(), 
  420.         syncok(), touchline(), touchwin(), untouchwin(), vline(),
  421.         waddchstr(), waddstr(), wclear(),
  422.         wdeleteln(), werase(), winchstr(), winsertln(),
  423.         winsstr(), winstr(), wstandend(), wstandout();
  424.  
  425. extern    void    bkgdset(), wbkgdset(), idcok(), noqiflush(),
  426.         qiflush(), timeout(), wtimeout(), use_env();
  427.  
  428. extern unsigned long getmouse(), getbmap();
  429.  
  430. extern chtype    inwch(), mvinwch(), mvwinwch();
  431.  
  432. extern int    addnwstr(), addwch(), addwchnstr(), addwchstr(),
  433.         addwstr(), echowchar(), getnwstr(), getwch(),
  434.         getwstr(), innwstr(), insnwstr(), inswch(),
  435.         inswstr(), inwchnstr(), inwchstr(), inwstr(),
  436.         mvaddnwstr(), mvaddwch(), mvaddwchnstr(), mvaddwchstr(),
  437.         mvaddwstr(), mvgetnwstr(), mvgetwch(), mvgetwstr(),
  438.         mvinnwstr(), mvinsnwstr(), mvinswch(), mvinswstr(),
  439.         mvinwchnstr(), mvinwchstr(), mvinwstr(), mvwaddnwstr(),
  440.         mvwaddwch(), mvwaddwchnstr(), mvwaddwchstr(), mvwaddwstr(),
  441.         mvwgetnwstr(), mvwgetwch(), mvwgetwstr(), mvwinnwstr(),
  442.         mvwinsnwstr(), mvwinswch(), mvwinswstr(), mvwinwchnstr(),
  443.         mvwinwchstr(), mvwinwstr(), waddwchstr(), waddwstr(),
  444.         winswstr(), winwchstr();
  445.  
  446.  
  447. #else    /* NOMACROS || lint */
  448.  
  449. /*
  450.  * The defines from here down to the #endif for NOMACROS
  451.  * define macros, which may be more efficient than their
  452.  * function versions. The functions may be accessed by defining
  453.  * NOMACROS in C code. This is useful for debugging purposes.
  454.  */
  455.  
  456. #include  <unctrl.h>
  457.  
  458. /* pseudo functions for stdscr */
  459. #define    addch(ch)    waddch(stdscr, ch)
  460. #define    addnstr(s,n)    waddnstr(stdscr,s,n)
  461. #define    addstr(str)    waddstr(stdscr, str)
  462. #define    attroff(at)    wattroff(stdscr,at)
  463. #define    attron(at)    wattron(stdscr,at)
  464. #define    attrset(at)    wattrset(stdscr,at)
  465. #define    bkgd(c)        wbkgd(stdscr,c)
  466. #define    border(ls, rs, ts, bs, tl, tr, bl, br)    wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)    
  467. #define    clear()        wclear(stdscr)
  468. #define    clrtobot()    wclrtobot(stdscr)
  469. #define    clrtoeol()    wclrtoeol(stdscr)
  470. #define    delch()        wdelch(stdscr)
  471. #define    deleteln()    wdeleteln(stdscr)
  472. #define    echochar(ch)    wechochar(stdscr, ch)
  473. #define    erase()        werase(stdscr)
  474. #define    getch()        wgetch(stdscr)
  475. #define    getstr(str)    wgetstr(stdscr, str)
  476. #define    inch()        winch(stdscr)
  477. #define    insch(c)    winsch(stdscr,c)
  478. #define    insdelln(id)    winsdelln(stdscr,id)
  479. #define    insertln()    winsertln(stdscr)
  480. #define    insnstr(s,n)    winsnstr(stdscr,s,n)
  481. #define    insstr(s)    winsstr(stdscr,s)
  482. #define    move(y, x)    wmove(stdscr, y, x)
  483. #define    refresh()    wrefresh(stdscr)
  484. #define    scrl(n)        wscrl(stdscr,n)
  485. #define    setscrreg(t,b)    wsetscrreg(stdscr, t, b)
  486. #define    standend()    wstandend(stdscr)
  487. #define    standout()    wstandout(stdscr)
  488. #define    timeout(tm)    wtimeout(stdscr,tm)
  489. #define    hline(c,num)    whline(stdscr,c,num)
  490. #define    vline(c,num)    wvline(stdscr,c,num)
  491. #define    addchstr(str)    waddchstr(stdscr,str)
  492. #define    addchnstr(str,n)    waddchnstr(stdscr,str,n)
  493. #define    instr(str)    winstr(stdscr,(str))
  494. #define    innstr(str,n)    winnstr(stdscr,(str),(n))
  495. #define    inchstr(str)    winchstr(stdscr,str)
  496. #define    inchnstr(str,n)    winchnstr(stdscr,str,n)
  497. #define    bkgdset(c)    wbkgdset(stdscr,c)
  498.  
  499. #define    addnwstr(ws,n)    waddnwstr(stdscr,ws,n)
  500. #define    addwch(ch)    waddwch(stdscr,ch)
  501. #define    addwchnstr(str,n)    waddwchnstr(stdscr,str,n)
  502. #define    addwchstr(str)    waddwchstr(stdscr,str)
  503. #define    addwstr(ws)    waddwstr(stdscr,ws)
  504. #define    echowchar(ch)    wechowchar(stdscr,ch)
  505. #define    getnwstr(ws,n)    wgetnwstr(stdscr,ws,n)
  506. #define    getwch()    wgetwch(stdscr)
  507. #define    getwstr(ws)    wgetwstr(stdscr, ws)
  508. #define    innwstr(ws,n)    winnwstr(stdscr,ws,n)
  509. #define    insnwstr(ws,n)    winsnwstr(stdscr,ws,n)
  510. #define    inswch(c)    winswch(stdscr,c)
  511. #define    inswstr(ws)    winswstr(stdscr,ws)
  512. #define    inwch()        winwch(stdscr)
  513. #define    inwchnstr(str,n)    winwchnstr(stdscr,str,n)
  514. #define    inwchstr(str)    winwchstr(stdscr,str)
  515. #define    inwstr(ws)    winwstr(stdscr,ws)
  516.  
  517. /* functions to define environment flags of a window */
  518. #ifdef    CURS_PERFORMANCE
  519. #define    wbkgdset(win,c)        (((win)->_attrs = (((win)->_attrs & ~((win)->_bkgd & A_ATTRIBUTES)) | (c & A_ATTRIBUTES))), ((win)->_bkgd = (c)))
  520. #define syncok(win,bf)        ((win)->_parent?(win)->_sync=(bf):ERR)
  521. #define    notimeout(win,bf)    (((win)->_notimeout = ((bf) ? TRUE : FALSE)),OK)
  522. #define    clearok(win,bf)        (((win)->_clear = (bf)), OK)
  523. #define    leaveok(win,bf)        (((win)->_leave = (bf)), OK)
  524. #define    scrollok(win,bf)    (((win)->_scroll = ((bf) ? TRUE : FALSE)), OK)
  525. #define    idcok(win,bf)        ((win)->_use_idc = ((bf) ? TRUE : FALSE))
  526. #define    nodelay(win,bf)        (((win)->_delay = (bf) ? 0 : -1), OK)
  527. #define is_wintouched(win)    ((win)->_flags & _WINCHANGED)
  528. #define is_linetouched(win,line)    ((((line) >= (win)->_maxy) || \
  529.                      ((line) < 0)) ? ERR : \
  530.                     (((win)->_firstch[(line)] == _INFINITY) ? \
  531.                                   FALSE : TRUE))
  532.  
  533. #define subwin(win,nl,nc,by,bx)    derwin((win),(nl),(nc),(by-win->_begy),(bx-win->_begx))
  534. #define touchwin(win)        wtouchln((win),0,(win)->_maxy,TRUE)
  535. #define redrawwin(win)        wredrawln((win),0,(win)->_maxy)
  536. #define    winchstr(win,str)    winchnstr((win),str,((win)->_maxx - (win)->_curx))
  537. #define    winstr(win,str)        winnstr((win),str,((win)->_maxx - (win)->_curx))
  538. #define untouchwin(win)        wtouchln((win),0,((win)->_maxy),FALSE)
  539. #define    winch(win)        ((win)->_y[(win)->_cury][(win)->_curx])
  540.  
  541. #define wtimeout(win,tm)    ((win)->_delay = (tm))
  542. #define use_env(bf)        (_use_env = (bf))
  543.  
  544. #else    /* CURS_PERFORMANCE */
  545.  
  546.  
  547.  
  548. extern    void    wbkgdset _PARAMS((WINDOW *, int )), idcok _PARAMS((WINDOW *, int)), wtimeout _PARAMS((WINDOW *, int)), use_env _PARAMS((int));
  549.  
  550. extern    int    syncok _PARAMS((WINDOW *, int)), notimeout _PARAMS((WINDOW *, int)), clearok _PARAMS((WINDOW *, int)), leaveok _PARAMS((WINDOW *, int)),
  551.         scrollok _PARAMS((WINDOW *, int)), nodelay _PARAMS((WINDOW *, int)), is_linetouched _PARAMS((WINDOW *, int)), is_wintouched _PARAMS((WINDOW *)),
  552.         touchwin _PARAMS((WINDOW *)), redrawwin _PARAMS((WINDOW *)), winchstr _PARAMS((WINDOW *, int *)), winstr _PARAMS((WINDOW *, char *)),
  553.         untouchwin _PARAMS((WINDOW *)); 
  554.  
  555. extern  chtype  winch _PARAMS((WINDOW *));
  556.  
  557. extern    WINDOW    *subwin _PARAMS((WINDOW *, int, int, int, int));
  558.  
  559.  
  560.  
  561. #endif    /* CURS_PERFORMANCE */
  562.  
  563. /* functions for move and update */
  564. #define    mvaddch(y,x,ch)        mvwaddch(stdscr,y,x,ch)
  565. #define    mvaddnstr(y,x,s,n)    mvwaddnstr(stdscr,y,x,s,n)
  566. #define    mvaddstr(y,x,str)    mvwaddstr(stdscr,y,x,str)
  567. #define    mvdelch(y,x)        mvwdelch(stdscr,y,x)
  568. #define    mvgetch(y,x)        mvwgetch(stdscr,y,x)
  569. #define    mvgetstr(y,x,str)    mvwgetstr(stdscr,y,x,str)
  570. #define    mvinch(y,x)        mvwinch(stdscr,y,x)
  571. #define    mvinsch(y,x,c)        mvwinsch(stdscr,y,x,c)
  572. #define    mvinsnstr(y,x,s,n)    mvwinsnstr(stdscr,y,x,s,n)
  573. #define    mvinsstr(y,x,s)        mvwinsstr(stdscr,y,x,s)
  574. #define    mvaddchstr(y,x,str)    mvwaddchstr(stdscr,y,x,str)
  575. #define    mvaddchnstr(y,x,str,n)    mvwaddchnstr(stdscr,y,x,str,n)
  576. #define    mvinstr(y,x,str)    mvwinstr(stdscr,y,x,(str))
  577. #define    mvinnstr(y,x,str,n)    mvwinnstr(stdscr,y,x,(str),(n))
  578. #define    mvinchstr(y,x,str)    mvwinchstr(stdscr,y,x,str)
  579. #define    mvinchnstr(y,x,str,n)    mvwinchnstr(stdscr,y,x,str,n)
  580. #define    mvhline(y,x,c,num)    mvwhline(stdscr,y,x,c,num)
  581. #define    mvvline(y,x,c,num)    mvwvline(stdscr,y,x,c,num)
  582.  
  583. #define    mvaddnwstr(y,x,ws,n)    mvwaddnwstr(stdscr,y,x,ws,n)
  584. #define    mvaddwch(y,x,ch)    mvwaddwch(stdscr,y,x,ch)
  585. #define    mvaddwchnstr(y,x,str,n)    mvwaddwchnstr(stdscr,y,x,str,n)
  586. #define    mvaddwchstr(y,x,str)    mvwaddwchstr(stdscr,y,x,str)
  587. #define    mvaddwstr(y,x,ws)    mvwaddwstr(stdscr,y,x,ws)
  588. #define    mvgetnwstr(y,x,ws,n)    mvwgetnwstr(stdscr,y,x,ws,n)
  589. #define    mvgetwch(y,x)        mvwgetwch(stdscr,y,x)
  590. #define    mvgetwstr(y,x,ws)    mvwgetwstr(stdscr,y,x,ws)
  591. #define    mvinnwstr(y,x,ws,n)    mvwinnwstr(stdscr,y,x,ws,n)
  592. #define    mvinsnwstr(y,x,ws,n)    mvwinsnwstr(stdscr,y,x,ws,n)
  593. #define    mvinswch(y,x,c)        mvwinswch(stdscr,y,x,c)
  594. #define    mvinswstr(y,x,ws)    mvwinswstr(stdscr,y,x,ws)
  595. #define    mvinwch(y,x)        mvwinwch(stdscr,y,x)
  596. #define    mvinwchnstr(y,x,str,n)    mvwinwchnstr(stdscr,y,x,str,n)
  597. #define    mvinwchstr(y,x,str)    mvwinwchstr(stdscr,y,x,str)
  598. #define    mvinwstr(y,x,ws)    mvwinwstr(stdscr,y,x,ws)
  599.  
  600. #define    mvwaddch(win,y,x,ch)    (wmove(win,y,x)==ERR?ERR:waddch(win,ch))
  601. #define    mvwaddnstr(win,y,x,s,n)    (wmove(win,y,x)==ERR?ERR:waddnstr(win,s,n))
  602. #define    mvwaddstr(win,y,x,str)    (wmove(win,y,x)==ERR?ERR:waddstr(win,str))
  603. #define    mvwdelch(win,y,x)    (wmove(win,y,x)==ERR?ERR:wdelch(win))
  604. #define    mvwgetch(win,y,x)    (wmove(win,y,x)==ERR?ERR:wgetch(win))
  605. #define    mvwgetstr(win,y,x,str)    (wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
  606. #define    mvwinch(win,y,x)    (wmove(win,y,x)==ERR?(chtype) ERR:winch(win))
  607. #define    mvwinsch(win,y,x,c)    (wmove(win,y,x)==ERR?ERR:winsch(win,c))
  608. #define    mvwinsnstr(win,y,x,s,n)    (wmove(win,y,x)==ERR?ERR:winsnstr(win,s,n))
  609. #define    mvwinsstr(win,y,x,s)    (wmove(win,y,x)==ERR?ERR:winsstr(win,s))
  610. #define    mvwhline(win,y,x,c,num)    (wmove(win,y,x)==ERR?ERR:whline(win,c,num))
  611. #define    mvwvline(win,y,x,c,num)    (wmove(win,y,x)==ERR?ERR:wvline(win,c,num))
  612. #define    mvwaddchstr(win,y,x,str)    (wmove(win,y,x)==ERR?ERR:waddchstr(win,str))
  613. #define    mvwaddchnstr(win,y,x,str,n)    (wmove(win,y,x)==ERR?ERR:waddchnstr(win,str,n))
  614. #define    mvwinstr(win,y,x,str)    (wmove(win,y,x)==ERR?ERR:winstr(win,str))
  615. #define    mvwinnstr(win,y,x,str,n)    (wmove(win,y,x)==ERR?ERR:winnstr(win,str,n))
  616. #define    mvwinchstr(win,y,x,str)    (wmove(win,y,x)==ERR?ERR:winchstr(win,str))
  617. #define    mvwinchnstr(win,y,x,str,n)    (wmove(win,y,x)==ERR?ERR:winchnstr(win,str,n))
  618.  
  619. #define    mvwaddnwstr(win,y,x,ws,n) (wmove(win,y,x)==ERR?ERR:waddnwstr(win,ws,n))
  620. #define    mvwaddwch(win,y,x,ch)    (wmove(win,y,x)==ERR?ERR:waddwch(win,ch))
  621. #define    mvwaddwchnstr(win,y,x,str,n) (wmove(win,y,x)==ERR?ERR:waddwchnstr(win,str,n))
  622. #define    mvwaddwchstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:waddwchstr(win,str))
  623. #define    mvwaddwstr(win,y,x,ws)    (wmove(win,y,x)==ERR?ERR:waddwstr(win,ws))
  624. #define    mvwgetnwstr(win,y,x,ws,n) (wmove(win,y,x)==ERR?ERR:wgetnwstr(win,ws,n))
  625. #define    mvwgetwch(win,y,x)    (wmove(win,y,x)==ERR?ERR:wgetwch(win))
  626. #define    mvwgetwstr(win,y,x,ws)    (wmove(win,y,x)==ERR?ERR:wgetwstr(win,ws))
  627. #define    mvwinnwstr(win,y,x,ws,n) (wmove(win,y,x)==ERR?ERR:winnwstr(win,ws,n))
  628. #define    mvwinsnwstr(win,y,x,ws,n) (wmove(win,y,x)==ERR?ERR:winsnwstr(win,ws,n))
  629. #define    mvwinswch(win,y,x,c)    (wmove(win,y,x)==ERR?ERR:winswch(win,c))
  630. #define    mvwinswstr(win,y,x,ws)    (wmove(win,y,x)==ERR?ERR:winswstr(win,ws))
  631. #define    mvwinwch(win,y,x)    (wmove(win,y,x)==ERR?(chtype)ERR:winwch(win))
  632. #define    mvwinwchnstr(win,y,x,str,n) (wmove(win,y,x)==ERR?ERR:winwchnstr(win,str,n))
  633. #define    mvwinwchstr(win,y,x,str) (wmove(win,y,x)==ERR?ERR:winwchstr(win,str))
  634. #define    mvwinwstr(win,y,x,ws)    (wmove(win,y,x)==ERR?ERR:winwstr(win,ws))
  635.  
  636. #define    waddwchstr(win,str)    waddwchnstr(win,str,-1)
  637. #define    winwchstr(win,str)    winwchnstr(win,str,-1)
  638. #define waddwstr(win,ws)    waddnwstr(win,ws,-1)
  639. #define winswstr(win,ws)    winsnwstr(win,ws,-1)
  640.  
  641. #ifdef CURS_MACROS
  642. #define overlay(src,dst)    _overlap((src),(dst),TRUE)
  643. #define overwrite(src,dst)    _overlap((src),(dst),FALSE)
  644. #define wdeleteln(win)        winsdelln((win),-1)
  645. #define winsertln(win)        winsdelln((win),1)
  646. #define wstandend(win)        wattrset((win),A_NORMAL)
  647. #define wstandout(win)        wattron((win),A_STANDOUT)
  648. #define beep()            _ring(TRUE)
  649. #define flash()            _ring(FALSE)
  650. #define scroll(win)        wscrl((win),1)
  651. #define slk_init(f)        slk_start(((f == 0) ? 3 : 2),NULL)
  652. #define    scr_init(file)        _scr_all(file,0)
  653. #define    scr_restore(file)    _scr_all(file,1)
  654. #define    scr_set(file)        _scr_all(file,2)
  655. #define subpad(win,nl,nc,by,bx)    derwin((win),(nl),(nc),(by),(bx))
  656. #define box(win,v,h)        wborder((win),(v),(v),(h),(h),0,0,0,0)
  657. #define newterm(type,fout,fin)    newscreen((type),0,0,0,(fout),(fin))
  658. #define touchline(win,y,n)    wtouchln((win),(y),(n),TRUE)
  659.  
  660. #define waddstr(win,str)    waddnstr((win),(str),-1)
  661. #define werase(win)        (wmove((win),0,0), wclrtobot(win))
  662. #define wclear(win)        (clearok((win),TRUE), werase(win))
  663. #define intrflush(win,flag)    _setqiflush(flag)
  664. #define meta(win,flag)        _meta(flag)
  665.  
  666. #define setterm(name)        setupterm((name),1,(unsigned char*)NULL)
  667. #define gettmode()        (OK)
  668. #define halfdelay(tens)        ttimeout((tens)*100)
  669.  
  670. #define echo()            _setecho(TRUE)
  671. #define noecho()        _setecho(FALSE)
  672. #define nl()            _setnonl(FALSE)
  673. #define nonl()            _setnonl(TRUE)
  674.  
  675. #else /* CURS_MACROS */
  676.  
  677.  
  678. extern    int    overlay _PARAMS((WINDOW *, WINDOW *)), overwrite _PARAMS((WINDOW *, WINDOW *)), wdeleteln _PARAMS((WINDOW *)), winsertln _PARAMS((WINDOW *)),
  679.         wstandend _PARAMS((WINDOW *)), wstandout _PARAMS((WINDOW *)), beep(), flash(),
  680.         scroll _PARAMS((WINDOW *)), slk_init _PARAMS((int)), scr_init _PARAMS((char *)), scr_restore _PARAMS((char *)), scr_set(),
  681.         box(), touchline _PARAMS((WINDOW *, int, int)), waddstr _PARAMS((WINDOW *, char *)), werase _PARAMS((WINDOW *)),
  682.         wclear _PARAMS((WINDOW *)), intrflush _PARAMS((WINDOW *, int)), meta _PARAMS((WINDOW *, int)), setterm _PARAMS((char *)), gettmode(),
  683.         halfdelay _PARAMS((int)), echo(), noecho(), nl(), nonl();
  684.  
  685. extern    WINDOW *subpad _PARAMS((WINDOW *, int, int, int, int));
  686.  
  687. extern  SCREEN  *newterm();
  688.  
  689.  
  690. #endif /* CURS_MACROS */
  691.  
  692. #define garbagedlines        wredrawln
  693. #define garbagedwin        redrawwin
  694.  
  695. #define crmode            cbreak
  696. #define nocrmode        nocbreak
  697. #define saveterm        def_prog_mode
  698. #define fixterm            reset_prog_mode
  699. #define resetterm        reset_shell_mode
  700.  
  701. #define    waddchstr(win,str)    waddchnstr((win),(str),-1)
  702. #define winsstr(win,str)    winsnstr((win),(str),-1)
  703.  
  704. /* iocontrol functions */
  705. #define qiflush()        _setqiflush(TRUE)
  706. #define noqiflush()        _setqiflush(FALSE)
  707.  
  708. #define set_term        setcurscreen
  709.  
  710. #endif    /* NOMACROS || lint */
  711.  
  712. /*
  713.  * Standard alternate character set.  The current ACS world is evolving,
  714.  * so we support only a widely available subset: the line drawing characters
  715.  * from the VT100, plus a few from the Teletype 5410v1.  Eventually there
  716.  * may be support of more sophisticated ACS line drawing, such as that
  717.  * in the Teletype 5410, the HP line drawing set, and the like.  There may
  718.  * be support for some non line oriented characters as well.
  719.  *
  720.  * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
  721.  * is the right, b is the bottom, and l is the left.  t, r, b, and l might
  722.  * be B (blank), S (single), D (double), or T (thick).  The subset defined
  723.  * here only uses B and S.
  724.  */
  725.  
  726. #define ACS_BSSB    (acs_map['l'])
  727. #define ACS_SSBB    (acs_map['m'])
  728. #define ACS_BBSS    (acs_map['k'])
  729. #define ACS_SBBS    (acs_map['j'])
  730. #define ACS_SBSS    (acs_map['u'])
  731. #define ACS_SSSB    (acs_map['t'])
  732. #define ACS_SSBS    (acs_map['v'])
  733. #define ACS_BSSS    (acs_map['w'])
  734. #define ACS_BSBS    (acs_map['q'])
  735. #define ACS_SBSB    (acs_map['x'])
  736. #define ACS_SSSS    (acs_map['n'])
  737.  
  738. /*
  739.  * Human readable names for the most commonly used characters.
  740.  * "Upper", "right", etc. are chosen to be consistent with the vt100 manual.
  741.  */
  742.  
  743. #define ACS_ULCORNER    ACS_BSSB
  744. #define ACS_LLCORNER    ACS_SSBB
  745. #define ACS_URCORNER    ACS_BBSS
  746. #define ACS_LRCORNER    ACS_SBBS
  747. #define ACS_RTEE    ACS_SBSS
  748. #define ACS_LTEE    ACS_SSSB
  749. #define ACS_BTEE    ACS_SSBS
  750. #define ACS_TTEE    ACS_BSSS
  751. #define ACS_HLINE    ACS_BSBS
  752. #define ACS_VLINE    ACS_SBSB
  753. #define ACS_PLUS    ACS_SSSS
  754. #define ACS_S1        (acs_map['o'])    /* scan line 1 */
  755. #define ACS_S9        (acs_map['s'])    /* scan line 9 */
  756. #define ACS_DIAMOND    (acs_map['`'])    /* diamond */
  757. #define ACS_CKBOARD    (acs_map['a'])    /* checker board (stipple) */
  758. #define ACS_DEGREE    (acs_map['f'])    /* degree symbol */
  759. #define ACS_PLMINUS    (acs_map['g'])    /* plus/minus */
  760. #define ACS_BULLET    (acs_map['~'])    /* bullet */
  761.     /* Teletype 5410v1 symbols */
  762. #define ACS_LARROW    (acs_map[','])    /* arrow pointing left */
  763. #define ACS_RARROW    (acs_map['+'])    /* arrow pointing right */
  764. #define ACS_DARROW    (acs_map['.'])    /* arrow pointing down */
  765. #define ACS_UARROW    (acs_map['-'])    /* arrow pointing up */
  766. #define ACS_BOARD    (acs_map['h'])    /* board of squares */
  767. #define ACS_LANTERN    (acs_map['i'])    /* lantern symbol */
  768. #define ACS_BLOCK    (acs_map['0'])    /* solid square block */
  769.  
  770. /* Funny "characters" enabled for various special function keys for input */
  771. /* This list is created from caps and curses.ed. Do not edit it! */
  772. #define KEY_MIN        0401        /* Minimum curses key */
  773. #define KEY_BREAK    0401        /* break key (unreliable) */
  774. #define KEY_DOWN    0402        /* Sent by terminal down arrow key */
  775. #define KEY_UP        0403        /* Sent by terminal up arrow key */
  776. #define KEY_LEFT    0404        /* Sent by terminal left arrow key */
  777. #define KEY_RIGHT    0405        /* Sent by terminal right arrow key */
  778. #define KEY_HOME    0406        /* Sent by home key. */
  779. #define KEY_BACKSPACE    0407        /* Sent by backspace key */
  780. #define KEY_F0        0410        /* function key f0. */
  781. #define KEY_F(n)    (KEY_F0+(n))    /* Space for 64 function keys is reserved. */
  782. #define KEY_DL        0510        /* Sent by delete line key. */
  783. #define KEY_IL        0511        /* Sent by insert line. */
  784. #define KEY_DC        0512        /* Sent by delete character key. */
  785. #define KEY_IC        0513        /* Sent by ins char/enter ins mode key. */
  786. #define KEY_EIC        0514        /* Sent by rmir or smir in insert mode. */
  787. #define KEY_CLEAR    0515        /* Sent by clear screen or erase key. */
  788. #define KEY_EOS        0516        /* Sent by clear-to-end-of-screen key. */
  789. #define KEY_EOL        0517        /* Sent by clear-to-end-of-line key. */
  790. #define KEY_SF        0520        /* Sent by scroll-forward/down key */
  791. #define KEY_SR        0521        /* Sent by scroll-backward/up key */
  792. #define KEY_NPAGE    0522        /* Sent by next-page key */
  793. #define KEY_PPAGE    0523        /* Sent by previous-page key */
  794. #define KEY_STAB    0524        /* Sent by set-tab key */
  795. #define KEY_CTAB    0525        /* Sent by clear-tab key */
  796. #define KEY_CATAB    0526        /* Sent by clear-all-tabs key. */
  797. #define KEY_ENTER    0527        /* Enter/send (unreliable) */
  798. #define KEY_SRESET    0530        /* soft (partial) reset (unreliable) */
  799. #define KEY_RESET    0531        /* reset or hard reset (unreliable) */
  800. #define KEY_PRINT    0532        /* print or copy */
  801. #define KEY_LL        0533        /* Sent by home-down key */
  802.                     /* The keypad is arranged like this: */
  803.                     /*    a1    up    a3   */
  804.                     /*   left   b2  right  */
  805.                     /*    c1   down   c3   */
  806. #define KEY_A1        0534        /* Upper left of keypad */
  807. #define KEY_A3        0535        /* Upper right of keypad */
  808. #define KEY_B2        0536        /* Center of keypad */
  809. #define KEY_C1        0537        /* Lower left of keypad */
  810. #define KEY_C3        0540        /* Lower right of keypad */
  811. #define KEY_BTAB    0541        /* Back tab key */
  812. #define KEY_BEG        0542        /* beg(inning) key */
  813. #define KEY_CANCEL    0543        /* cancel key */
  814. #define KEY_CLOSE    0544        /* close key */
  815. #define KEY_COMMAND    0545        /* cmd (command) key */
  816. #define KEY_COPY    0546        /* copy key */
  817. #define KEY_CREATE    0547        /* create key */
  818. #define KEY_END        0550        /* end key */
  819. #define KEY_EXIT    0551        /* exit key */
  820. #define KEY_FIND    0552        /* find key */
  821. #define KEY_HELP    0553        /* help key */
  822. #define KEY_MARK    0554        /* mark key */
  823. #define KEY_MESSAGE    0555        /* message key */
  824. #define KEY_MOVE    0556        /* move key */
  825. #define KEY_NEXT    0557        /* next object key */
  826. #define KEY_OPEN    0560        /* open key */
  827. #define KEY_OPTIONS    0561        /* options key */
  828. #define KEY_PREVIOUS    0562        /* previous object key */
  829. #define KEY_REDO    0563        /* redo key */
  830. #define KEY_REFERENCE    0564        /* ref(erence) key */
  831. #define KEY_REFRESH    0565        /* refresh key */
  832. #define KEY_REPLACE    0566        /* replace key */
  833. #define KEY_RESTART    0567        /* restart key */
  834. #define KEY_RESUME    0570        /* resume key */
  835. #define KEY_SAVE    0571        /* save key */
  836. #define KEY_SBEG    0572        /* shifted beginning key */
  837. #define KEY_SCANCEL    0573        /* shifted cancel key */
  838. #define KEY_SCOMMAND    0574        /* shifted command key */
  839. #define KEY_SCOPY    0575        /* shifted copy key */
  840. #define KEY_SCREATE    0576        /* shifted create key */
  841. #define KEY_SDC        0577        /* shifted delete char key */
  842. #define KEY_SDL        0600        /* shifted delete line key */
  843. #define KEY_SELECT    0601        /* select key */
  844. #define KEY_SEND    0602        /* shifted end key */
  845. #define KEY_SEOL    0603        /* shifted clear line key */
  846. #define KEY_SEXIT    0604        /* shifted exit key */
  847. #define KEY_SFIND    0605        /* shifted find key */
  848. #define KEY_SHELP    0606        /* shifted help key */
  849. #define KEY_SHOME    0607        /* shifted home key */
  850. #define KEY_SIC        0610        /* shifted input key */
  851. #define KEY_SLEFT    0611        /* shifted left arrow key */
  852. #define KEY_SMESSAGE    0612        /* shifted message key */
  853. #define KEY_SMOVE    0613        /* shifted move key */
  854. #define KEY_SNEXT    0614        /* shifted next key */
  855. #define KEY_SOPTIONS    0615        /* shifted options key */
  856. #define KEY_SPREVIOUS    0616        /* shifted prev key */
  857. #define KEY_SPRINT    0617        /* shifted print key */
  858. #define KEY_SREDO    0620        /* shifted redo key */
  859. #define KEY_SREPLACE    0621        /* shifted replace key */
  860. #define KEY_SRIGHT    0622        /* shifted right arrow */
  861. #define KEY_SRSUME    0623        /* shifted resume key */
  862. #define KEY_SSAVE    0624        /* shifted save key */
  863. #define KEY_SSUSPEND    0625        /* shifted suspend key */
  864. #define KEY_SUNDO    0626        /* shifted undo key */
  865. #define KEY_SUSPEND    0627        /* suspend key */
  866. #define KEY_UNDO    0630        /* undo key */
  867. #define KEY_MOUSE    0631        /* Mouse event has occured */
  868. #define KEY_MAX        0777        /* Maximum curses key */
  869.  
  870. /*
  871.     The definition for 'reg' is not standard, and is provided for
  872.     compatibility reasons. User's are discouraged from using this.
  873. */
  874. #define    reg    register
  875.  
  876. /* Various video attributes */
  877. #define A_STANDOUT    000000200000L
  878. #define    _STANDOUT    A_STANDOUT    /* for compatability with old curses */
  879. #define A_UNDERLINE    000000400000L
  880. #define A_REVERSE    000001000000L
  881. #define A_BLINK        000002000000L
  882. #define A_DIM        000004000000L
  883. #define A_BOLD        000010000000L
  884. #define A_ALTCHARSET    000100000000L
  885.  
  886. /* The next two are subject to change so don't depend on them */
  887. #define A_INVIS        000020000000L
  888. #define A_PROTECT    000040000000L
  889.  
  890. #define A_NORMAL    000000000000L
  891. #define A_ATTRIBUTES    037777600000L    /* 0xFFFF0000 */
  892. #define A_CHARTEXT    000000177777L    /* 0x0000FFFF */
  893. #define A_COLOR        017600000000L
  894.  
  895. #define COLOR_PAIR(n)    ((n) << 25)
  896. #define PAIR_NUMBER(n)    (((n) & A_COLOR) >> 25)
  897.  
  898. /*
  899.  * The ansi console driver uses the ISO color mapping scheme.  However,
  900.  * other mappings may be desired.  We define 2 possible mappings here.
  901.  */
  902.  
  903. #define    IBM_BLACK    0
  904. #define    IBM_BLUE    1
  905. #define    IBM_GREEN    2
  906. #define    IBM_CYAN    3
  907. #define    IBM_RED     4
  908. #define    IBM_MAGENTA    5
  909. #define    IBM_YELLOW    6
  910. #define    IBM_WHITE    7
  911.  
  912. #define    ISO_BLACK    0
  913. #define    ISO_RED     1
  914. #define    ISO_GREEN    2
  915. #define    ISO_YELLOW    3
  916. #define    ISO_BLUE    4
  917. #define    ISO_MAGENTA    5
  918. #define    ISO_CYAN    6
  919. #define    ISO_WHITE    7
  920.  
  921. #define    COLOR_BLACK    ISO_BLACK
  922. #define    COLOR_RED    ISO_RED
  923. #define    COLOR_GREEN    ISO_GREEN
  924. #define    COLOR_YELLOW    ISO_YELLOW
  925. #define    COLOR_BLUE    ISO_BLUE
  926. #define    COLOR_MAGENTA    ISO_MAGENTA
  927. #define    COLOR_CYAN    ISO_CYAN
  928. #define    COLOR_WHITE    ISO_WHITE
  929.  
  930. /* mouse related macros: don't change these definitions or bit-masks. */
  931. /* they are interdependent (used by _map_button() in tgetch()          */
  932. #define BUTTON_RELEASED            0
  933. #define BUTTON_PRESSED             1
  934. #define BUTTON_CLICKED             2
  935. #define BUTTON_DOUBLE_CLICKED      3
  936. #define BUTTON_TRIPLE_CLICKED      4
  937.  
  938. #define MOUSE_X_POS                (Mouse_status.x)
  939. #define MOUSE_Y_POS                (Mouse_status.y)
  940. #define A_BUTTON_CHANGED           (Mouse_status.changes & 7)
  941. #define MOUSE_MOVED                (Mouse_status.changes & 8)
  942. #define MOUSE_POS_REPORT       (Mouse_status.changes & 16)
  943. #define BUTTON_CHANGED(x)          (Mouse_status.changes & (1 << ((x) - 1)))
  944. #define BUTTON_STATUS(x)           (Mouse_status.button[(x)-1])
  945.  
  946. /* definition of mouse bit-masks    */
  947. #define    BUTTON1_RELEASED    000000000001L
  948. #define    BUTTON1_PRESSED        000000000002L
  949. #define    BUTTON1_CLICKED        000000000004L
  950. #define    BUTTON1_DOUBLE_CLICKED    000000000010L
  951. #define    BUTTON1_TRIPLE_CLICKED    000000000020L
  952. #define    BUTTON2_RELEASED    000000000040L
  953. #define    BUTTON2_PRESSED        000000000100L
  954. #define    BUTTON2_CLICKED        000000000200L
  955. #define    BUTTON2_DOUBLE_CLICKED    000000000400L
  956. #define    BUTTON2_TRIPLE_CLICKED    000000001000L
  957. #define    BUTTON3_RELEASED    000000002000L
  958. #define    BUTTON3_PRESSED        000000004000L
  959. #define    BUTTON3_CLICKED        000000010000L
  960. #define    BUTTON3_DOUBLE_CLICKED    000000020000L
  961. #define    BUTTON3_TRIPLE_CLICKED    000000040000L
  962. #define ALL_MOUSE_EVENTS    000000077777L
  963. #define REPORT_MOUSE_POSITION    000000100000L
  964.  
  965. #pragma pack()
  966.  
  967. #endif /* _TINFO_H */
  968.