[BACK]Return to curses.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcurses

Annotation of src/lib/libcurses/curses.h, Revision 1.87

1.87    ! christos    1: /*     $NetBSD: curses.h,v 1.86 2004/03/28 08:58:37 jdc Exp $  */
1.18      mikel       2:
1.1       cgd         3: /*
1.13      cgd         4:  * Copyright (c) 1981, 1993, 1994
1.7       cgd         5:  *     The Regents of the University of California.  All rights reserved.
1.1       cgd         6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
1.78      agc        15:  * 3. Neither the name of the University nor the names of its contributors
1.1       cgd        16:  *    may be used to endorse or promote products derived from this software
                     17:  *    without specific prior written permission.
                     18:  *
                     19:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29:  * SUCH DAMAGE.
                     30:  *
1.21      perry      31:  *     @(#)curses.h    8.5 (Berkeley) 4/29/95
1.1       cgd        32:  */
                     33:
1.4       mycroft    34: #ifndef _CURSES_H_
                     35: #define        _CURSES_H_
1.1       cgd        36:
1.22      mrg        37: #include <sys/types.h>
                     38: #include <sys/cdefs.h>
1.30      blymn      39: #include <wchar.h>
1.22      mrg        40:
1.4       mycroft    41: #include <stdio.h>
1.20      lukem      42: #include <termcap.h>
1.1       cgd        43:
1.4       mycroft    44: /*
1.31      jdc        45:  * attr_t must be the same size as wchar_t (see <wchar.h>) to avoid padding
                     46:  * in __LDATA.
1.4       mycroft    47:  */
1.30      blymn      48: typedef wchar_t        chtype;
                     49: typedef wchar_t        attr_t;
1.44      jdc        50:
                     51: /* C++ already defines bool. */
                     52: #ifndef __cplusplus
1.30      blymn      53: typedef        char    bool;
1.44      jdc        54: #endif
1.1       cgd        55:
1.4       mycroft    56: #ifndef TRUE
1.22      mrg        57: #define        TRUE    (/*CONSTCOND*/1)
1.4       mycroft    58: #endif
                     59: #ifndef FALSE
1.22      mrg        60: #define        FALSE   (/*CONSTCOND*/0)
1.4       mycroft    61: #endif
1.1       cgd        62:
1.30      blymn      63: #ifndef _CURSES_PRIVATE
                     64:
1.64      blymn      65: #define _puts(s)        tputs(s, 0, __cputchar)
                     66: #define _putchar(c)     __cputchar(c)
1.1       cgd        67:
1.4       mycroft    68: /* Old-style terminal modes access. */
1.64      blymn      69: #define crmode()        cbreak()
                     70: #define nocrmode()      nocbreak()
                     71: #define ospeed          baudrate()
1.4       mycroft    72: #endif /* _CURSES_PRIVATE */
1.50      jdc        73:
1.7       cgd        74:
1.22      mrg        75: /* symbols for values returned by getch in keypad mode */
                     76: #define    KEY_MIN        0x101    /* minimum extended key value */
                     77: #define    KEY_BREAK      0x101    /* break key */
                     78: #define    KEY_DOWN       0x102    /* down arrow */
                     79: #define    KEY_UP         0x103    /* up arrow */
                     80: #define    KEY_LEFT       0x104    /* left arrow */
                     81: #define    KEY_RIGHT      0x105    /* right arrow*/
                     82: #define    KEY_HOME       0x106    /* home key */
                     83: #define    KEY_BACKSPACE  0x107    /* Backspace */
                     84:
                     85: /* First function key (block of 64 follow) */
1.24      simonb     86: #define    KEY_F0         0x108
1.22      mrg        87: /* Function defining other function key values*/
1.24      simonb     88: #define    KEY_F(n)       (KEY_F0+(n))
1.22      mrg        89:
                     90: #define    KEY_DL         0x148    /* Delete Line */
                     91: #define    KEY_IL         0x149    /* Insert Line*/
                     92: #define    KEY_DC         0x14A    /* Delete Character */
                     93: #define    KEY_IC         0x14B    /* Insert Character */
                     94: #define    KEY_EIC        0x14C    /* Exit Insert Char mode */
                     95: #define    KEY_CLEAR      0x14D    /* Clear screen */
                     96: #define    KEY_EOS        0x14E    /* Clear to end of screen */
                     97: #define    KEY_EOL        0x14F    /* Clear to end of line */
                     98: #define    KEY_SF         0x150    /* Scroll one line forward */
                     99: #define    KEY_SR         0x151    /* Scroll one line back */
                    100: #define    KEY_NPAGE      0x152    /* Next Page */
                    101: #define    KEY_PPAGE      0x153    /* Prev Page */
                    102: #define    KEY_STAB       0x154    /* Set Tab */
                    103: #define    KEY_CTAB       0x155    /* Clear Tab */
                    104: #define    KEY_CATAB      0x156    /* Clear All Tabs */
                    105: #define    KEY_ENTER      0x157    /* Enter or Send */
                    106: #define    KEY_SRESET     0x158    /* Soft Reset */
                    107: #define    KEY_RESET      0x159    /* Hard Reset */
                    108: #define    KEY_PRINT      0x15A    /* Print */
                    109: #define    KEY_LL         0x15B    /* Home Down */
                    110:
                    111: /*
                    112:  * "Keypad" keys arranged like this:
                    113:  *
                    114:  *  A1   up  A3
                    115:  * left  B2 right
                    116:  *  C1  down C3
                    117:  *
                    118:  */
                    119: #define    KEY_A1         0x15C    /* Keypad upper left */
                    120: #define    KEY_A3         0x15D    /* Keypad upper right */
                    121: #define    KEY_B2         0x15E    /* Keypad centre key */
                    122: #define    KEY_C1         0x15F    /* Keypad lower left */
                    123: #define    KEY_C3         0x160    /* Keypad lower right */
                    124:
                    125: #define    KEY_BTAB       0x161    /* Back Tab */
                    126: #define    KEY_BEG        0x162    /* Begin key */
                    127: #define    KEY_CANCEL     0x163    /* Cancel key */
                    128: #define    KEY_CLOSE      0x164    /* Close Key */
                    129: #define    KEY_COMMAND    0x165    /* Command Key */
                    130: #define    KEY_COPY       0x166    /* Copy key */
                    131: #define    KEY_CREATE     0x167    /* Create key */
                    132: #define    KEY_END        0x168    /* End key */
                    133: #define    KEY_EXIT       0x169    /* Exit key */
                    134: #define    KEY_FIND       0x16A    /* Find key */
                    135: #define    KEY_HELP       0x16B    /* Help key */
                    136: #define    KEY_MARK       0x16C    /* Mark key */
                    137: #define    KEY_MESSAGE    0x16D    /* Message key */
                    138: #define    KEY_MOVE       0x16E    /* Move key */
                    139: #define    KEY_NEXT       0x16F    /* Next Object key */
                    140: #define    KEY_OPEN       0x170    /* Open key */
                    141: #define    KEY_OPTIONS    0x171    /* Options key */
                    142: #define    KEY_PREVIOUS   0x172    /* Previous Object key */
                    143: #define    KEY_REDO       0x173    /* Redo key */
                    144: #define    KEY_REFERENCE  0x174    /* Ref Key */
                    145: #define    KEY_REFRESH    0x175    /* Refresh key */
                    146: #define    KEY_REPLACE    0x176    /* Replace key */
                    147: #define    KEY_RESTART    0x177    /* Restart key */
                    148: #define    KEY_RESUME     0x178    /* Resume key */
                    149: #define    KEY_SAVE       0x179    /* Save key */
                    150: #define    KEY_SBEG       0x17A    /* Shift begin key */
                    151: #define    KEY_SCANCEL    0x17B    /* Shift Cancel key */
                    152: #define    KEY_SCOMMAND   0x17C    /* Shift Command key */
                    153: #define    KEY_SCOPY      0x17D    /* Shift Copy key */
                    154: #define    KEY_SCREATE    0x17E    /* Shift Create key */
                    155: #define    KEY_SDC        0x17F    /* Shift Delete Character */
                    156: #define    KEY_SDL        0x180    /* Shift Delete Line */
                    157: #define    KEY_SELECT     0x181    /* Select key */
                    158: #define    KEY_SEND       0x182    /* Send key */
                    159: #define    KEY_SEOL       0x183    /* Shift Clear Line key */
                    160: #define    KEY_SEXIT      0x184    /* Shift Exit key */
                    161: #define    KEY_SFIND      0x185    /* Shift Find key */
                    162: #define    KEY_SHELP      0x186    /* Shift Help key */
                    163: #define    KEY_SHOME      0x187    /* Shift Home key */
                    164: #define    KEY_SIC        0x188    /* Shift Input key */
                    165: #define    KEY_SLEFT      0x189    /* Shift Left Arrow key */
                    166: #define    KEY_SMESSAGE   0x18A    /* Shift Message key */
                    167: #define    KEY_SMOVE      0x18B    /* Shift Move key */
                    168: #define    KEY_SNEXT      0x18C    /* Shift Next key */
                    169: #define    KEY_SOPTIONS   0x18D    /* Shift Options key */
                    170: #define    KEY_SPREVIOUS  0x18E    /* Shift Previous key */
                    171: #define    KEY_SPRINT     0x18F    /* Shift Print key */
                    172: #define    KEY_SREDO      0x190    /* Shift Redo key */
                    173: #define    KEY_SREPLACE   0x191    /* Shift Replace key */
                    174: #define    KEY_SRIGHT     0x192    /* Shift Right Arrow key */
1.44      jdc       175: #define    KEY_SRSUME     0x193    /* Shift Resume key */
1.22      mrg       176: #define    KEY_SSAVE      0x194    /* Shift Save key */
                    177: #define    KEY_SSUSPEND   0x195    /* Shift Suspend key */
                    178: #define    KEY_SUNDO      0x196    /* Shift Undo key */
                    179: #define    KEY_SUSPEND    0x197    /* Suspend key */
1.44      jdc       180: #define    KEY_UNDO       0x198    /* Undo key */
1.58      wiz       181: #define    KEY_MOUSE      0x199    /* Mouse event has occurred */
1.84      jdc       182: #define    KEY_RESIZE     0x200    /* Resize event has occurred */
                    183: #define    KEY_MAX        0x240    /* maximum extended key value */
1.22      mrg       184:
1.82      christos  185: #include <unctrl.h>
1.7       cgd       186:
                    187: /*
                    188:  * A window an array of __LINE structures pointed to by the 'lines' pointer.
                    189:  * A line is an array of __LDATA structures pointed to by the 'line' pointer.
                    190:  */
                    191:
1.31      jdc       192: /*
                    193:  * Definitions for characters and attributes in __LDATA
                    194:  */
                    195: #define __CHARTEXT     0x000000ff      /* bits for 8-bit characters */
                    196: #define __NORMAL       0x00000000      /* Added characters are normal. */
1.84      jdc       197: #define __STANDOUT     0x00000100      /* Added characters are standout. */
                    198: #define __UNDERSCORE   0x00000200      /* Added characters are underscored. */
                    199: #define __REVERSE      0x00000400      /* Added characters are reverse
1.31      jdc       200:                                           video. */
1.84      jdc       201: #define __BLINK                0x00000800      /* Added characters are blinking. */
                    202: #define __DIM          0x00001000      /* Added characters are dim. */
                    203: #define __BOLD         0x00002000      /* Added characters are bold. */
                    204: #define __BLANK                0x00004000      /* Added characters are blanked. */
                    205: #define __PROTECT      0x00008000      /* Added characters are protected. */
                    206: #define __ALTCHARSET   0x00010000      /* Added characters are ACS */
                    207: #define __COLOR                0x03fe0000      /* Color bits */
                    208: #define __ATTRIBUTES   0x03ffff00      /* All 8-bit attribute bits */
1.31      jdc       209:
1.30      blymn     210: typedef struct __ldata __LDATA;
                    211: typedef struct __line  __LINE;
                    212: typedef struct __window  WINDOW;
1.62      blymn     213: typedef struct __screen SCREEN;
1.30      blymn     214:
                    215: /*
                    216:  * Attribute definitions
                    217:  */
1.31      jdc       218: #define        A_NORMAL        __NORMAL
1.30      blymn     219: #define        A_STANDOUT      __STANDOUT
                    220: #define        A_UNDERLINE     __UNDERSCORE
                    221: #define        A_REVERSE       __REVERSE
                    222: #define        A_BLINK         __BLINK
                    223: #define        A_DIM           __DIM
                    224: #define        A_BOLD          __BOLD
                    225: #define        A_BLANK         __BLANK
                    226: #define        A_PROTECT       __PROTECT
1.31      jdc       227: #define        A_ALTCHARSET    __ALTCHARSET
                    228: #define        A_ATTRIBUTES    __ATTRIBUTES
                    229: #define        A_CHARTEXT      __CHARTEXT
                    230: #define        A_COLOR         __COLOR
1.30      blymn     231:
                    232: /*
                    233:  * Alternate character set definitions
                    234:  */
                    235:
1.31      jdc       236: #define        NUM_ACS 128
1.30      blymn     237:
                    238: extern chtype _acs_char[NUM_ACS];
1.87    ! christos  239: #ifdef __cplusplus
        !           240: #define __UC_CAST(a)   static_cast<unsigned char>(a)
        !           241: #else
        !           242: #define __UC_CAST(a)   (unsigned char)(a)
        !           243: #endif
        !           244: #define        ACS_RARROW      _acs_char[__UC_CAST('+')]
        !           245: #define        ACS_LARROW      _acs_char[__UC_CAST(',')]
        !           246: #define        ACS_UARROW      _acs_char[__UC_CAST('-')]
        !           247: #define        ACS_DARROW      _acs_char[__UC_CAST('.')]
        !           248: #define        ACS_BLOCK       _acs_char[__UC_CAST('0')]
        !           249: #define        ACS_DIAMOND     _acs_char[__UC_CAST('`')]
        !           250: #define        ACS_CKBOARD     _acs_char[__UC_CAST('a')]
        !           251: #define        ACS_DEGREE      _acs_char[__UC_CAST('f')]
        !           252: #define        ACS_PLMINUS     _acs_char[__UC_CAST('g')]
        !           253: #define        ACS_BOARD       _acs_char[__UC_CAST('h')]
        !           254: #define        ACS_LANTERN     _acs_char[__UC_CAST('i')]
        !           255: #define        ACS_LRCORNER    _acs_char[__UC_CAST('j')]
        !           256: #define        ACS_URCORNER    _acs_char[__UC_CAST('k')]
        !           257: #define        ACS_ULCORNER    _acs_char[__UC_CAST('l')]
        !           258: #define        ACS_LLCORNER    _acs_char[__UC_CAST('m')]
        !           259: #define        ACS_PLUS        _acs_char[__UC_CAST('n')]
        !           260: #define        ACS_HLINE       _acs_char[__UC_CAST('q')]
        !           261: #define        ACS_S1          _acs_char[__UC_CAST('o')]
        !           262: #define        ACS_S9          _acs_char[__UC_CAST('s')]
        !           263: #define        ACS_LTEE        _acs_char[__UC_CAST('t')]
        !           264: #define        ACS_RTEE        _acs_char[__UC_CAST('u')]
        !           265: #define        ACS_BTEE        _acs_char[__UC_CAST('v')]
        !           266: #define        ACS_TTEE        _acs_char[__UC_CAST('w')]
        !           267: #define        ACS_VLINE       _acs_char[__UC_CAST('x')]
        !           268: #define        ACS_BULLET      _acs_char[__UC_CAST('~')]
1.30      blymn     269:
1.57      wiz       270: /* System V compatibility */
1.31      jdc       271: #define        ACS_SBBS        ACS_LRCORNER
                    272: #define        ACS_BBSS        ACS_URCORNER
1.30      blymn     273: #define        ACS_BSSB        ACS_ULCORNER
1.31      jdc       274: #define        ACS_SSBB        ACS_LLCORNER
                    275: #define        ACS_SSSS        ACS_PLUS
                    276: #define        ACS_BSBS        ACS_HLINE
                    277: #define        ACS_SSSB        ACS_LTEE
                    278: #define        ACS_SBSS        ACS_RTEE
1.30      blymn     279: #define        ACS_SSBS        ACS_BTEE
                    280: #define        ACS_BSSS        ACS_TTEE
                    281: #define        ACS_SBSB        ACS_VLINE
1.31      jdc       282: #define        _acs_map        _acs_char
1.30      blymn     283:
                    284: /*
1.83      jdc       285:  * Color definitions (ANSI color numbers)
1.30      blymn     286:  */
                    287:
1.31      jdc       288: #define        COLOR_BLACK     0x00
                    289: #define        COLOR_RED       0x01
                    290: #define        COLOR_GREEN     0x02
                    291: #define        COLOR_YELLOW    0x03
                    292: #define        COLOR_BLUE      0x04
                    293: #define        COLOR_MAGENTA   0x05
                    294: #define        COLOR_CYAN      0x06
                    295: #define        COLOR_WHITE     0x07
1.7       cgd       296:
1.87    ! christos  297: #ifdef __cplusplus
        !           298: #define __UINT32_CAST(a)       static_cast<u_int32_t>(a)
        !           299: #else
        !           300: #define __UINT32_CAST(a)       (u_int32_t)(a)
        !           301: #endif
        !           302: #define        COLOR_PAIR(n)   (((__UINT32_CAST(n)) << 17) & A_COLOR)
        !           303: #define        PAIR_NUMBER(n)  (((__UINT32_CAST(n)) & A_COLOR) >> 17)
1.7       cgd       304:
1.4       mycroft   305: /* Curses external declarations. */
                    306: extern WINDOW  *curscr;                /* Current screen. */
                    307: extern WINDOW  *stdscr;                /* Standard screen. */
                    308:
1.22      mrg       309: extern int     __tcaction;             /* If terminal hardware set. */
1.4       mycroft   310:
                    311: extern int      COLS;                  /* Columns on the screen. */
                    312: extern int      LINES;                 /* Lines on the screen. */
1.83      jdc       313: extern int      COLORS;                /* Max colors on the screen. */
                    314: extern int      COLOR_PAIRS;           /* Max color pairs on the screen. */
1.74      jdc       315:
                    316: extern int      ESCDELAY;              /* Delay between keys in esc seq's. */
1.4       mycroft   317:
1.85      jdc       318: #define        ERR     (-1)                    /* Error return. */
                    319: #define        OK      (0)                     /* Success return. */
1.4       mycroft   320:
1.33      blymn     321: /*
                    322:  * The following have, traditionally, been macros but X/Open say they
                    323:  * need to be functions.  Keep the old macros for debugging.
                    324:  */
                    325: #ifdef _CURSES_USE_MACROS
1.4       mycroft   326: /* Standard screen pseudo functions. */
1.7       cgd       327: #define        addbytes(s, n)                  __waddbytes(stdscr, s, n, 0)
                    328: #define        addch(ch)                       waddch(stdscr, ch)
1.75      jdc       329: #define        addchnstr(s)                    waddchnstr(stdscr, s, n)
                    330: #define        addchstr(s)                     waddchnstr(stdscr, s, -1)
1.7       cgd       331: #define        addnstr(s, n)                   waddnstr(stdscr, s, n)
1.26      simonb    332: #define        addstr(s)                       waddnstr(stdscr, s, -1)
1.73      jdc       333: #define attr_get(a, p, o)              wattr_get(stdscr, a, p, o)
                    334: #define attr_off(a, o)                 wattr_off(stdscr, a, o)
                    335: #define attr_on(a, o)                  wattr_on(stdscr, a, o)
                    336: #define attr_set(a, p, o)              wattr_set(stdscr, a, p, o)
1.67      jdc       337: #define        attroff(attr)                   wattroff(stdscr, attr)
                    338: #define        attron(attr)                    wattron(stdscr, attr)
                    339: #define        attrset(attr)                   wattrset(stdscr, attr)
1.31      jdc       340: #define bkgd(ch)                       wbkgd(stdscr, ch)
                    341: #define bkgdset(ch)                    wbkgdset(stdscr, ch)
1.30      blymn     342: #define        border(l, r, t, b, tl, tr, bl, br) \
                    343:        wborder(stdscr, l, r, t, b, tl, tr, bl, br)
1.7       cgd       344: #define        clear()                         wclear(stdscr)
                    345: #define        clrtobot()                      wclrtobot(stdscr)
                    346: #define        clrtoeol()                      wclrtoeol(stdscr)
1.73      jdc       347: #define color_set(c, o)                        wcolor_set(stdscr, c, o)
1.7       cgd       348: #define        delch()                         wdelch(stdscr)
                    349: #define        deleteln()                      wdeleteln(stdscr)
1.86      jdc       350: #define        echochar(c)                     wechochar(stdscr, c)
1.7       cgd       351: #define        erase()                         werase(stdscr)
                    352: #define        getch()                         wgetch(stdscr)
1.56      jdc       353: #define        getnstr(s, n)                   wgetnstr(stdscr, s, n)
1.7       cgd       354: #define        getstr(s)                       wgetstr(stdscr, s)
                    355: #define        inch()                          winch(stdscr)
1.52      simonb    356: #define        inchnstr(c)                     winchnstr(stdscr, c)
                    357: #define        inchstr(c)                      winchstr(stdscr, c)
                    358: #define        innstr(s, n)                    winnstr(stdscr, s, n)
1.7       cgd       359: #define        insch(ch)                       winsch(stdscr, ch)
1.30      blymn     360: #define        insdelln(n)                     winsdelln(stdscr, n)
1.7       cgd       361: #define        insertln()                      winsertln(stdscr)
1.52      simonb    362: #define        instr(s)                        winstr(stdscr, s)
1.7       cgd       363: #define        move(y, x)                      wmove(stdscr, y, x)
                    364: #define        refresh()                       wrefresh(stdscr)
1.31      jdc       365: #define        scrl(n)                         wscrl(stdscr, n)
1.55      jdc       366: #define        setscrreg(t, b)                 wsetscrreg(stdscr, t, b)
1.7       cgd       367: #define        standend()                      wstandend(stdscr)
                    368: #define        standout()                      wstandout(stdscr)
1.22      mrg       369: #define        timeout(delay)                  wtimeout(stdscr, delay)
                    370: #define        underscore()                    wunderscore(stdscr)
                    371: #define        underend()                      wunderend(stdscr)
1.7       cgd       372: #define        waddbytes(w, s, n)              __waddbytes(w, s, n, 0)
1.26      simonb    373: #define        waddstr(w, s)                   waddnstr(w, s, -1)
1.4       mycroft   374:
                    375: /* Standard screen plus movement pseudo functions. */
1.7       cgd       376: #define        mvaddbytes(y, x, s, n)          mvwaddbytes(stdscr, y, x, s, n)
                    377: #define        mvaddch(y, x, ch)               mvwaddch(stdscr, y, x, ch)
1.75      jdc       378: #define        mvaddchnstr(y, x, s, n)         mvwaddchnstr(stdscr, y, x, s, n)
                    379: #define        mvaddchstr(y, x, s)             mvwaddchstr(stdscr, y, x, s)
1.7       cgd       380: #define        mvaddnstr(y, x, s, n)           mvwaddnstr(stdscr, y, x, s, n)
                    381: #define        mvaddstr(y, x, s)               mvwaddstr(stdscr, y, x, s)
                    382: #define        mvdelch(y, x)                   mvwdelch(stdscr, y, x)
                    383: #define        mvgetch(y, x)                   mvwgetch(stdscr, y, x)
1.56      jdc       384: #define        mvgetnstr(y, x, s)              mvwgetnstr(stdscr, y, x, s, n)
1.7       cgd       385: #define        mvgetstr(y, x, s)               mvwgetstr(stdscr, y, x, s)
                    386: #define        mvinch(y, x)                    mvwinch(stdscr, y, x)
1.52      simonb    387: #define        mvinchnstr(y, x, c, n)          mvwinchnstr(stdscr, y, x, c, n)
                    388: #define        mvinchstr(y, x, c)              mvwinchstr(stdscr, y, x, c)
                    389: #define        mvinnstr(y, x, s, n)            mvwinnstr(stdscr, y, x, s, n)
1.7       cgd       390: #define        mvinsch(y, x, c)                mvwinsch(stdscr, y, x, c)
1.52      simonb    391: #define        mvinstr(y, x, s)                mvwinstr(stdscr, y, x, s)
1.7       cgd       392: #define        mvwaddbytes(w, y, x, s, n) \
                    393:        (wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
                    394: #define        mvwaddch(w, y, x, ch) \
                    395:        (wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
1.75      jdc       396: #define        mvwaddchnstr(w, y, x, s, n) \
                    397:        (wmove(w, y, x) == ERR ? ERR : waddchnstr(w, s, n))
                    398: #define        mvwaddchstr(w, y, x, s) \
                    399:        (wmove(w, y, x) == ERR ? ERR : waddchnstr(w, s, -1))
1.7       cgd       400: #define        mvwaddnstr(w, y, x, s, n) \
                    401:        (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
                    402: #define        mvwaddstr(w, y, x, s) \
1.25      simonb    403:        (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, -1))
1.7       cgd       404: #define        mvwdelch(w, y, x) \
                    405:        (wmove(w, y, x) == ERR ? ERR : wdelch(w))
                    406: #define        mvwgetch(w, y, x) \
                    407:        (wmove(w, y, x) == ERR ? ERR : wgetch(w))
1.56      jdc       408: #define        mvwgetnstr(w, y, x, s, n) \
                    409:        (wmove(w, y, x) == ERR ? ERR : wgetnstr(w, s, n))
1.7       cgd       410: #define        mvwgetstr(w, y, x, s) \
                    411:        (wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
                    412: #define        mvwinch(w, y, x) \
                    413:        (wmove(w, y, x) == ERR ? ERR : winch(w))
1.52      simonb    414: #define        mvwinchnstr(w, y, x, c, n) \
                    415:        (wmove(w, y, x) == ERR ? ERR : winchnstr(w, c, n))
                    416: #define        mvwinchstr(w, y, x, s) \
                    417:        (wmove(w, y, x) == ERR ? ERR : winchstr(w, c))
                    418: #define        mvwinnstr(w, y, x, s, n) \
                    419:        (wmove(w, y, x) == ERR ? ERR : winnstr(w, s, n))
1.7       cgd       420: #define        mvwinsch(w, y, x, c) \
                    421:        (wmove(w, y, x) == ERR ? ERR : winsch(w, c))
1.52      simonb    422: #define        mvwinstr(w, y, x, s) \
                    423:        (wmove(w, y, x) == ERR ? ERR : winstr(w, s))
1.33      blymn     424:
1.77      jdc       425: /* Miscellaneous. */
                    426: #define        noqiflush()             intrflush(stdscr, FALSE)
                    427: #define        qiflush()               intrflush(stdscr, TRUE)
                    428:
1.33      blymn     429: #else
                    430: /* Use functions not macros... */
1.44      jdc       431: __BEGIN_DECLS
                    432: int     addbytes(const char *, int);
                    433: int     addch(chtype);
1.75      jdc       434: int     addchnstr(const chtype *, int);
                    435: int     addchstr(const chtype *);
1.44      jdc       436: int     addnstr(const char *, int);
                    437: int     addstr(const char *);
1.73      jdc       438: int     attr_get(attr_t *, short *, void *);
                    439: int     attr_off(attr_t, void *);
                    440: int     attr_on(attr_t, void *);
                    441: int     attr_set(attr_t, short, void *);
1.67      jdc       442: int     attroff(int);
                    443: int     attron(int);
                    444: int     attrset(int);
1.44      jdc       445: int     bkgd(chtype);
                    446: void    bkgdset(chtype);
                    447: int     border(chtype, chtype, chtype, chtype,
                    448:           chtype, chtype, chtype, chtype);
                    449: int     clear(void);
                    450: int     clrtobot(void);
                    451: int     clrtoeol(void);
1.73      jdc       452: int     color_set(short, void *);
1.44      jdc       453: int     delch(void);
                    454: int     deleteln(void);
1.86      jdc       455: int     echochar(const chtype);
1.44      jdc       456: int     erase(void);
                    457: int     getch(void);
1.56      jdc       458: int     getnstr(char *, int);
1.44      jdc       459: int     getstr(char *);
                    460: chtype  inch(void);
1.52      simonb    461: int     inchnstr(chtype *, int);
                    462: int     inchstr(chtype *);
                    463: int     innstr(char *, int);
1.44      jdc       464: int     insch(chtype);
                    465: int     insdelln(int);
                    466: int     insertln(void);
1.52      simonb    467: int     instr(char *);
1.44      jdc       468: int     move(int, int);
                    469: int     refresh(void);
                    470: int     scrl(int);
1.55      jdc       471: int     setscrreg(int, int);
1.44      jdc       472: int     standend(void);
                    473: int     standout(void);
                    474: void    timeout(int);
                    475: int     underscore(void);
                    476: int     underend(void);
                    477: int     waddbytes(WINDOW *, const char *, int);
                    478: int     waddstr(WINDOW *, const char *);
1.33      blymn     479:
                    480: /* Standard screen plus movement functions. */
1.44      jdc       481: int     mvaddbytes(int, int, const char *, int);
                    482: int     mvaddch(int, int, chtype);
1.75      jdc       483: int     mvaddchnstr(int, int, const chtype *, int);
                    484: int     mvaddchstr(int, int, const chtype *);
1.44      jdc       485: int     mvaddnstr(int, int, const char *, int);
                    486: int     mvaddstr(int, int, const char *);
                    487: int     mvdelch(int, int);
                    488: int     mvgetch(int, int);
1.56      jdc       489: int     mvgetnstr(int, int, char *, int);
1.44      jdc       490: int     mvgetstr(int, int, char *);
                    491: chtype  mvinch(int, int);
1.52      simonb    492: int     mvinchnstr(int, int, chtype *, int);
                    493: int     mvinchstr(int, int, chtype *);
                    494: int     mvinnstr(int, int, char *, int);
1.44      jdc       495: int     mvinsch(int, int, chtype);
1.52      simonb    496: int     mvinstr(int, int, char *);
1.44      jdc       497:
                    498: int     mvwaddbytes(WINDOW *, int, int, const char *, int);
                    499: int     mvwaddch(WINDOW *, int, int, chtype);
1.75      jdc       500: int     mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
                    501: int     mvwaddchstr(WINDOW *, int, int, const chtype *);
1.44      jdc       502: int     mvwaddnstr(WINDOW *, int, int, const char *, int);
                    503: int     mvwaddstr(WINDOW *, int, int, const char *);
                    504: int     mvwdelch(WINDOW *, int, int);
                    505: int     mvwgetch(WINDOW *, int, int);
1.56      jdc       506: int     mvwgetnstr(WINDOW *, int, int, char *, int);
1.44      jdc       507: int     mvwgetstr(WINDOW *, int, int, char *);
                    508: chtype  mvwinch(WINDOW *, int, int);
                    509: int     mvwinsch(WINDOW *, int, int, chtype);
                    510: __END_DECLS
1.33      blymn     511: #endif /* _CURSES_USE_MACROS */
                    512:
1.34      jdc       513: #define        getyx(w, y, x)          (y) = getcury(w), (x) = getcurx(w)
1.31      jdc       514: #define        getbegyx(w, y, x)       (y) = getbegy(w), (x) = getbegx(w)
                    515: #define        getmaxyx(w, y, x)       (y) = getmaxy(w), (x) = getmaxx(w)
1.61      blymn     516: #define        getparyx(w, y, x)       (y) = getpary(w), (x) = getparx(w)
1.4       mycroft   517:
                    518: /* Public function prototypes. */
1.14      jtc       519: __BEGIN_DECLS
1.66      jdc       520: int     assume_default_colors(short, short);
1.63      christos  521: int     baudrate(void);
1.33      blymn     522: int     beep(void);
1.47      blymn     523: int     box(WINDOW *, chtype, chtype);
1.72      jdc       524: bool    can_change_color(void);
1.33      blymn     525: int     cbreak(void);
1.47      blymn     526: int     clearok(WINDOW *, bool);
                    527: int     color_content(short, short *, short *, short *);
                    528: int     copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int);
                    529: int     curs_set(int);
1.33      blymn     530: int     def_prog_mode(void);
                    531: int     def_shell_mode(void);
1.69      blymn     532: int      define_key(char *, int);
1.62      blymn     533: int     delay_output(int);
                    534: void     delscreen(SCREEN *);
1.47      blymn     535: int     delwin(WINDOW *);
                    536: WINDOW *derwin(WINDOW *, int, int, int, int);
                    537: WINDOW *dupwin(WINDOW *);
1.44      jdc       538: int     doupdate(void);
1.33      blymn     539: int     echo(void);
                    540: int     endwin(void);
1.46      blymn     541: char     erasechar(void);
1.33      blymn     542: int     flash(void);
                    543: int     flushinp(void);
1.47      blymn     544: int     flushok(WINDOW *, bool);
                    545: char   *fullname(const char *, char *);
1.48      jdc       546: chtype  getattrs(WINDOW *);
1.47      blymn     547: chtype  getbkgd(WINDOW *);
                    548: char   *getcap(char *);
                    549: int     getcury(WINDOW *);
                    550: int     getcurx(WINDOW *);
                    551: int     getbegy(WINDOW *);
                    552: int     getbegx(WINDOW *);
                    553: int     getmaxy(WINDOW *);
                    554: int     getmaxx(WINDOW *);
1.61      blymn     555: int     getpary(WINDOW *);
                    556: int     getparx(WINDOW *);
1.33      blymn     557: int     gettmode(void);
1.71      blymn     558: int     halfdelay(int);
1.33      blymn     559: bool    has_colors(void);
1.55      jdc       560: bool    has_ic(void);
                    561: bool    has_il(void);
1.47      blymn     562: int     hline(chtype, int);
1.65      blymn     563: int     idcok(WINDOW *, bool);
1.47      blymn     564: int     idlok(WINDOW *, bool);
                    565: int     init_color(short, short, short, short);
                    566: int     init_pair(short, short, short);
1.33      blymn     567: WINDOW *initscr(void);
1.47      blymn     568: int     intrflush(WINDOW *, bool);
1.33      blymn     569: bool    isendwin(void);
1.47      blymn     570: bool    is_linetouched(WINDOW *, int);
                    571: bool    is_wintouched(WINDOW *);
1.69      blymn     572: int      keyok(int, bool);
1.47      blymn     573: void    keypad(WINDOW *, bool);
1.76      jdc       574: char   *keyname(int);
1.46      blymn     575: char     killchar(void);
1.47      blymn     576: int     leaveok(WINDOW *, bool);
1.33      blymn     577: char   *longname(void);
1.47      blymn     578: int     meta(WINDOW *, bool);
                    579: int     mvcur(int, int, int, int);
1.60      blymn     580: int      mvderwin(WINDOW *, int, int);
1.47      blymn     581: int     mvhline(int, int, chtype, int);
                    582: int     mvprintw(int, int, const char *, ...)
1.44      jdc       583:                __attribute__((__format__(__printf__, 3, 4)));
1.47      blymn     584: int     mvscanw(int, int, const char *, ...)
1.44      jdc       585:                __attribute__((__format__(__scanf__, 3, 4)));
1.47      blymn     586: int     mvvline(int, int, chtype, int);
                    587: int     mvwhline(WINDOW *, int, int, chtype, int);
                    588: int     mvwvline(WINDOW *, int, int, chtype, int);
                    589: int     mvwin(WINDOW *, int, int);
1.52      simonb    590: int     mvwinchnstr(WINDOW *, int, int, chtype *, int);
                    591: int     mvwinchstr(WINDOW *, int, int, chtype *);
                    592: int     mvwinnstr(WINDOW *, int, int, char *, int);
                    593: int     mvwinstr(WINDOW *, int, int, char *);
1.47      blymn     594: int     mvwprintw(WINDOW *, int, int, const char *, ...)
1.44      jdc       595:                __attribute__((__format__(__printf__, 4, 5)));
1.47      blymn     596: int     mvwscanw(WINDOW *, int, int, const char *, ...)
1.44      jdc       597:                __attribute__((__format__(__scanf__, 4, 5)));
1.48      jdc       598: int     napms(int);
1.70      jdc       599: WINDOW *newpad(int, int);
1.62      blymn     600: SCREEN  *newterm(char *, FILE *, FILE *);
1.47      blymn     601: WINDOW *newwin(int, int, int, int);
1.33      blymn     602: int     nl(void);
1.72      jdc       603: attr_t  no_color_video(void);
1.33      blymn     604: int     nocbreak(void);
1.80      jdc       605: int     nodelay(WINDOW *, bool);
1.33      blymn     606: int     noecho(void);
                    607: int     nonl(void);
1.77      jdc       608: void    noqiflush(void);
1.33      blymn     609: int     noraw(void);
1.47      blymn     610: int     notimeout(WINDOW *, bool);
                    611: int     overlay(const WINDOW *, WINDOW *);
                    612: int     overwrite(const WINDOW *, WINDOW *);
                    613: int     pair_content(short, short *, short *);
1.86      jdc       614: int     pechochar(WINDOW *, const chtype);
1.70      jdc       615: int     pnoutrefresh(WINDOW *, int, int, int, int, int, int);
                    616: int     prefresh(WINDOW *, int, int, int, int, int, int);
1.44      jdc       617: int     printw(const char *, ...)
                    618:                __attribute__((__format__(__printf__, 1, 2)));
1.77      jdc       619: void    qiflush(void);
1.33      blymn     620: int     raw(void);
1.79      jdc       621: int     redrawwin(WINDOW *);
1.33      blymn     622: int     reset_prog_mode(void);
                    623: int     reset_shell_mode(void);
                    624: int     resetty(void);
1.59      blymn     625: int      resizeterm(int, int);
1.33      blymn     626: int     savetty(void);
1.44      jdc       627: int     scanw(const char *, ...)
                    628:                __attribute__((__format__(__scanf__, 1, 2)));
1.47      blymn     629: int     scroll(WINDOW *);
                    630: int     scrollok(WINDOW *, bool);
1.33      blymn     631: int     setterm(char *);
1.62      blymn     632: SCREEN  *set_term(SCREEN *);
1.44      jdc       633: int     start_color(void);
1.70      jdc       634: WINDOW *subpad(WINDOW *, int, int, int, int);
1.47      blymn     635: WINDOW *subwin(WINDOW *, int, int, int, int);
                    636: int     touchline(WINDOW *, int, int);
                    637: int     touchoverlap(WINDOW *, WINDOW *);
                    638: int     touchwin(WINDOW *);
                    639: int     ungetch(int);
                    640: int     untouchwin(WINDOW *);
1.66      jdc       641: int     use_default_colors(void);
1.47      blymn     642: int     vline(chtype, int);
                    643: int     vwprintw(WINDOW *, const char *, _BSD_VA_LIST_)
1.44      jdc       644:                __attribute__((__format__(__printf__, 2, 0)));
1.47      blymn     645: int     vwscanw(WINDOW *, const char *, _BSD_VA_LIST_)
1.44      jdc       646:                __attribute__((__format__(__scanf__, 2, 0)));
1.47      blymn     647: int     waddch(WINDOW *, chtype);
1.75      jdc       648: int     waddchnstr(WINDOW *, const chtype *, int);
                    649: int     waddchstr(WINDOW *, const chtype *);
1.47      blymn     650: int     waddnstr(WINDOW *, const char *, int);
1.73      jdc       651: int     wattr_get(WINDOW *, attr_t *, short *, void *);
                    652: int     wattr_off(WINDOW *, attr_t, void *);
                    653: int     wattr_on(WINDOW *, attr_t, void *);
                    654: int     wattr_set(WINDOW *, attr_t, short, void *);
1.67      jdc       655: int     wattroff(WINDOW *, int);
1.47      blymn     656: int     wattron(WINDOW *, int);
                    657: int     wattrset(WINDOW *, int);
                    658: int     wbkgd(WINDOW *, chtype);
                    659: void    wbkgdset(WINDOW *, chtype);
                    660: int     wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype,
                    661:                chtype, chtype);
                    662: int     wclear(WINDOW *);
                    663: int     wclrtobot(WINDOW *);
                    664: int     wclrtoeol(WINDOW *);
1.73      jdc       665: int     wcolor_set(WINDOW *, short, void *);
1.47      blymn     666: int     wdelch(WINDOW *);
                    667: int     wdeleteln(WINDOW *);
1.86      jdc       668: int     wechochar(WINDOW *, const chtype);
1.47      blymn     669: int     werase(WINDOW *);
                    670: int     wgetch(WINDOW *);
1.56      jdc       671: int     wgetnstr(WINDOW *, char *, int);
1.47      blymn     672: int     wgetstr(WINDOW *, char *);
                    673: int     whline(WINDOW *, chtype, int);
                    674: chtype  winch(WINDOW *);
1.52      simonb    675: int     winchnstr(WINDOW *, chtype *, int);
                    676: int     winchstr(WINDOW *, chtype *);
                    677: int     winnstr(WINDOW *, char *, int);
1.47      blymn     678: int     winsch(WINDOW *, chtype);
                    679: int     winsdelln(WINDOW *, int);
                    680: int     winsertln(WINDOW *);
1.52      simonb    681: int     winstr(WINDOW *, char *);
1.47      blymn     682: int     wmove(WINDOW *, int, int);
                    683: int     wnoutrefresh(WINDOW *);
                    684: int     wprintw(WINDOW *, const char *, ...)
1.44      jdc       685:                __attribute__((__format__(__printf__, 2, 3)));
1.79      jdc       686: int     wredrawln(WINDOW *, int, int);
1.47      blymn     687: int     wrefresh(WINDOW *);
1.59      blymn     688: int      wresize(WINDOW *, int, int);
1.47      blymn     689: int     wscanw(WINDOW *, const char *, ...)
1.44      jdc       690:                __attribute__((__format__(__scanf__, 2, 3)));
1.47      blymn     691: int     wscrl(WINDOW *, int);
1.55      jdc       692: int     wsetscrreg(WINDOW *, int, int);
1.47      blymn     693: int     wstandend(WINDOW *);
                    694: int     wstandout(WINDOW *);
                    695: void    wtimeout(WINDOW *, int);
                    696: int     wtouchln(WINDOW *, int, int, int);
                    697: int     wunderend(WINDOW *);
                    698: int     wunderscore(WINDOW *);
                    699: int     wvline(WINDOW *, chtype, int);
1.4       mycroft   700:
1.7       cgd       701: /* Private functions that are needed for user programs prototypes. */
1.33      blymn     702: int     __cputchar(int);
1.47      blymn     703: int     __waddbytes(WINDOW *, const char *, int, attr_t);
1.14      jtc       704: __END_DECLS
1.1       cgd       705:
1.4       mycroft   706: #endif /* !_CURSES_H_ */

CVSweb <webmaster@jp.NetBSD.org>