1: /* 2/2/83 (Berkeley) @(#)curses.h	1.11 */
   2: # ifndef WINDOW
   3: 
   4: # include   <stdio.h>
   5: 
   6: # include   <sgtty.h>
   7: 
   8: # define    bool    char
   9: # define    reg register
  10: 
  11: # define    TRUE    (1)
  12: # define    FALSE   (0)
  13: # define    ERR (0)
  14: # define    OK  (1)
  15: 
  16: # define    _ENDLINE    001
  17: # define    _FULLWIN    002
  18: # define    _SCROLLWIN  004
  19: # define    _FLUSH      010
  20: # define    _STANDOUT   0200
  21: # define    _NOCHANGE   -1
  22: 
  23: # define    _puts(s)    tputs(s, 0, _putchar);
  24: 
  25: typedef struct sgttyb   SGTTY;
  26: 
  27: /*
  28:  * Capabilities from termcap
  29:  */
  30: 
  31: extern bool     AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL,
  32:         XN;
  33: extern char     *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *DC, *DL, *DM,
  34:         *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *NL,
  35:         *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US,
  36:         *VB, *VE, *VS, PC;
  37: 
  38: /*
  39:  * From the tty modes...
  40:  */
  41: 
  42: extern bool NONL, UPPERCASE, normtty, _pfast;
  43: 
  44: struct _win_st {
  45:     short       _cury, _curx;
  46:     short       _maxy, _maxx;
  47:     short       _begy, _begx;
  48:     short       _flags;
  49:     bool        _clear;
  50:     bool        _leave;
  51:     bool        _scroll;
  52:     char        **_y;
  53:     short       *_firstch;
  54:     short       *_lastch;
  55:     struct _win_st  *_nextp, *_orig;
  56: };
  57: 
  58: # define    WINDOW  struct _win_st
  59: 
  60: extern bool My_term, _echoit, _rawmode, _endwin;
  61: 
  62: extern char *Def_term, ttytype[];
  63: 
  64: extern int  LINES, COLS, _tty_ch, _res_flg;
  65: 
  66: extern SGTTY    _tty;
  67: 
  68: extern WINDOW   *stdscr, *curscr;
  69: 
  70: /*
  71:  *	Define VOID to stop lint from generating "null effect"
  72:  * comments.
  73:  */
  74: # ifdef lint
  75: int __void__;
  76: # define    VOID(x) (__void__ = (int) (x))
  77: # else
  78: # define    VOID(x) (x)
  79: # endif
  80: 
  81: /*
  82:  * psuedo functions for standard screen
  83:  */
  84: # define    addch(ch)   VOID(waddch(stdscr, ch))
  85: # define    getch()     VOID(wgetch(stdscr))
  86: # define    addstr(str) VOID(waddstr(stdscr, str))
  87: # define    getstr(str) VOID(wgetstr(stdscr, str))
  88: # define    move(y, x)  VOID(wmove(stdscr, y, x))
  89: # define    clear()     VOID(wclear(stdscr))
  90: # define    erase()     VOID(werase(stdscr))
  91: # define    clrtobot()  VOID(wclrtobot(stdscr))
  92: # define    clrtoeol()  VOID(wclrtoeol(stdscr))
  93: # define    insertln()  VOID(winsertln(stdscr))
  94: # define    deleteln()  VOID(wdeleteln(stdscr))
  95: # define    refresh()   VOID(wrefresh(stdscr))
  96: # define    inch()      VOID(winch(stdscr))
  97: # define    insch(c)    VOID(winsch(stdscr,c))
  98: # define    delch()     VOID(wdelch(stdscr))
  99: # define    standout()  VOID(wstandout(stdscr))
 100: # define    standend()  VOID(wstandend(stdscr))
 101: 
 102: /*
 103:  * mv functions
 104:  */
 105: #define mvwaddch(win,y,x,ch)    VOID(wmove(win,y,x)==ERR?ERR:waddch(win,ch))
 106: #define mvwgetch(win,y,x)   VOID(wmove(win,y,x)==ERR?ERR:wgetch(win))
 107: #define mvwaddstr(win,y,x,str)  VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
 108: #define mvwgetstr(win,y,x,str)  VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
 109: #define mvwinch(win,y,x)    VOID(wmove(win,y,x) == ERR ? ERR : winch(win))
 110: #define mvwdelch(win,y,x)   VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
 111: #define mvwinsch(win,y,x,c) VOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c))
 112: #define mvaddch(y,x,ch)     mvwaddch(stdscr,y,x,ch)
 113: #define mvgetch(y,x)        mvwgetch(stdscr,y,x)
 114: #define mvaddstr(y,x,str)   mvwaddstr(stdscr,y,x,str)
 115: #define mvgetstr(y,x,str)       mvwgetstr(stdscr,y,x,str)
 116: #define mvinch(y,x)     mvwinch(stdscr,y,x)
 117: #define mvdelch(y,x)        mvwdelch(stdscr,y,x)
 118: #define mvinsch(y,x,c)      mvwinsch(stdscr,y,x,c)
 119: 
 120: /*
 121:  * psuedo functions
 122:  */
 123: 
 124: #define clearok(win,bf)  (win->_clear = bf)
 125: #define leaveok(win,bf)  (win->_leave = bf)
 126: #define scrollok(win,bf) (win->_scroll = bf)
 127: #define flushok(win,bf)  (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
 128: #define getyx(win,y,x)   y = win->_cury, x = win->_curx
 129: #define winch(win)   (win->_y[win->_cury][win->_curx] & 0177)
 130: 
 131: #define raw()    (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty))
 132: #define noraw()  (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty))
 133: #define crmode() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty))
 134: #define nocrmode() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty))
 135: #define echo()   (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty))
 136: #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty))
 137: #define nl()     (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
 138: #define nonl()   (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
 139: #define savetty() (gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags)
 140: #define resetty() (_tty.sg_flags = _res_flg, stty(_tty_ch, &_tty))
 141: 
 142: WINDOW  *initscr(), *newwin(), *subwin();
 143: char    *longname(), *getcap();
 144: 
 145: # endif

Defined variables

__void__ defined in line 75; used 1 times
  • in line 76

Defined struct's

_win_st defined in line 44; used 2 times
  • in line 55(2)

Defined typedef's

SGTTY defined in line 25; used 2 times

Defined macros

ERR defined in line 13; used 14 times
FALSE defined in line 12; used 6 times
OK defined in line 14; never used
TRUE defined in line 11; used 5 times
VOID defined in line 78; used 24 times
WINDOW defined in line 58; used 4 times
_ENDLINE defined in line 16; never used
_FLUSH defined in line 19; used 2 times
  • in line 127(2)
_FULLWIN defined in line 17; never used
_NOCHANGE defined in line 21; never used
_SCROLLWIN defined in line 18; never used
_STANDOUT defined in line 20; never used
_puts defined in line 23; never used
addch defined in line 84; never used
addstr defined in line 86; never used
bool defined in line 8; used 8 times
clear defined in line 89; never used
clearok defined in line 124; never used
clrtobot defined in line 91; never used
clrtoeol defined in line 92; never used
crmode defined in line 133; never used
delch defined in line 98; never used
deleteln defined in line 94; never used
echo defined in line 135; never used
erase defined in line 90; never used
flushok defined in line 127; never used
getch defined in line 85; never used
getstr defined in line 87; never used
getyx defined in line 128; never used
inch defined in line 96; never used
insch defined in line 97; never used
insertln defined in line 93; never used
leaveok defined in line 125; never used
move defined in line 88; never used
mvaddch defined in line 112; never used
mvaddstr defined in line 114; never used
mvdelch defined in line 117; never used
mvgetch defined in line 113; never used
mvgetstr defined in line 115; never used
mvinch defined in line 116; never used
mvinsch defined in line 118; never used
mvwaddch defined in line 105; used 1 times
mvwaddstr defined in line 107; used 1 times
mvwdelch defined in line 110; used 1 times
mvwgetch defined in line 106; used 1 times
mvwgetstr defined in line 108; used 1 times
mvwinch defined in line 109; used 1 times
mvwinsch defined in line 111; used 1 times
nl defined in line 137; never used
nocrmode defined in line 134; never used
noecho defined in line 136; never used
nonl defined in line 138; never used
noraw defined in line 132; never used
raw defined in line 131; never used
refresh defined in line 95; never used
reg defined in line 9; never used
resetty defined in line 140; never used
savetty defined in line 139; never used
scrollok defined in line 126; never used
standend defined in line 100; never used
standout defined in line 99; never used
winch defined in line 129; used 2 times

Usage of this include

Last modified: 1983-05-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1105
Valid CSS Valid XHTML 1.0 Strict