#ifndef _XOPEN_CURSES
#define _XOPEN_CURSES 1
#endif

/*
 * (c) Copyright 1995 Hewlett-Packard Co., All Rights Reserved.
 */
/*
 * Copyright (c) 1994
 * Novell, Inc. and International Business Machines Corp. All Rights Reserved.
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Novell Inc. and 
 * International Business Machines Corp. 
 * The copyright notice above does not evidence any actual or intended 
 * publication of such source code.
 */
/*
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992, 1992, 1993, 1994
 * Novell, Inc. All Rights Reserved.
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Novell Inc.
 * The copyright notice above does not evidence any 
 * actual or intended publication of such source code.
 */
/*
 * Copyright (c) 1982, 1986, 1988
 * The Regents of the University of California.  All Rights Reserved.
 * Portions of this document are derived from software developed by the 
 * University of California, Berkeley, and its contributors.
 */


#if !defined(_XOPEN_SOURCE_EXTENDED) || defined(__HP_CURSES) 

/* @(#) $Revision: /ux/core/libs/hdr/curses.h@@/main/r10dav/libc_dav/3 $ */
#ifndef _CURSES_INCLUDED /* allow multiple inclusions */
#define _CURSES_INCLUDED

#include <signal.h>

#ifndef _SYS_STDSYMS_INCLUDED
#  include <sys/stdsyms.h>
#endif /* _SYS_STDSYMS_INCLUDED */

#ifdef __cplusplus
extern "C" {
#endif

#ifndef WINDOW

# ifndef 	NONSTANDARD
#  include  <stdio.h>
  /*
   * This trick is used to distinguish between USG and V7 systems.
   * We assume that L_ctermid is only defined in stdio.h in USG
   * systems, but not in V7 or Berkeley UNIX.
   */
#  ifdef L_ctermid
#  define USG
#  endif
#  include  <unctrl.h>
#  ifdef USG
   /*
    * This is a duplicate of the termio structure found in <termio.h>.
    * This header file no longer includes <termio.h> in order to allow
    * curses users to include either <termio.h> or <termios.h> in their
    * code without having any problems.
    */
# ifndef _CURS_SGTTY
#  define _CURS_SGTTY
     typedef struct {
         unsigned short c_iflag;	/* input modes		*/
         unsigned short c_oflag;	/* output modes		*/
         unsigned short c_cflag;	/* control modes	*/
         unsigned short c_lflag;	/* line discipline modes*/
         char 		c_line;		/* line discipline	*/
	 unsigned char	c_cc[8];	/* control chars	*/
     } SGTTY;
# endif /* _CURS_SGTTY */
#  else
#   include <sgtty.h>
# ifndef _CURS_SGTTY
#  define _CURS_SGTTY
    typedef struct sgttyb SGTTY;
# endif /* _CURS_SGTTY */
				/* THIS TYPEDEF IS DUPLICATED IN TERM.H */
#  endif
# else		/* NONSTANDARD */
/*
 * NONSTANDARD is intended for a standalone program (no UNIX)
 * that manages screens.  The specific program is Alan Hewett's
 * ITC, which runs standalone on an 11/23 (at least for now).
 * It is unclear whether this code needs to be supported anymore.
 */
#ifndef __NULL_INCLUDED
#include <sys/_null.h>
#endif /* __NULL_INCLUDED */

# endif		/* NONSTANDARD */

# define	bool	char
# define	reg	register

/*
 * chtype is the type used to store a character together with attributes.
 * It can be set to "char" to save space, or "long" to get more attributes.
 */
# ifdef	CHTYPE
	typedef	CHTYPE chtype;
# else
	typedef unsigned int chtype;
# endif /* CHTYPE */

#ifndef TRUE
# define	TRUE	(1)
#endif /* !TRUE */

#ifndef FALSE
# define	FALSE	(0)
#endif /* !FALSE */

# define	ERR	(-1)
# define	OK	(0)

# define	_SUBWIN		01
# define	_ENDLINE	02
# define	_FULLWIN	04
# define	_SCROLLWIN	010
# define	_FLUSH		020
# define	_ISPAD		040
# define	_STANDOUT	0200
# define	_HASSUBWIN	0400

# define	_NOCHANGE	-1

struct _win_st {
	short	_cury, _curx;
	short	_maxy, _maxx;
	short	_begy, _begx;
	short	_flags;
	chtype	_attrs;
	bool	_clear;
	bool	_leave;
	bool	_scroll;
	bool	_use_idl;
	bool	_use_keypad;	/* 0=no, 1=yes, 2=yes/timeout */
	bool	_use_meta;	/* T=use the meta key */
	bool	_nodelay;	/* T=don't wait for tty input */
	chtype	**_y;
	short	*_firstch;
	short	*_lastch;
	short	_tmarg,_bmarg;
#ifdef  SIGWINCH
        short   _allocy, _allocx;  /* size allocated for the window */
#endif
};

extern int	LINES, COLS;

typedef struct _win_st	WINDOW;
extern WINDOW	*stdscr, *curscr;

extern char	*Def_term, ttytype[];

typedef struct screen	SCREEN;

#if defined(__STDC__) || defined(__cplusplus)
  extern int attroff(int);
  extern int attron(int);
  extern int attrset(int);
  extern int baudrate(void);
  extern int beep(void);
  extern int box (WINDOW *, chtype, chtype);
  extern int cbreak(void);
  extern int clearok(WINDOW *, int);
  extern int clrtobot(void);
  extern int clrtoeol(void);
  extern int def_prog_mode(void);
  extern int def_shell_mode(void);
  extern int delay_output(int);
  extern int delwin(WINDOW *);
  extern int doupdate(void);
  extern int draino(int);
  extern int echo(void);
  extern int endwin(void);
  extern char erasechar(void);
  extern int fixterm(void);
  extern int flash(void);
  extern int flushinp(void);
  extern int gettmode(void);
  extern int has_ic(void);
  extern int has_il(void);
  extern int idlok(WINDOW *, int);
  extern WINDOW * initscr(void);
  extern int insch(chtype);
  extern int intrflush(WINDOW *, int);
  extern int keypad(WINDOW *, int);
  extern char killchar(void);
  extern int leaveok(WINDOW *, int);
  extern char * longname(void);
  extern int meta(WINDOW *, int);
  extern int mvcur(int, int, int, int);
  extern int mvprintw(int, int, const char *, ...);
  extern int mvscanw(int, int, const char *, ...);
  extern int mvwin(WINDOW *, int, int);
  extern int mvwprintw(WINDOW *, int, int, const char *, ...);
  extern int mvwscanw(WINDOW *, int, int, const char *, ...);
  extern WINDOW * newpad(int, int);
  extern SCREEN * newterm(const char *, FILE *, FILE *);
  extern WINDOW * newwin(int, int, int, int);
  extern int nl(void);
  extern int nocbreak(void);
  extern int nodelay(WINDOW *, int);
  extern int noecho(void);
  extern int nonl(void);
  extern int noraw(void);
  extern int m_addch(chtype);
  extern int m_addstr(const char *);
  extern int m_clear(void);
  extern int m_erase(void);
  extern WINDOW * m_initscr(void);
  extern int m_move(int, int);
  extern SCREEN * m_newterm(const char *, FILE *, FILE *);
  extern int m_refresh(void);
  extern int overlay(WINDOW *, WINDOW *);
  extern int overwrite(WINDOW *, WINDOW *);
  extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
  extern int prefresh(WINDOW *, int, int, int, int, int, int);
  extern int printw(const char *, ...);
  extern int raw(void);
  extern int resetterm(void);
  extern int resetty(void);
  extern int reset_prog_mode(void);
  extern int reset_shell_mode(void);
  extern int saveterm(void);
  extern int savetty(void);
  extern int scanw(const char *, ...);
  extern int scroll(WINDOW *);
  extern int scrollok(WINDOW *, char);
  extern SCREEN * set_term(SCREEN *);
  extern int setterm(const char *);
  extern int setupterm(const char *, int, int *);
  extern WINDOW * subwin(WINDOW *, int, int, int, int);
  extern int touchwin(WINDOW *);
  extern int traceoff(void);
  extern int traceon(void);
  extern int typeahead(int);
  extern int waddch(WINDOW *, chtype);
  extern int waddstr(WINDOW *, const char *);
  extern int wattroff(WINDOW *, int);
  extern int wattron(WINDOW *, int);
  extern int wattrset(WINDOW *, int);
  extern int wclear(WINDOW *);
  extern int wclrtobot(WINDOW *);
  extern int wclrtoeol(WINDOW *);
  extern int wdelch(WINDOW *);
  extern int wdeleteln(WINDOW *);
  extern int werase(WINDOW *);
  extern int wgetch(WINDOW *);        /* because it can return KEY_*, for 
					 instance */
  extern int wgetstr(WINDOW *, char *);
  extern int winsch(WINDOW *, chtype);
  extern int winsertln(WINDOW *);
  extern int wmove(WINDOW *, int, int);
  extern int wnoutrefresh(WINDOW *);
  extern int wprintw(WINDOW *, const char *, ...);
  extern int wrefresh(WINDOW *);
  extern int wscanw(WINDOW *, const char *, ...);
  extern int wstandend(WINDOW *);
  extern int wstandout(WINDOW *);
  extern char *tparm(const char *, ...);
  extern int tputs(const char *, int, int(*)(char));
  extern int putp(const char *);
  extern int vidputs(int, int(*)(char));
  extern int vidattr(chtype);
  extern int tgetent(const char *, const char *);
  extern int tgetflag(const char *);
  extern int tgetnum(const char *);
  extern char * tgetstr(const char *, char **);
  extern char * tgoto(const char *, int, int);
#else /* not __STDC__ || __cplusplus */
   WINDOW * initscr();
   WINDOW * newwin();
   WINDOW * subwin();
   WINDOW * newpad();
   char	*longname();
   char	erasechar();
   char killchar();
   int wgetch();	/* because it can return KEY_*, for instance. */
   SCREEN * newterm();
#endif /* __STDC__ || __cplusplus */

# ifndef NOMACROS
#  ifndef MINICURSES
/*
 * psuedo functions for standard screen
 */
# define	addch(ch)	waddch(stdscr, ch)
# define	getch()		wgetch(stdscr)
# define	addstr(str)	waddstr(stdscr, str)
# define	getstr(str)	wgetstr(stdscr, str)
# define	move(y, x)	wmove(stdscr, y, x)
# define	clear()		wclear(stdscr)
# define	erase()		werase(stdscr)
# define	clrtobot()	wclrtobot(stdscr)
# define	clrtoeol()	wclrtoeol(stdscr)
# define	insertln()	winsertln(stdscr)
# define	deleteln()	wdeleteln(stdscr)
# define	refresh()	wrefresh(stdscr)
# define	inch()		winch(stdscr)
# define	insch(c)	winsch(stdscr,c)
# define	delch()		wdelch(stdscr)
# define	standout()	wstandout(stdscr)
# define	standend()	wstandend(stdscr)
# define	attron(at)	wattron(stdscr,at)
# define	attroff(at)	wattroff(stdscr,at)
# define	attrset(at)	wattrset(stdscr,at)

# define	setscrreg(t,b)	wsetscrreg(stdscr, t, b)
# define	wsetscrreg(win,t,b)	(win->_tmarg=(t),win->_bmarg=(b))

/*
 * mv functions
 */
#define	mvwaddch(win,y,x,ch)	(wmove(win,y,x)==ERR?ERR:waddch(win,ch))
#define	mvwgetch(win,y,x)	(wmove(win,y,x)==ERR?ERR:wgetch(win))
#define	mvwaddstr(win,y,x,str)	(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
#define	mvwgetstr(win,y,x,str)	(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
#define	mvwinch(win,y,x)	(wmove(win,y,x)==ERR?ERR:winch(win))
#define	mvwdelch(win,y,x)	(wmove(win,y,x)==ERR?ERR:wdelch(win))
#define	mvwinsch(win,y,x,c)	(wmove(win,y,x)==ERR?ERR:winsch(win,c))
#define	mvaddch(y,x,ch)		mvwaddch(stdscr,y,x,ch)
#define	mvgetch(y,x)		mvwgetch(stdscr,y,x)
#define	mvaddstr(y,x,str)	mvwaddstr(stdscr,y,x,str)
#define	mvgetstr(y,x,str)	mvwgetstr(stdscr,y,x,str)
#define	mvinch(y,x)		mvwinch(stdscr,y,x)
#define	mvdelch(y,x)		mvwdelch(stdscr,y,x)
#define	mvinsch(y,x,c)		mvwinsch(stdscr,y,x,c)

#define	winch(win)	 (win->_y[win->_cury][win->_curx])

#  else /* MINICURSES */

# define	addch(ch)		m_addch(ch)
# define	addstr(str)		m_addstr(str)
# define	move(y, x)		m_move(y, x)
# define	clear()			m_clear()
# define	erase()			m_erase()
# define	refresh()		m_refresh()
# define	getch()			m_getch()
# define	standout()		wstandout(stdscr)
# define	standend()		wstandend(stdscr)
# define	attron(at)		wattron(stdscr,at)
# define	attroff(at)		wattroff(stdscr,at)
# define	attrset(at)		wattrset(stdscr,at)
# define	mvaddch(y,x,ch)		move(y, x), addch(ch)
# define	mvaddstr(y,x,str)	move(y, x), addstr(str)
# define	initscr			m_initscr
# define	newterm			m_newterm

/*
 * These functions don't exist in minicurses, so we define them
 * to nonexistent functions to help the user catch the error.
 */
#define	getstr		m_getstr
#define	clrtobot	m_clrtobot
#define	clrtoeol	m_clrtoeol
#define	insertln	m_insertln
#define	deleteln	m_deleteln
#define	insch		m_insch
#define	delch		m_delch
#define	inch		m_inch
/* mv functions that aren't valid */
#define	mvwaddch	m_mvwaddch
#define	mvwgetch	m_mvwgetch
#define	mvwaddstr	m_mvaddstr
#define	mvwgetstr	m_mvwgetstr
#define	mvwinch		m_mvwinch
#define	mvwdelch	m_mvwdelch
#define	mvwinsch	m_mvwinsch
#define	mvgetch		m_mvwgetch
#define	mvgetstr	m_mvwgetstr
#define	mvinch		m_mvwinch
#define	mvdelch		m_mvwdelch
#define	mvinsch		m_mvwinsch
/* Real functions that aren't valid */
#define box		m_box
#define delwin		m_delwin
#define longname	m_longname
#define makenew		m_makenew
#define mvprintw	m_mvprintw
#define mvscanw		m_mvscanw
#define mvwin		m_mvwin
#define mvwprintw	m_mvwprintw
#define mvwscanw	m_mvwscanw
#define newwin		m_newwin
#define _outchar		m_outchar
#define overlay		m_overlay
#define overwrite	m_overwrite
#define printw		m_printw
#define putp		m_putp
#define scanw		m_scanw
#define scroll		m_scroll
#define subwin		m_subwin
#define touchwin	m_touchwin
#define _tscroll	m_tscroll
#define _tstp		m_tstp
#define vidattr		m_vidattr
#define waddch		m_waddch
#define waddstr		m_waddstr
#define wclear		m_wclear
#define wclrtobot	m_wclrtobot
#define wclrtoeol	m_wclrtoeol
#define wdelch		m_wdelch
#define wdeleteln	m_wdeleteln
#define werase		m_werase
#define wgetch		m_wgetch
#define wgetstr		m_wgetstr
#define winsch		m_winsch
#define winsertln	m_winsertln
#define wmove		m_wmove
#define wprintw		m_wprintw
#define wrefresh	m_wrefresh
#define wscanw		m_wscanw
#define setscrreg	m_setscrreg
#define wsetscrreg	m_wsetscrreg

#  endif /* MINICURSES */

/*
 * psuedo functions
 */

#define	getyx(win,y,x)	 y = win->_cury, x = win->_curx

/* NLS attributes */
#define A_FIRSTOF2	000000040000
#define A_SECOF2	000000100000

#define A_NLSATTR	000000177400

/* Various video attributes */
#define A_STANDOUT	000040000000
#define A_UNDERLINE	000100000000
#define A_REVERSE	000200000000
#define A_BLINK		000400000000
#define A_DIM		001000000000
#define A_BOLD		002000000000

/* The next three are subject to change (perhaps to colors) so don't depend on them */
#define A_INVIS		004000000000
#define A_PROTECT	010000000000
#define A_ALTCHARSET	020000000000

/* A_INVIS is documented as A_BLANK in curses(3x), System V PRM */
#define A_BLANK		A_INVIS

#define A_NORMAL	000000000000
#define A_ATTRIBUTES	037740000000
#define A_CHARTEXT	000000000377

/* Funny "characters" enabled for various special function keys for input */
#define KEY_BREAK	0401		/* break key (unreliable) */
#define KEY_DOWN	0402		/* The four arrow keys ... */
#define KEY_UP		0403
#define KEY_LEFT	0404
#define KEY_RIGHT	0405		/* ... */
#define KEY_HOME	0406		/* Home key (upward+left arrow) */
#define KEY_BACKSPACE	0407		/* backspace (unreliable) */
#define KEY_F0		0410		/* Function keys.  Space for 64 */
#define KEY_F(n)	(KEY_F0+(n))	/* keys is reserved. */
#define KEY_DL		0510		/* Delete line */
#define KEY_IL		0511		/* Insert line */
#define KEY_DC		0512		/* Delete character */
#define KEY_IC		0513		/* Insert char or enter insert mode */
#define KEY_EIC		0514		/* Exit insert char mode */
#define KEY_CLEAR	0515		/* Clear screen */
#define KEY_EOS		0516		/* Clear to end of screen */
#define KEY_EOL		0517		/* Clear to end of line */
#define KEY_SF		0520		/* Scroll 1 line forward */
#define KEY_SR		0521		/* Scroll 1 line backwards (reverse) */
#define KEY_NPAGE	0522		/* Next page */
#define KEY_PPAGE	0523		/* Previous page */
#define KEY_STAB	0524		/* Set tab */
#define KEY_CTAB	0525		/* Clear tab */
#define KEY_CATAB	0526		/* Clear all tabs */
#define KEY_ENTER	0527		/* Enter or send (unreliable) */
#define KEY_SRESET	0530		/* soft (partial) reset (unreliable) */
#define KEY_RESET	0531		/* reset or hard reset (unreliable) */
#define KEY_PRINT	0532		/* print or copy */
#define KEY_LL		0533		/* home down or bottom (lower left) */
					/* The keypad is arranged like this: */
					/*    a1    up    a3   */
					/*   left   b2  right  */
					/*    c1   down   c3   */
#define KEY_A1		0534		/* upper left of keypad */
#define KEY_A3		0535		/* upper right of keypad */
#define KEY_B2		0536		/* center of keypad */
#define KEY_C1		0537		/* lower left of keypad */
#define KEY_C3		0540		/* lower right of keypad */

#define KEY_BTAB	0541		/* back tab key*/

# endif /* NOMACROS */
#endif /* WINDOW */

#ifdef __cplusplus
}
#endif

#endif /* _CURSES_INCLUDED */

#else /* XOPEN header i.e. 
       !defined(_XOPEN_SOURCE_EXTENDED) || defined(__HP_CURSES) */

#ifdef IDENT
!#ident	"@(#)curses:common/lib/xlibcurses/screen/curses.ed	1.60.2.8"
!#ident "$Header: curses.h,v 76.4 95/08/14 08:05:55 ssa Exp $"

#endif /* IDENT */


#ifndef _CURSES_INCLUDED
#define _CURSES_INCLUDED	/* define prevents multiple includes */


#include <stdio.h>
#include <wchar.h>
#include <sys/_inttypes.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef uint32_t chtype;

					/* THE FOLLOWING 3 TYPEDEFS ARE
					   DUPLICATED IN TERM.H */
#ifndef _BOOL_DEFINED
#  if !defined(__cplusplus)
#     define _BOOL_DEFINED
      typedef char bool;
#  elif  __cplusplus < 199707L
#    define _BOOL_DEFINED
#    define bool char
#  endif /* !defined(__cplusplus) */
#endif /* _BOOL_DEFINED */


#ifndef _ATTR_T_DEFINED
#       define _ATTR_T_DEFINED
typedef int32_t        attr_t;
#endif /* _ATTR_T_DEFINED */

#ifndef _CCHAR_T_DEFINED
#       define _CCHAR_T_DEFINED
typedef struct { char __reserved[28]; } cchar_t;
#endif /* _CCHAR_T_DEFINED */


/* TRUE and FALSE get defined so many times, */
/* let's not get in the way of other definitions. */
#if	!defined(TRUE) || ((TRUE) != 1)
#ifdef TRUE
#undef TRUE
#endif
#define	TRUE	(1)
#endif
#if	!defined(FALSE) || ((FALSE) != 0)
#ifdef FALSE
#undef FALSE
#endif
#define	FALSE	(0)
#endif
#if	!defined(ERR) || ((ERR) != -1)
#ifdef ERR
#undef ERR
#endif
#define	ERR	(-1)
#endif
#if	!defined(OK) || ((OK) != 0)
#ifdef OK
#undef OK
#endif
#define	OK	(0)
#endif

/* short-hand notations */

struct __reserved_str1
{
        int 		__reserved;	/* no user space */
	                                /* used to allow for pointer */
};

struct __reserved_str2
{
        int 		__reserved;	/* no user space */
	                                /* used to allow for pointer */
};

typedef struct __reserved_str1	WINDOW;
typedef struct __reserved_str2	SCREEN;


/* common external variables */

extern	int	LINES, COLS, COLORS, COLOR_PAIRS;

extern	WINDOW	*stdscr, *curscr;

extern	char	ttytype[];

extern	cchar_t	__wacs_map[];


#ifdef _ACS_COMPAT_CODE

extern	chtype	acs_map[];
#define __acs_map acs_map
#else

extern	chtype	__acs_map[];

#endif /* _ACS_COMPAT_CODE */




/* Common definitions    */

/*
 * Standard alternate character set.  The current ACS world is evolving,
 * so we support only a widely available subset: the line drawing characters
 * from the VT100, plus a few from the Teletype 5410v1.  Eventually there
 * may be support of more sophisticated ACS line drawing, such as that
 * in the Teletype 5410, the HP line drawing set, and the like.  There may
 * be support for some non line oriented characters as well.
 *
 * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
 * is the right, b is the bottom, and l is the left.  t, r, b, and l might
 * be B (blank), S (single), D (double), or T (thick).  The subset defined
 * here only uses B and S.
 */

#define WACS_BSSB	(&(__wacs_map['l']))
#define WACS_SSBB	(&(__wacs_map['m']))
#define WACS_BBSS	(&(__wacs_map['k']))
#define WACS_SBBS	(&(__wacs_map['j']))
#define WACS_SBSS	(&(__wacs_map['u']))
#define WACS_SSSB	(&(__wacs_map['t']))
#define WACS_SSBS	(&(__wacs_map['v']))
#define WACS_BSSS	(&(__wacs_map['w']))
#define WACS_BSBS	(&(__wacs_map['q']))
#define WACS_SBSB	(&(__wacs_map['x']))
#define WACS_SSSS	(&(__wacs_map['n']))

#define ACS_BSSB	(__acs_map['l'])
#define ACS_SSBB	(__acs_map['m'])
#define ACS_BBSS	(__acs_map['k'])
#define ACS_SBBS	(__acs_map['j'])
#define ACS_SBSS	(__acs_map['u'])
#define ACS_SSSB	(__acs_map['t'])
#define ACS_SSBS	(__acs_map['v'])
#define ACS_BSSS	(__acs_map['w'])
#define ACS_BSBS	(__acs_map['q'])
#define ACS_SBSB	(__acs_map['x'])
#define ACS_SSSS	(__acs_map['n'])

/*
 * Human readable names for the most commonly used characters.
 * "Upper", "right", etc. are chosen to be consistent with the vt100 manual.
 */

#define WACS_ULCORNER	WACS_BSSB
#define WACS_LLCORNER	WACS_SSBB
#define WACS_URCORNER	WACS_BBSS
#define WACS_LRCORNER	WACS_SBBS
#define WACS_RTEE	WACS_SBSS
#define WACS_LTEE	WACS_SSSB
#define WACS_BTEE	WACS_SSBS
#define WACS_TTEE	WACS_BSSS
#define WACS_HLINE	WACS_BSBS
#define WACS_VLINE	WACS_SBSB
#define WACS_PLUS	WACS_SSSS

#define ACS_ULCORNER	ACS_BSSB
#define ACS_LLCORNER	ACS_SSBB
#define ACS_URCORNER	ACS_BBSS
#define ACS_LRCORNER	ACS_SBBS
#define ACS_RTEE	ACS_SBSS
#define ACS_LTEE	ACS_SSSB
#define ACS_BTEE	ACS_SSBS
#define ACS_TTEE	ACS_BSSS
#define ACS_HLINE	ACS_BSBS
#define ACS_VLINE	ACS_SBSB
#define ACS_PLUS	ACS_SSSS

#define WACS_S1		(&(__wacs_map['o'])) /* scan line 1 */
#define WACS_S9 	(&(__wacs_map['s'])) /* scan line 9 */
#define WACS_DIAMOND	(&(__wacs_map['`'])) /* diamond */
#define WACS_CKBOARD	(&(__wacs_map['a'])) /* checker board */
#define WACS_DEGREE	(&(__wacs_map['f'])) /* degree symbol */
#define WACS_PLMINUS	(&(__wacs_map['g'])) /* plus/minus */
#define WACS_BULLET	(&(__wacs_map['~'])) /* bullet */

#define ACS_S1		(__wacs_map['o']) /* scan line 1 */
#define ACS_S9 	 	(__wacs_map['s']) /* scan line 9 */
#define ACS_DIAMOND	(__wacs_map['`']) /* diamond */
#define ACS_CKBOARD	(__wacs_map['a']) /* checker board */
#define ACS_DEGREE	(__wacs_map['f']) /* degree symbol */
#define ACS_PLMINUS	(__wacs_map['g']) /* plus/minus */
#define ACS_BULLET	(__wacs_map['~']) /* bullet */



	/* Teletype 5410v1 symbols */
#define WACS_LARROW	(&(__wacs_map[','])) /* arrow left */
#define WACS_RARROW	(&(__wacs_map['+'])) /* arrow right */
#define WACS_DARROW	(&(__wacs_map['.'])) /* arrow down */
#define WACS_UARROW	(&(__wacs_map['-'])) /* arrow up */
#define WACS_BOARD	(&(__wacs_map['h'])) /* board of squares */
#define WACS_LANTERN	(&(__wacs_map['i'])) /* lantern symbol */
#define WACS_BLOCK	(&(__wacs_map['0'])) /* solid square block */

#define ACS_LARROW	(__wacs_map[',']) /* arrow left */
#define ACS_RARROW	(__wacs_map['+']) /* arrow right */
#define ACS_DARROW	(__wacs_map['.']) /* arrow down */
#define ACS_UARROW	(__wacs_map['-']) /* arrow up */
#define ACS_BOARD	(__wacs_map['h']) /* board of squares */
#define ACS_LANTERN	(__wacs_map['i']) /* lantern symbol */
#define ACS_BLOCK	(__wacs_map['0']) /* solid square block */

/* Key code returns when enabled for various special function keys for input */

#define KEY_CODE_YES	0377		/* A key was returned */
#define KEY_MIN		0401		/* Minimum curses key */
#define KEY_BREAK	0401		/* break key (unreliable) */
#define KEY_DOWN	0402		/* Sent by terminal down arrow key */
#define KEY_UP		0403		/* Sent by terminal up arrow key */
#define KEY_LEFT	0404		/* Sent by terminal left arrow key */
#define KEY_RIGHT	0405		/* Sent by terminal right arrow key */
#define KEY_HOME	0406		/* Sent by home key. */
#define KEY_BACKSPACE	0407		/* Sent by backspace key */
#define KEY_F0		0410		/* function key f0. */
#define KEY_F(__n)	(KEY_F0+(__n))	/* Space for 64 function keys is reserved. */
#define KEY_DL		0510		/* Sent by delete line key. */
#define KEY_IL		0511		/* Sent by insert line. */
#define KEY_DC		0512		/* Sent by delete character key. */
#define KEY_IC		0513		/* Sent by ins char/enter ins mode key. */
#define KEY_EIC		0514		/* Sent by rmir or smir in insert mode. */
#define KEY_CLEAR	0515		/* Sent by clear screen or erase key. */
#define KEY_EOS		0516		/* Sent by clear-to-end-of-screen key. */
#define KEY_EOL		0517		/* Sent by clear-to-end-of-line key. */
#define KEY_SF		0520		/* Sent by scroll-forward/down key */
#define KEY_SR		0521		/* Sent by scroll-backward/up key */
#define KEY_NPAGE	0522		/* Sent by next-page key */
#define KEY_PPAGE	0523		/* Sent by previous-page key */
#define KEY_STAB	0524		/* Sent by set-tab key */
#define KEY_CTAB	0525		/* Sent by clear-tab key */
#define KEY_CATAB	0526		/* Sent by clear-all-tabs key. */
#define KEY_ENTER	0527		/* Enter/send (unreliable) */
#define KEY_SRESET	0530		/* soft (partial) reset (unreliable) */
#define KEY_RESET	0531		/* reset or hard reset (unreliable) */
#define KEY_PRINT	0532		/* print or copy */
#define KEY_LL		0533		/* Sent by home-down key */
					/* The keypad is arranged like this: */
					/*    a1    up    a3   */
					/*   left   b2  right  */
					/*    c1   down   c3   */
#define KEY_A1		0534		/* Upper left of keypad */
#define KEY_A3		0535		/* Upper right of keypad */
#define KEY_B2		0536		/* Center of keypad */
#define KEY_C1		0537		/* Lower left of keypad */
#define KEY_C3		0540		/* Lower right of keypad */
#define KEY_BTAB	0541		/* Back tab key */
#define KEY_BEG		0542		/* beg(inning) key */
#define KEY_CANCEL	0543		/* cancel key */
#define KEY_CLOSE	0544		/* close key */
#define KEY_COMMAND	0545		/* cmd (command) key */
#define KEY_COPY	0546		/* copy key */
#define KEY_CREATE	0547		/* create key */
#define KEY_END		0550		/* end key */
#define KEY_EXIT	0551		/* exit key */
#define KEY_FIND	0552		/* find key */
#define KEY_HELP	0553		/* help key */
#define KEY_MARK	0554		/* mark key */
#define KEY_MESSAGE	0555		/* message key */
#define KEY_MOVE	0556		/* move key */
#define KEY_NEXT	0557		/* next object key */
#define KEY_OPEN	0560		/* open key */
#define KEY_OPTIONS	0561		/* options key */
#define KEY_PREVIOUS	0562		/* previous object key */
#define KEY_REDO	0563		/* redo key */
#define KEY_REFERENCE	0564		/* ref(erence) key */
#define KEY_REFRESH	0565		/* refresh key */
#define KEY_REPLACE	0566		/* replace key */
#define KEY_RESTART	0567		/* restart key */
#define KEY_RESUME	0570		/* resume key */
#define KEY_SAVE	0571		/* save key */
#define KEY_SBEG	0572		/* shifted beginning key */
#define KEY_SCANCEL	0573		/* shifted cancel key */
#define KEY_SCOMMAND	0574		/* shifted command key */
#define KEY_SCOPY	0575		/* shifted copy key */
#define KEY_SCREATE	0576		/* shifted create key */
#define KEY_SDC		0577		/* shifted delete char key */
#define KEY_SDL		0600		/* shifted delete line key */
#define KEY_SELECT	0601		/* select key */
#define KEY_SEND	0602		/* shifted end key */
#define KEY_SEOL	0603		/* shifted clear line key */
#define KEY_SEXIT	0604		/* shifted exit key */
#define KEY_SFIND	0605		/* shifted find key */
#define KEY_SHELP	0606		/* shifted help key */
#define KEY_SHOME	0607		/* shifted home key */
#define KEY_SIC		0610		/* shifted input key */
#define KEY_SLEFT	0611		/* shifted left arrow key */
#define KEY_SMESSAGE	0612		/* shifted message key */
#define KEY_SMOVE	0613		/* shifted move key */
#define KEY_SNEXT	0614		/* shifted next key */
#define KEY_SOPTIONS	0615		/* shifted options key */
#define KEY_SPREVIOUS	0616		/* shifted prev key */
#define KEY_SPRINT	0617		/* shifted print key */
#define KEY_SREDO	0620		/* shifted redo key */
#define KEY_SREPLACE	0621		/* shifted replace key */
#define KEY_SRIGHT	0622		/* shifted right arrow */
#define KEY_SRSUME	0623		/* shifted resume key */
#define KEY_SSAVE	0624		/* shifted save key */
#define KEY_SSUSPEND	0625		/* shifted suspend key */
#define KEY_SUNDO	0626		/* shifted undo key */
#define KEY_SUSPEND	0627		/* suspend key */
#define KEY_UNDO	0630		/* undo key */
#define KEY_MOUSE	0631		/* Mouse event has occured */
#define KEY_MAX		0777		/* Maximum curses key */

/* Various video attributes */
#define A_STANDOUT	000000200000L
#define A_UNDERLINE	000000400000L
#define A_REVERSE	000001000000L
#define A_BLINK		000002000000L
#define A_DIM		000004000000L
#define A_BOLD		000010000000L
#define A_INVIS		000020000000L
#define A_PROTECT	000040000000L
#define A_ALTCHARSET	000100000000L

#define WA_HORIZONTAL	000000100000L
#define WA_LEFT		000000040000L
#define WA_LOW		000000020000L
#define WA_RIGHT	000000010000L
#define WA_TOP		000000004000L
#define WA_VERTICAL	000000002000L
#define WA_STANDOUT	A_STANDOUT
#define WA_UNDERLINE	A_UNDERLINE
#define WA_REVERSE	A_REVERSE
#define WA_BLINK	A_BLINK
#define WA_DIM		A_DIM
#define WA_BOLD		A_BOLD
#define WA_INVIS	A_INVIS
#define WA_PROTECT	A_PROTECT
#define WA_ALTCHARSET	A_ALTCHARSET



#define A_NORMAL	000000000000L
#define WA_NORMAL	A_NORMAL
#define A_CHARTEXT	000000000377L	/* 0x000000FF */
#define A_COLOR		017600000000L
#define A_ATTRIBUTES	( A_STANDOUT|A_UNDERLINE|A_REVERSE|A_BLINK|A_DIM|A_BOLD|A_INVIS|A_PROTECT|A_ALTCHARSET|A_COLOR )

/* definition of 8 basic color	*/
#ifdef __hpux
#define COLOR_BLACK	0
#define COLOR_BLUE	1
#define COLOR_GREEN	2
#define COLOR_CYAN	3
#define COLOR_RED	4
#define COLOR_MAGENTA	5
#define COLOR_YELLOW	6
#define COLOR_WHITE	7
#else /* !__hpux */
#define COLOR_BLACK	0
#define COLOR_RED	1
#define COLOR_GREEN	2
#define COLOR_YELLOW	3
#define COLOR_BLUE	4
#define COLOR_MAGENTA	5
#define COLOR_CYAN	6
#define COLOR_WHITE	7
#endif /* __hpux */




/* Function declarations */

/* 
 * Macro only Functions to get at the window structure.
 */

#define getsyx(__y,__x)		__getsyx(&(__y),&(__x))

#define getyx(__win,__y,__x)	{ WINDOW *__wi; \
				 __wi = __win; ((__y) = __getcury(__wi), \
				 (__x) = __getcurx(__wi)); }
#define	getbegyx(__win,__y,__x)	{ WINDOW *__wi; \
				 __wi = __win; ((__y) = __getbegy(__wi), \
				 (__x) = __getbegx(__wi)); }
#define	getmaxyx(__win,__y,__x)	{ WINDOW *__wi; \
				  __wi = __win; ((__y) = __getmaxy(__wi), \
				 (__x) = __getmaxx(__wi)); }
#define	getparyx(__win,__y,__x)	{ WINDOW *__wi; \
				 __wi = __win; ((__y) = __getpary(__wi), \
				 (__x) = __getparx(__wi)); }


#if defined(__STDC__) || defined(__cplusplus)

extern	SCREEN	*newscreen(char *, int, int, int, FILE *, FILE *);
extern	SCREEN	*setcurscreen(SCREEN *);

extern	WINDOW	*initscr(void);
extern	WINDOW	*newwin(int, int, int, int);
extern	WINDOW	*newpad(int, int);
extern	WINDOW	*derwin(WINDOW *, int, int, int, int);
extern	WINDOW	*dupwin(WINDOW *);
extern	WINDOW	*getwin(FILE *);

extern	int	wgetch(WINDOW *); /* it can return KEY_*, for instance. */

extern	char	*longname(void);	/* long name of terminal */
extern	char	*termname(void);	/* effective terminal name */
extern	char	*keyname(int); 	/* name of token returned by wgetch() */
extern	char	*slk_label(int);
extern	char	erasechar(void);
extern	char	killchar(void);
extern	char	*unctrl(int);

extern	chtype	termattrs(void);
extern	attr_t	term_attrs(void);

extern	int	vid_attr(attr_t, short, void *);
extern	int	vid_puts(attr_t, short, void *, int (*)(int));
extern	void	vidupdate(chtype, chtype, void (*)(int));
extern	void	wsyncup(WINDOW *);
extern	void	wsyncdown(WINDOW *);
extern	void	delscreen(SCREEN *);
extern	void	curserr(void);
extern	void	wcursyncup(WINDOW *);

extern	int	cbreak(void);
extern	int	nocbreak(void);
extern	int	reset_prog_mode(void);
extern	int	reset_shell_mode(void);
extern	int	def_prog_mode(void);
extern	int	def_shell_mode(void);
extern	int	raw(void);
extern	int	savetty(void);
extern	int	noraw(void);
extern	int	flushinp(void);
extern	int	__getsyx(int *, int *);
extern	int	resetty(void);
extern	int	ripoffline(int, int (*)(WINDOW *, int));
extern	int	setsyx(int, int);
extern	int	slk_refresh(void);
extern	int	slk_restore(void);
extern	int	wstandend(WINDOW *);
extern	int	wstandout(WINDOW *);
extern	int	wattroff(WINDOW *, chtype);
extern	int	wattron(WINDOW *, chtype);
extern	int	wattrset(WINDOW *, chtype);
extern	int	wrefresh(WINDOW *);

extern	int	copywin(WINDOW *, WINDOW *, int, int, int, int, int, int, int);
extern	int	curs_set(int);
extern	int	delay_output(int);
extern	int	delwin(WINDOW *);
extern	int	doupdate(void);
extern	int	draino(int);
extern	int	endwin(void);
extern	bool    isendwin(void);
extern	int	baudrate(void);
extern	bool    has_ic(void);
extern	bool	has_il(void);
extern	int	keypad(WINDOW *, int);
extern	int	mvcur(int, int, int, int);

extern	int	mvprintw(int, int, ...);
extern	int	mvscanw(int, int, ...);
extern	int	mvwprintw(WINDOW *, int, int, ...);
extern	int	mvwscanw(WINDOW *, int, int, ...);
extern	int	printw(char *, ...);
extern	int	scanw(char *, ...);
extern	int	wprintw(WINDOW *, ...);
extern	int	wscanw(WINDOW *, ...);

#if defined(_XOPEN_SOURCE_EXTENDED)
extern	int	vw_printw(WINDOW *, char *, va_list);	/* To Be Withdrawn */
extern	int	vw_scanw(WINDOW *, char *, va_list);	/* To Be Withdrawn */
extern	int	vwprintw(WINDOW *, char *, va_list);
extern	int	vwscanw(WINDOW *, char *, va_list);
#endif

extern	int	mvwin(WINDOW *, int, int);
extern	int	mvderwin(WINDOW *, int, int);
extern	int	napms(int);
extern	int	newkey(char *, int, int);
extern	int	pechochar(WINDOW *, chtype);
extern	int	pnoutrefresh(WINDOW *, int, int, int, int, int, int);
extern	int	prefresh(WINDOW *, int, int, int, int, int, int);

extern	void	filter(void);

extern	int	putwin(WINDOW *, FILE *);
extern	int     wredrawln(WINDOW *, int, int);
extern	int     scr_dump(const char *);
extern	int     setupterm(char *, int, int *);

extern	int	slk_attron(const chtype);
extern	int	slk_attroff(const chtype);
extern	int	slk_attrset(const chtype);
extern	int	slk_clear(void);
extern	int	slk_noutrefresh(void);
extern	int	slk_set(int, const char *, int);
extern	int	slk_start(int, int *);
extern	int	slk_touch(void);
extern	int	start_color(void);
extern	int	typeahead(int);

extern	bool	can_change_color(void);
extern	bool	has_colors(void);
		
extern	int	waddch(WINDOW *, const chtype);
extern	int	waddchnstr(WINDOW *, const chtype *, const int);
extern	int	waddnstr(WINDOW *, const char *, const int);
extern	int	wbkgd(WINDOW *, const chtype);
extern	int	wborder(WINDOW *, const chtype, const chtype, const chtype, const chtype,
				  const chtype, const chtype, const chtype, const chtype);
extern	int	wclrtobot(WINDOW *);
extern	int	wclrtoeol(WINDOW *);
extern	int	wdelch(WINDOW *);
extern	int	wechochar(WINDOW *, const chtype);
extern	int	wgetstr(WINDOW *, char *);
extern	int	wgetnstr(WINDOW *, char *, int);
extern	int	whline(WINDOW *, chtype, int);
extern	int	wvline(WINDOW *, chtype, int);
extern	int	winchnstr(WINDOW *, chtype *, int);
extern	int	winchstr(WINDOW *, chtype *);
extern	int	winnstr(WINDOW *, char *, int);
extern	int	winsch(WINDOW *, chtype);
extern	int	winsdelln(WINDOW *, int);
extern	int	winsnstr(WINDOW *, const char *, int);
extern	int	winstr(WINDOW *, char *);
extern	int	wmove(WINDOW *, const int, const int);
extern	int	wnoutrefresh(WINDOW *);
extern	int	wredrawln(WINDOW *, int, int);
extern	int	wscrl(WINDOW *, int);
extern	int	wsetscrreg(WINDOW *, int, int);
extern	int	wtouchln(WINDOW *, int, int, int);

extern	int	crmode(void);
extern	int	nocrmode(void);
extern	int	ungetch(int);
extern  int     unget_wch(const wchar_t);

extern	int	pair_content(short, short *, short *);
extern	int	color_content(short, short *, short *, short *);
extern	int	init_color(short, short, short, short);
extern	int	init_pair(short, short, short);
extern	int	idlok(WINDOW *, bool);

extern	void	immedok(WINDOW *, bool); 

extern	chtype	winwch(WINDOW *);

extern	int	pechowchar(WINDOW *, chtype);
extern	int	ungetwch(const wchar_t);
extern	int	waddnwstr(WINDOW *, const wchar_t *, const int);
extern	int	waddwch(WINDOW *, chtype);
extern	int	waddwchnstr(WINDOW *, chtype *, const int);
extern	int	wechowchar(WINDOW *, chtype);
extern	int	wgetnwstr(WINDOW *, wchar_t *, int);
extern	int	wgetwch(WINDOW *);
extern	int	wgetwstr(WINDOW *, wchar_t *);
extern	int	winnwstr(WINDOW *, wchar_t *, int);
extern	int	winsnwstr(WINDOW *, const wchar_t *, int);
extern	int	winswch(WINDOW *, chtype);
extern	int	winwchnstr(WINDOW *, chtype *, int);
extern	int	winwstr(WINDOW *, wchar_t *);

extern	int	add_wch(const cchar_t *);	
extern	int	win_wch(WINDOW *, cchar_t *);
extern	int	wadd_wch(WINDOW *, const cchar_t *);
extern	int	mvadd_wch(const int, const int, const cchar_t *);
extern	int	mvwadd_wch(WINDOW *, const int, const int, const cchar_t *);
extern	int	add_wchnstr(const cchar_t *, const int);
extern	int	add_wchstr(const cchar_t *);
extern	int	wadd_wchnstr(WINDOW *, const cchar_t *, const int);
extern	int	wadd_wchstr(WINDOW *, const cchar_t *);
extern	int	mvadd_wchnstr(const int, const int, const cchar_t *, const int);
extern	int	mvadd_wchstr(const int, const int, const cchar_t *);
extern	int	mvwadd_wchnstr(WINDOW *, const int, const int, const cchar_t *, const int);
extern	int	mvwadd_wchstr(WINDOW *, const int, const int, const cchar_t *);
extern	void	bkgrndset(const cchar_t *);
extern	int	bkgrnd(const cchar_t *);
extern	int	getbkgrnd(cchar_t *);
extern	int	wbkgrnd(WINDOW *, const cchar_t *);
extern	void	wbkgrndset(WINDOW *, const cchar_t *);
extern	int	wgetbkgrnd(WINDOW *, cchar_t *);
extern	int	border_set(const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *);
extern	int	wborder_set(WINDOW *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *, const cchar_t *);
extern	int	box_set(WINDOW *, const cchar_t *, const cchar_t *);
extern	int	hline_set(const cchar_t *, const int);
extern	int	mvhline_set(const int, const int, const cchar_t *, const int);
extern	int	mvvline_set(const int, const int, const cchar_t *, const int);
extern	int	mvwhline_set(WINDOW *, const int, const int, const cchar_t *, const int);
extern	int	mvwvline_set(WINDOW *, const int, const int, const cchar_t *, const int);
extern	int	whline_set(WINDOW *, const cchar_t *, const int);
extern	int	vline_set(const cchar_t *, const int);
extern	int	wvline_set(WINDOW *, const cchar_t *, const int);
extern	int	pecho_wchar(WINDOW *, const cchar_t*);
extern	int	setcchar(cchar_t*, const wchar_t*, const attr_t, const short, const void*);
extern	int	echo_wchar(const cchar_t *);
extern	int	wecho_wchar(WINDOW *, const cchar_t *);
extern	int	wget_wch(WINDOW *, wchar_t *);
extern	int	wget_wstr(WINDOW *, wchar_t *);
extern	int	wgetn_wstr(WINDOW *, wchar_t *, int);
extern	int	wins_wch(WINDOW *, const cchar_t *);

extern	int	__getcury(WINDOW *);
extern	int	__getcurx(WINDOW *);
extern	int	__getbegy(WINDOW *);
extern	int	__getbegx(WINDOW *);
extern	int	__getmaxy(WINDOW *);
extern	int	__getmaxx(WINDOW *);
extern	int	__getpary(WINDOW *);
extern	int	__getparx(WINDOW *);

extern	chtype	getbkgd(WINDOW *), getattrs(WINDOW *);

extern  int     wins_nwstr(WINDOW *, const wchar_t *, int);
extern  int     win_wchnstr(WINDOW *, cchar_t *, int);


#else /* defined(__STDC__) || defined(__cplusplus) */

extern	SCREEN	*newscreen();
extern	SCREEN	*setcurscreen();

extern	WINDOW	*initscr();
extern	WINDOW	*newwin();
extern	WINDOW	*newpad();
extern	WINDOW	*derwin();
extern	WINDOW	*dupwin();
extern	WINDOW	*getwin();

extern	int	wgetch();

extern	char	*longname();		/* long name of terminal */
extern	char	*termname();		/* effective terminal name */
extern	char	*keyname();	 	/* name of token returned by wgetch() */
extern	char	*slk_label();
extern	char	erasechar();
extern	char	killchar();
extern	char	*unctrl();

extern	chtype	termattrs();
extern	attr_t	term_attrs();

extern	int	vid_attr();
extern	int	vid_puts();
extern	void	vidupdate();
extern	void	wsyncup();
extern	void	wsyncdown();
extern	void	delkeymap();
extern	void	delscreen();
extern	void	curserr();
extern	void	immedok();
extern	void	wcursyncup();

extern	int	cbreak();
extern	int	nocbreak();
extern	int	reset_prog_mode();
extern	int	reset_shell_mode();
extern	int	def_prog_mode();
extern	int	def_shell_mode();
extern	int	raw();
extern	int	savetty();
extern	int	noraw();
extern	int	flushinp();
extern	int	__getsyx();
extern	int	resetty();
extern	int	ripoffline();
extern	int	setsyx();
extern	int	slk_refresh();
extern	int	slk_restore();
extern	int	wstandend();
extern	int	wstandout();
extern	int	wattroff();
extern	int	wattron();
extern	int	wattrset();
extern	int	wrefresh();

extern	int	color_content();
extern	int	copywin();
extern	int	curs_set();
extern	int	delay_output();
extern	int	delwin();
extern	int	doupdate();
extern	int	draino();
extern	int	endwin();
extern	int	baudrate();
extern	int	idlok();
extern	int	init_color();
extern	int	init_pair();
extern	int	keypad();
extern	int	mvcur();
extern	bool    has_ic();
extern	bool	has_il();
extern	int	isendwin();

extern	int	mvprintw();
extern	int	mvscanw();
extern	int	mvwprintw();
extern	int	mvwscanw();
extern	int	printw();
extern	int	scanw();
extern	int	wprintw();
extern	int	wscanw();
extern	int	vwprintw();
extern	int	vwscanw();

extern	int	mvwin();
extern	int	mvderwin();
extern	int	napms();
extern	int	newkey();
extern	int	pair_content();
extern	int	pechochar();
extern	int	pnoutrefresh();
extern	int	prefresh();

extern	void	filter();

extern	int	putwin();
extern	int	wredrawln();
extern	int	scr_dump();
extern	int	setupterm();

extern	int	slk_attrof();
extern	int	slk_attrof();
extern	int	slk_attrset();
extern	int	slk_clear();
extern	int	slk_noutrefresh();
extern	int	slk_set();
extern	int	slk_start();
extern	int	slk_touch();
extern	int	start_color();
extern	int	typeahead();

extern	bool	can_change_color();
extern	bool	has_colors();
		
extern	int	waddch();
extern	int	waddchnstr();
extern	int	waddnstr();
extern	int	wbkgd();
extern	int	wborder();
extern	int	wclrtobot();
extern	int	wclrtoeol();
extern	int	wdelch();
extern	int	wechochar();
extern	int	wgetstr();
extern	int	wgetnstr();
extern	int	whline();
extern	int	wvline();
extern	int	winchnstr();
extern	int	winchstr();
extern	int	winnstr();
extern	int	winsch();
extern	int	winsdelln();
extern	int	winsnstr();
extern  int     unget_wch();
extern	int	winstr();
extern	int	wmove();
extern	int	wnoutrefresh();
extern	int	wredrawln();
extern	int	wscrl();
extern	int	wsetscrreg();
extern	int	wtouchln();

extern	int	crmode();
extern	int	nocrmode();
extern	int	ungetch();

extern	chtype	winwch();

extern	int	pechowchar();
extern	int	ungetwch();
extern	int	waddnwstr();
extern	int	waddwch();
extern	int	waddwchnstr();
extern	int	wechowchar();
extern	int	wgetnwstr();
extern	int	wgetwch();
extern	int	wgetwstr();
extern	int	winnwstr();
extern	int	winsnwstr();
extern	int	winswch();
extern	int	winwchnstr();
extern	int	winwstr();

extern	int	add_wch();
extern	int	win_wch();
extern	int	add_wchnstr();
extern	int	add_wchstr();
extern	int	bkgrnd();
extern	int	border_set();
extern	int	box_set();
extern	int	echo_wchar();
extern	int	getbkgrnd();
extern	int	hline_set();
extern	int	mvadd_wch();
extern	int	mvadd_wchnstr();
extern	int	mvadd_wchstr();
extern	int	mvhline_set();
extern	int	mvvline_set();
extern	int	mvwadd_wch();
extern	int	mvwadd_wchnstr();
extern	int	mvwadd_wchstr();
extern	int	mvwhline_set();
extern	int	mvwvline_set();
extern	int	pecho_wchar();
extern	int	setcchar();
extern	int	vline_set();
extern	int	wadd_wch();
extern	int	wadd_wchnstr();
extern	int	wadd_wchstr();
extern	int	wbkgrnd();
extern	int	wborder_set();
extern	int	wecho_wchar();
extern	int	wget_wch();
extern	int	wget_wstr();
extern	int	wgetbkgrnd();
extern	int	wgetn_wstr();
extern	int	whline_set();
extern	int	wins_wch();
extern	int	wvline_set();
extern	void	bkgrndset();
extern	void	wbkgrndset();

extern	int	__getcury();
extern	int	__getcurx();
extern	int	__getbegy();
extern	int	__getbegx();
extern	int	__getmaxy();
extern	int	__getmaxx();
extern	int	__getpary();
extern	int	__getparx();

extern	chtype	getbkgd();
extern	chtype	getattrs();

extern  int     wins_nwstr();
extern  int     win_wchnstr();

#endif  /* defined(__STDC__) || defined(__cplusplus)  */

#if	defined(NOMACROS) || defined(lint)

#if defined__STDC__ || defined(__cplusplus)

extern	SCREEN	*newterm(char *, FILE *, FILE *);
extern	SCREEN	*set_term(SCREEN *);

extern	WINDOW	*subpad(WINDOW *, int, int, int, int);
extern	WINDOW	*subwin(WINDOW *, int, int, int, int);

extern	char	*unctrl(int);

extern	chtype	inch(void);
extern	chtype	winch(WINDOW *);
extern	chtype	mvinch(int, int);
extern	chtype	mvwinch(WINDOW *, int, int);

extern	int	addch(const chtype);
extern	int	addchnstr(const chtype *, const int);
extern	int	addchstr(const chtype *);
extern	int	addnstr(const char *, const int);
extern	int	addstr(const char *);
extern	int	attroff(chtype);
extern	int	attron(chtype);
extern	int	attrset(chtype);
extern	int	beep(void);
extern	int	bkgd(const chtype);
extern	int	border(const chtype, const chtype, const chtype, const chtype, const chtype, const chtype, const chtype, const chtype);
extern	int	box(WINDOW *, const chtype, const chtype);
extern	int	clear(void);
extern	int	clearok(WINDOW *, int);
extern	int	clrtobot(void);
extern	int	clrtoeol(void);
extern	int	crmode(void);
extern	int	delch(void);
extern	int	deleteln(void);
extern	int	echo(void);
extern	int	echochar(const chtype);
extern	int	erase(void);
extern	int	fixterm(void);
extern	int	flash(void);
extern	int	garbagedlines(WINDOW *, int, int);
extern	int	garbagedwin(WINDOW *);
extern	int	getch(void);
extern	int	getstr(char *);
extern	int	gettmode(void);
extern	int	halfdelay(int);
extern	int	hline(const chtype, const int);
extern	int	inchnstr(chtype *, int);
extern	int	inchstr(chtype *);
extern	int	innstr(char *, int);
extern	int	insch(chtype);
extern	int	insdelln(int);
extern	int	insertln(void);
extern	int	insnstr(const char *, int);
extern	int	insstr(const char *);
extern	int	instr(char *);
extern	int	intrflush(WINDOW *, int);
extern	bool	is_linetouched(WINDOW *, int);
extern	bool	is_wintouched(WINDOW *);
extern	int	leaveok(WINDOW *, int);
extern	int	meta(WINDOW *, int);
extern	int	move(int, int);
extern	int	mvaddch(int, int, const chtype);
extern	int	mvaddchnstr(const int, const int, const chtype *, const int);
extern	int	mvaddchstr(const int, const int, const chtype *);
extern	int	mvaddnstr(const int, const int, const char *, const int);
extern	int	mvaddstr(const int, const int, const char *);
extern	int	mvdelch(int, int);
extern	int	mvgetch(int, int);
extern	int	mvgetstr(int, int, char *);
extern	int	mvhline(int, int, chtype, int);
extern	int	mvinchnstr(int, int, chtype *, int);
extern	int	mvinchstr(int, int, chtype *);
extern	int	mvinnstr(int, int, char *, int);
extern	int	mvinsch(int, int, chtype);
extern	int	mvinsnstr(int, int, const char *, int);
extern	int	mvinsstr(int, int, const char *);
extern	int	mvinstr(int, int, char *);
extern	int	mvvline(int, int, chtype, int);
extern	int	mvwaddch(WINDOW *, int, int, const chtype);
extern	int	mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
extern	int	mvwaddchstr(WINDOW *, const int, const int, const chtype *);
extern	int	mvwaddnstr(WINDOW *, const int, const int, const char *, const int);
extern	int	mvwaddstr(WINDOW *, const int, const int, const char *);
extern	int	mvwdelch(WINDOW *, int, int);
extern	int	mvwgetch(WINDOW *, int, int);
extern	int	mvwgetstr(WINDOW *, int, int, char *);
extern	int	mvwhline(WINDOW *, int, int, chtype, int);
extern	int	mvwinchnstr(WINDOW *, int, int, chtype *, int);
extern	int	mvwinchstr(WINDOW *, int, int,chtype *);
extern	int	mvwinnstr(WINDOW *, int, int, char *, int);
extern	int	mvwinsch(WINDOW *, int, int, chtype);
extern	int	mvwinsnstr(WINDOW *, int, int, const char *, int);
extern	int	mvwinsstr(WINDOW *, int, int, const char *);
extern	int	mvwinstr(WINDOW *, int, int, char *);
extern	int	mvwvline(WINDOW *, int, int, chtype, int);
extern	int	nl(void);
extern	int	nocrmode(void);
extern	int	nodelay(WINDOW *, int);
extern	int	noecho(void);
extern	int	nonl(void);
extern	int	notimeout(WINDOW *, int);
extern	int	overlay(const WINDOW *, WINDOW *);
extern	int	overwrite(const WINDOW *, WINDOW *);
extern	int	redrawwin(WINDOW *);
extern	int	refresh(void);
extern	int	resetterm(void);
extern	int	saveterm(void);
extern	int	scr_init(const char *);
extern	int	scr_restore(const char *);
extern	int	scr_set(const char *);
extern	int	scrl(int);
extern	int	scroll(WINDOW *);
extern	int	scrollok(WINDOW *, int);
extern	int	setscrreg(int, int);
extern	int	setterm(char *);
extern	int	slk_init(int);
extern	int	standend(void);
extern	int	standout(void);
extern	int	syncok(WINDOW *, int);
extern	int	touchline(WINDOW *, int, int);
extern	int	touchwin(WINDOW *);
extern	int	untouchwin(WINDOW *);
extern	int	vline(chtype, int);
extern	int	waddchstr(WINDOW *, const chtype *);
extern	int	waddstr(WINDOW *, const char *);
extern	int	wclear(WINDOW *);
extern	int	wdeleteln(WINDOW *);
extern	int	werase(WINDOW *);
extern	int	winchstr(WINDOW *, chtype *);
extern	int	winsertln(WINDOW *);
extern	int	winsstr(WINDOW *, const char *);
extern	int	winstr(WINDOW *, char *);
extern	int	wstandend(WINDOW *);
extern	int	wstandout(WINDOW *);

extern	void	bkgdset(const chtype);
extern	void	idcok(WINDOW *, bool);
extern	void	noqiflush(void);
extern	void	wbkgdset(WINDOW *, chtype);
extern	void	qiflush(void);
extern	void	timeout(int);
extern	void	wtimeout(WINDOW *, int);
extern	void	use_env(int);

extern	chtype	inwch(void);
extern	chtype	mvinwch(int, int);
extern	chtype	mvwinwch(WINDOW *, int, int);

extern	int	addnwstr(const wchar_t *, const int);
extern	int	addwch(chtype);
extern	int	addwchnstr(chtype *, int);
extern	int	addwchstr(chtype *);
extern	int	addwstr(const wchar_t *);
extern	int	echowchar(chtype);
extern	int	getnwstr(wchar_t *, int);
extern	int	getwch(void);
extern	int	getwstr(wchar_t *);
extern	int	innwstr(wchar_t *, int);
extern	int	insnwstr(const wchar_t *, int);
extern	int	inswch(chtype);
extern	int	inswstr(wchar_t *);
extern	int	inwchnstr(chtype *, int);
extern	int	inwchstr(chtype *);
extern	int	inwstr(wchar_t *);
extern	int	mvaddnwstr(const int, const int, const wchar_t *, const int);
extern	int	mvaddwch(int, int, chtype);
extern	int	mvaddwchnstr(int, int, chtype *, int);
extern	int	mvaddwchstr(int, int, chtype *);
extern	int	mvaddwstr(const int, const int, const wchar_t *);
extern	int	mvgetnwstr(int, int, wchar_t *, int);
extern	int	mvgetwch(const int, const int);
extern	int	mvgetwstr(int, int, wchar_t *);
extern	int	mvinnwstr(int, int, wchar_t *, int);
extern	int	mvinsnwstr(int, int, const wchar_t *, int);
extern	int	mvinswch(int, int, chtype);
extern	int	mvinswstr(int, int, const wchar_t *);
extern	int	mvinwchnstr(int, int, chtype *, int);
extern	int	mvinwchstr(int, int, chtype *);
extern	int	mvinwstr(int, int, wchar_t *);
extern	int	mvwaddnwstr(WINDOW *, const int, const int, const wchar_t *, const int);
extern	int	mvwaddwch(WINDOW *, int, int, chtype);
extern	int	mvwaddwchnstr(WINDOW *, int, int, chtype *, int);
extern	int	mvwaddwchstr(WINDOW *, int, int, chtype *);
extern	int	mvwaddwstr(WINDOW *, const int, const int, wchar_t *);
extern	int	mvwgetnwstr(WINDOW *, int, int, wchar_t *, int);
extern	int	mvwgetwch(WINDOW *, const int, const int);
extern	int	mvwgetwstr(WINDOW *, int, int, wchar_t *);
extern	int	mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
extern	int	mvwinsnwstr(WINDOW *, int, int, const wchar_t *, int);
extern	int	mvwinswch(WINDOW *, int, int, chtype);
extern	int	mvwinswstr(WINDOW *, int, int, wchar_t *);
extern	int	mvwinwchnstr(WINDOW *, int, int, chtype *, int);
extern	int	mvwinwchstr(WINDOW *, int, int,chtype *);
extern	int	mvwinwstr(WINDOW *, int, int, wchar_t *);
extern	int	waddwchstr(WINDOW *, chtype *);
extern	int	waddwstr(WINDOW *, const wchar_t *);
extern	int	winswstr(WINDOW *, wchar_t *);
extern	int	winwchstr(WINDOW *, chtype *);

extern  int     COLOR_PAIR(int);
extern  int     PAIR_NUMBER(int);

extern  int	ins_nwstr(const wchar_t *, int);
extern  int	ins_wstr(const wchar_t *);
extern  int	mvins_nwstr(int, int, const wchar_t *, int);
extern  int	mvins_wstr(int, int, const wchar_t *);
extern  int	mvwins_nwstr(WINDOW, int, int, const wchar_t *, int);
extern  int	mvwins_wstr(WINDOW, int, int, const wchar_t *);
extern  int	wins_wstr(WINDOW, const wchar_t *);

extern  int	in_wch(cchar_t *);
extern  int	mvin_wch(int, int, cchar_t *);
extern  int	mvwin_wch(WINDOW *, int, int, cchar_t *);

extern  int	ins_wch(const cchar_t *);
extern  int	mvins_wch(int, int, const cchar_t *);
extern  int	mvwins_wch(WINDOW *, int, int, const cchar_t *);

extern  int	in_wchnstr(cchar_t *, int);
extern  int	in_wchstr(cchar_t *);
extern  int	mvin_wchnstr(int, int, cchar_t *, int);
extern  int	mvin_wchstr(int, int, cchar_t *);
extern  int	mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
extern  int	mvwin_wchstr(WINDOW *, int, int, cchar_t *);
extern  int	win_wchstr(WINDOW *,cchar_t *);

#else /* defined(__STDC__) || defined(__cplusplus) */

extern	SCREEN	*newterm();
extern	SCREEN	*set_term();

extern	WINDOW	*subpad();
extern	WINDOW	*subwin();

extern	chtype	inch();
extern	chtype	winch();
extern	chtype	mvinch();
extern	chtype	mvwinch();

extern	char	*unctrl();

extern	int	addch();
extern	int	addchnstr();
extern	int	addchstr();
extern	int	addnstr();
extern	int	addstr();
extern	int	attroff();
extern	int	attron();
extern	int	attrset();
extern	int	beep();
extern	int	bkgd();
extern	int	border();
extern	int	box();
extern	int	clear();
extern	int	clearok();
extern	int	clrtobot();
extern	int	clrtoeol();
extern	int	crmode();
extern	int	delch();
extern	int	deleteln();
extern	int	echo();
extern	int	echochar();
extern	int	erase();
extern	int	fixterm();
extern	int	flash();
extern	int	garbagedlines();
extern	int	garbagedwin();
extern	int	getch();
extern	int	getstr();
extern	int	gettmode();
extern	int	halfdelay();
extern	int	hline();
extern	int	inchnstr();
extern	int	inchstr();
extern	int	innstr();
extern	int	insch();
extern	int	insdelln();
extern	int	insertln();
extern	int	insnstr();
extern	int	insstr();
extern	int	instr();
extern	int	intrflush();
extern	int	leaveok();
extern	int	meta();
extern	int	move();
extern	int	mvaddch();
extern	int	mvaddchnstr();
extern	int	mvaddchstr();
extern	int	mvaddnstr();
extern	int	mvaddstr();
extern	int	mvdelch();
extern	int	mvgetch();
extern	int	mvgetstr();
extern	int	mvhline();
extern	int	mvinchnstr();
extern	int	mvinchstr();
extern	int	mvinnstr();
extern	int	mvinsch();
extern	int	mvinsnstr();
extern	int	mvinsstr();
extern	int	mvinstr();
extern	int	mvvline();
extern	int	mvwaddch();
extern	int	mvwaddchnstr();
extern	int	mvwaddchstr();
extern	int	mvwaddnstr();
extern	int	mvwaddstr();
extern	int	mvwdelch();
extern	int	mvwgetch();
extern	int	mvwgetstr();
extern	int	mvwhline();
extern	int	mvwinchnstr();
extern	int	mvwinchstr();
extern	int	mvwinnstr();
extern	int	mvwinsch();
extern	int	mvwinsnstr();
extern	int	mvwinsstr();
extern	int	mvwinstr();
extern	int	mvwvline();
extern	int	nl();
extern	int	nocrmode();
extern	int	nodelay();
extern	int	noecho();
extern	int	nonl();
extern	int	notimeout();
extern	int	overlay();
extern	int	overwrite();
extern	int	redrawwin();
extern	int	refresh();
extern	int	resetterm();
extern	int	saveterm();
extern	int	scr_init();
extern	int	scr_restore();
extern	int	scr_set();
extern	int	scrl();
extern	int	scroll();
extern	int	scrollok();
extern	int	setscrreg();
extern	int	setterm();
extern	int	slk_init();
extern	int	standend();
extern	int	standout();
extern	int	syncok();
extern	int	touchline();
extern	int	touchwin();
extern	int	untouchwin();
extern	int	vline();
extern	int	waddchstr();
extern	int	waddstr();
extern	int	wclear();
extern	int	wdeleteln();
extern	int	werase();
extern	int	winchstr();
extern	int	winsertln();
extern	int	winsstr();
extern	int	winstr();
extern	int	wstandend();
extern	int	wstandout();

extern	void	bkgdset();
extern	void	wbkgdset();
extern	void	idcok();
extern	void	noqiflush();
extern	void	qiflush();
extern	void	timeout();
extern	void	wtimeout();
extern	void	use_env();

extern	chtype	inwch();
extern	chtype	mvinwch();
extern	chtype	mvwinwch();

extern	int	addnwstr();
extern	int	addwch();
extern	int	addwchnstr();
extern	int	addwchstr();
extern	int	addwstr();
extern	int	echowchar();
extern	int	getnwstr();
extern	int	getwch();
extern	int	getwstr();
extern	int	innwstr();
extern	int	insnwstr();
extern	int	inswch();
extern	int	inswstr();
extern	int	inwchnstr();
extern	int	inwchstr();
extern	int	inwstr();
extern	int	mvaddnwstr();
extern	int	mvaddwch();
extern	int	mvaddwchnstr();
extern	int	mvaddwchstr();
extern	int	mvaddwstr();
extern	int	mvgetnwstr();
extern	int	mvgetwch();
extern	int	mvgetwstr();
extern	int	mvinnwstr();
extern	int	mvinsnwstr();
extern	int	mvinswch();
extern	int	mvinswstr();
extern	int	mvinwchnstr();
extern	int	mvinwchstr();
extern	int	mvinwstr();
extern	int	mvwaddnwstr();
extern	int	mvwaddwch();
extern	int	mvwaddwchnstr();
extern	int	mvwaddwchstr();
extern	int	mvwaddwstr();
extern	int	mvwgetnwstr();
extern	int	mvwgetwch();
extern	int	mvwgetwstr();
extern	int	mvwinnwstr();
extern	int	mvwinsnwstr();
extern	int	mvwinswch();
extern	int	mvwinswstr();
extern	int	mvwinwchnstr();
extern	int	mvwinwchstr();
extern	int	mvwinwstr();
extern	int	waddwchstr();
extern	int	waddwstr();
extern	int	winswstr();
extern	int	winwchstr();

extern	bool	is_linetouched();
extern	bool	is_wintouched();

extern  int     COLOR_PAIR();
extern  int     PAIR_NUMBER();

extern  int     ins_nwstr();
extern  int     ins_wstr();
extern  int     mvins_nwstr();
extern  int     mvins_wstr();
extern  int     mvwins_nwstr();
extern  int     mvwins_wstr();
extern  int     wins_wstr();

extern  int     in_wch();
extern  int     mvin_wch();
extern  int     mvwin_wch();

extern  int     ins_wch();
extern  int     mvins_wch();
extern  int     mvwins_wch();

extern  int     in_wchnstr();
extern  int     in_wchstr();
extern  int     mvin_wchnstr();
extern  int     mvin_wchstr();
extern  int     mvwin_wchnstr();
extern  int     mvwin_wchstr();
extern  int     win_wchstr();

#endif /* defined(__STDC__) || defined(__cplusplus) */

#else	/* NOMACROS || lint */

/*
 * The defines from here down to the #endif for NOMACROS
 * define macros, which may be more efficient than their
 * function versions. The functions may be accessed by defining
 * NOMACROS in C code. This is useful for debugging purposes.
 */

#include  <unctrl.h>

/* pseudo functions for stdscr */
#define	addch(__ch)		waddch(stdscr, __ch)
#define	addchnstr(__str,__n)	waddchnstr(stdscr,__str,__n)
#define	addchstr(__str)		waddchnstr(stdscr,__str,(-1))
#define	addnstr(__s,__n)	waddnstr(stdscr,__s,__n)
#define	addnwstr(__ws,__n)	waddnwstr(stdscr,__ws,__n)
#define	addstr(__str)		waddnstr(stdscr, __str,(-1))
#define	addwch(__ch)		waddwch(stdscr,__ch)
#define	addwchnstr(__str,__n)	waddwchnstr(stdscr,__str,__n)
#define	addwchstr(__str)	waddwchnstr(stdscr,__str,(-1))
#define	addwstr(__ws)		waddwstr(stdscr,__ws)
#define	attroff(__at)		wattroff(stdscr,__at)
#define	attron(__at)		wattron(stdscr,__at)
#define	attrset(__at)		wattrset(stdscr,__at)
#define	bkgd(__c)		wbkgd(stdscr,__c)
#define	bkgdset(__c)		wbkgdset(stdscr,__c)
#define	border(__ls,__rs,__ts,__bs,__tl,__tr,__bl,__br) \
		       wborder(stdscr, __ls,__rs,__ts,__bs,__tl,__tr,__bl,__br)
#define	clear()			wclear(stdscr)
#define	clrtobot()		wclrtobot(stdscr)
#define	clrtoeol()		wclrtoeol(stdscr)
#define	delch()			wdelch(stdscr)
#define	deleteln()		wdeleteln(stdscr)
#define	echochar(__ch)		wechochar(stdscr, __ch)
#define	echowchar(__ch)		wechowchar(stdscr,__ch)
#define	erase()			werase(stdscr)
#define	getch()			wgetch(stdscr)
#define	getnwstr(__ws,__n)	wgetnwstr(stdscr,__ws,__n)
#define	getstr(__str)		wgetstr(stdscr, __str)
#define	getwch()		wgetwch(stdscr)
#define	getwstr(__ws)		wgetwstr(stdscr, __ws)
#define	hline(__c,__num)	whline(stdscr,__c,__num)
#define	inch()			winch(stdscr)
#define	inchnstr(__str,__n)	winchnstr(stdscr,__str,__n)
#define	inchstr(__str)		winchnstr(stdscr,__str,(-1))
#define	innstr(__str,__n)	winnstr(stdscr,__str,__n)
#define	innwstr(__ws,__n)	winnwstr(stdscr,__ws,__n)
#define	insch(__c)		winsch(stdscr,__c)
#define	insdelln(__id)		winsdelln(stdscr,__id)
#define	insertln()		winsertln(stdscr)
#define	insnstr(__s,__n)	winsnstr(stdscr,__s,__n)
#define	insnwstr(__ws,__n)	winsnwstr(stdscr,__ws,__n)
#define	insstr(__s)		winsstr(stdscr,__s)
#define	instr(__str)		winstr(stdscr,__str)
#define	inswch(__c)		winswch(stdscr,__c)
#define	inswstr(__ws)		winswstr(stdscr,__ws)
#define	inwch()			winwch(stdscr)
#define	inwchnstr(__str,__n)	winwchnstr(stdscr,__str,__n)
#define	inwchstr(__str)		winwchstr(stdscr,__str)
#define	inwstr(__ws)		winwstr(stdscr,__ws)
#define	move(__y, __x)		wmove(stdscr, __y, __x)
#define	mvaddch(__y,__x,__ch)	mvwaddch(stdscr,__y,__x,__ch)
#define	mvaddnstr(__y,__x,__s,__n) \
				mvwaddnstr(stdscr,__y,__x,__s,__n)
#define	mvaddstr(__y,__x,__str)	mvwaddnstr(stdscr,__y,__x,__str,(-1))
#define	mvdelch(__y,__x)	mvwdelch(stdscr,__y,__x)
#define	mvgetch(__y,__x)	mvwgetch(stdscr,__y,__x)
#define	mvgetstr(__y,__x,__str)	mvwgetstr(stdscr,__y,__x,__str)
#define	mvinch(__y,__x)		mvwinch(stdscr,__y,__x)
#define	mvinsch(__y,__x,__c)	mvwinsch(stdscr,__y,__x,__c)
#define	mvinsnstr(__y,__x,__s,__n) \
				mvwinsnstr(stdscr,__y,__x,__s,__n)
#define	mvinsstr(__y,__x,__s)	mvwinsnstr(stdscr,__y,__x,__s,(-1))
#define	mvaddchstr(__y,__x,__str) \
				mvwaddchnstr(stdscr,__y,__x,__str,(-1))
#define	mvaddchnstr(__y,__x,__str,__n) \
				mvwaddchnstr(stdscr,__y,__x,__str,__n)
#define	mvinstr(__y,__x,__str)	mvwinstr(stdscr,__y,__x,__str)
#define	mvinnstr(__y,__x,__str,__n) \
				mvwinnstr(stdscr,__y,__x,__str,__n)
#define	mvinchstr(__y,__x,__str) \
				mvwinchnstr(stdscr,__y,__x,__str,(-1))
#define	mvinchnstr(__y,__x,__str,__n) \
				mvwinchnstr(stdscr,__y,__x,__str,__n)
#define	mvhline(__y,__x,__c,__num) \
				mvwhline(stdscr,__y,__x,__c,__num)
#define	mvvline(__y,__x,__c,__num) \
				mvwvline(stdscr,__y,__x,__c,__num)
#define	mvaddnwstr(__y,__x,__ws,__n) \
				mvwaddnwstr(stdscr,__y,__x,__ws,__n)
#define	mvaddwch(__y,__x,__ch)	mvwaddwch(stdscr,__y,__x,__ch)
#define	mvaddwchnstr(__y,__x,__str,__n) \
				mvwaddwchnstr(stdscr,__y,__x,__str,__n)
#define	mvaddwchstr(__y,__x,__str) \
				mvwaddwchnstr(stdscr,__y,__x,__str,(-1))
#define	mvaddwstr(__y,__x,__ws)	mvwaddwstr(stdscr,__y,__x,__ws)
#define	mvgetnwstr(__y,__x,__ws,__n) \
				mvwgetnwstr(stdscr,__y,__x,__ws,__n)
#define	mvgetwch(__y,__x)	mvwgetwch(stdscr,__y,__x)
#define	mvgetwstr(__y,__x,__ws)	mvwgetwstr(stdscr,__y,__x,__ws)
#define	mvinnwstr(__y,__x,__ws,__n) \
				mvwinnwstr(stdscr,__y,__x,__ws,__n)
#define	mvinsnwstr(__y,__x,__ws,__n) \
				mvwinsnwstr(stdscr,__y,__x,__ws,__n)
#define	mvinswch(__y,__x,__c)	mvwinswch(stdscr,__y,__x,__c)
#define	mvinswstr(__y,__x,__ws)	mvwinswstr(stdscr,__y,__x,__ws)
#define	mvinwch(__y,__x)	mvwinwch(stdscr,__y,__x)
#define	mvinwchnstr(__y,__x,__str,__n) \
				mvwinwchnstr(stdscr,__y,__x,__str,__n)
#define	mvinwchstr(__y,__x,__str) \
				mvwinwchnstr(stdscr,__y,__x,__str,(-1))
#define	mvinwstr(__y,__x,__ws)	mvwinwstr(stdscr,__y,__x,__ws)
#define	mvwaddch(__win,__y,__x,__ch) \
			(wmove(__win,__y,__x)==ERR?ERR:waddch(__win,__ch))
#define	mvwaddnstr(__win,__y,__x,__s,__n) \
			(wmove(__win,__y,__x)==ERR?ERR:waddnstr(__win,__s,__n))
#define	mvwaddstr(__win,__y,__x,__str) \
			(wmove(__win,__y,__x)==ERR?ERR:waddstr(__win,__str))
#define	mvwdelch(__win,__y,__x)	(wmove(__win,__y,__x)==ERR?ERR:wdelch(__win))
#define	mvwgetch(__win,__y,__x)	(wmove(__win,__y,__x)==ERR?ERR:wgetch(__win))
#define	mvwgetstr(__win,__y,__x,__str) \
			(wmove(__win,__y,__x)==ERR?ERR:wgetstr(__win,__str))
#define	mvwinch(__win,__y,__x) \
			(wmove(__win,__y,__x)==ERR?(chtype) ERR:winch(__win))
#define	mvwinsch(__win,__y,__x,__c) \
			(wmove(__win,__y,__x)==ERR?ERR:winsch(__win,__c))
#define	mvwinsnstr(__win,__y,__x,__s,__n) \
			(wmove(__win,__y,__x)==ERR?ERR:winsnstr(__win,__s,__n))
#define	mvwinsstr(__win,__y,__x,__s) \
		(wmove(__win,__y,__x)==ERR?ERR:winsnstr(__win,__s,(-1)))
#define	mvwhline(__win,__y,__x,__c,__num) \
			(wmove(__win,__y,__x)==ERR?ERR:whline(__win,__c,__num))
#define	mvwvline(__win,__y,__x,__c,__num) \
			(wmove(__win,__y,__x)==ERR?ERR:wvline(__win,__c,__num))
#define	mvwaddchstr(__win,__y,__x,__str) \
		(wmove(__win,__y,__x)==ERR?ERR:waddchnstr(__win,__str,(-1)))
#define	mvwaddchnstr(__win,__y,__x,__str,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:waddchnstr(__win,__str,__n))
#define	mvwinstr(__win,__y,__x,__str) \
			(wmove(__win,__y,__x)==ERR?ERR:winstr(__win,__str))
#define	mvwinnstr(__win,__y,__x,__str,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:winnstr(__win,__str,__n))
#define	mvwinchstr(__win,__y,__x,__str) \
		(wmove(__win,__y,__x)==ERR?ERR:winchnstr(__win,__str,(-1)))
#define	mvwinchnstr(__win,__y,__x,__str,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:winchnstr(__win,__str,__n))

#define	mvwaddnwstr(__win,__y,__x,__ws,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:waddnwstr(__win,__ws,__n))
#define	mvwaddwch(__win,__y,__x,__ch) \
			(wmove(__win,__y,__x)==ERR?ERR:waddwch(__win,__ch))
#define	mvwaddwchnstr(__win,__y,__x,__str,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:waddwchnstr(__win,__str,__n))
#define	mvwaddwchstr(__win,__y,__x,__str) \
		(wmove(__win,__y,__x)==ERR?ERR:waddwchnstr(__win,__str,(-1)))
#define	mvwaddwstr(__win,__y,__x,__ws) \
		(wmove(__win,__y,__x)==ERR?ERR:waddnwstr(__win,__ws,(-1)))
#define	mvwgetnwstr(__win,__y,__x,__ws,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:wgetnwstr(__win,__ws,__n))
#define	mvwgetwch(__win,__y,__x) \
				(wmove(__win,__y,__x)==ERR?ERR:wgetwch(__win))
#define	mvwgetwstr(__win,__y,__x,__ws) \
			(wmove(__win,__y,__x)==ERR?ERR:wgetwstr(__win,__ws))
#define	mvwinnwstr(__win,__y,__x,__ws,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:winnwstr(__win,__ws,__n))
#define	mvwinsnwstr(__win,__y,__x,__ws,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:winsnwstr(__win,__ws,__n))
#define	mvwinswch(__win,__y,__x,__c) \
			(wmove(__win,__y,__x)==ERR?ERR:winswch(__win,__c))
#define	mvwinswstr(__win,__y,__x,__ws) \
			(wmove(__win,__y,__x)==ERR?ERR:winswstr(__win,__ws))
#define	mvwinwch(__win,__y,__x) \
			(wmove(__win,__y,__x)==ERR?(chtype)ERR:winwch(__win))
#define	mvwinwchnstr(__win,__y,__x,__str,__n) \
		(wmove(__win,__y,__x)==ERR?ERR:winwchnstr(__win,__str,__n))
#define	mvwinwchstr(__win,__y,__x,__str) \
			(wmove(__win,__y,__x)==ERR?ERR:winwchstr(__win,__str))
#define	mvwinwstr(__win,__y,__x,__ws) \
			(wmove(__win,__y,__x)==ERR?ERR:winwstr(__win,__ws))

#define	refresh()		wrefresh(stdscr)
#define	scrl(__n)		wscrl(stdscr,__n)
#define	setscrreg(__t,__b)	wsetscrreg(stdscr,__t,__b)
#define	standend()		wstandend(stdscr)
#define	standout()		wstandout(stdscr)
#define	timeout(__tm)		wtimeout(stdscr,__tm)
#define	vline(__c,__num)	wvline(stdscr,__c,__num)
#define	waddwchstr(__win,__str)	waddwchnstr(__win,__str,(-1))
#define	winwchstr(__win,__str)	winwchnstr(__win,__str,(-1))
#define waddwstr(__win,__ws)	waddnwstr(__win,__ws,(-1))
#define winswstr(__win,__ws)	winsnwstr(__win,__ws,(-1))
#define	COLOR_PAIR(n)		((n) << 25)
#define	PAIR_NUMBER(n)		(((n) & A_COLOR) >> 25)

#define ins_nwtsr(__wstr, __n)  wins_nwstr(stdscr,__wstr,__n)
#define ins_wstr(__wstr)        wins_nwstr(stdscr,__wstr,(-1))
#define mvins_nwstr(__y, __x, __wstr, __n) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 wins_nwstr(stdscr,__wstr,__n))
#define mvins_wstr(__y,__x,__wstr) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 wins_nwstr(stdscr,__wstr,(-1))
#define mvwins_nwstr(__win,__y,__x,__wstr,__n) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 wins_nwstr(__win,__wstr,__n))
#define mvwins_wstr(__win,__y,__x,__wstr) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 wins_nwstr(__win,__wstr,(-1))
#define wins_wstr(__win,__wstr) wins_nwstr(__win,__wstr,(-1))

#define in_wch(__wcval)		win_wch(stdscr,__wcval)
#define mvin_wch(__y,__x,__wcval) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 win_wch(stdscr,__wcval))
#define mvwin_wch(__win,__y,__x,__wcval) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 win_wch(__win,__wcval))

#define ins_wch(__wch)		wins_wch(stdscr,__wch)
#define mvins_wch(__y,__x,__wch) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 wins_wch(stdscr,__wch))
#define mvwins_wch(__win,__y,__x,__wch) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 wins_wch(__win,__wch))

#define in_wchnstr(__wchstr,__n) \
				win_wchnstr(stdscr,__wchstr,__n)
#define in_wchstr(__wchstr)	win_wchnstr(stdscr,__wchstr,(-1))
#define mvin_wchnstr(__y,__x,__wchstr,__n) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 win_wchnstr(stdscr,__wchstr,__n))
#define mvin_wchstr(__y,__x,__wchstr) \
				(wmove(stdscr,__y,__x)==ERR ? ERR : \
				 win_wchnstr(stdscr,__wchstr,(-1)))
#define mvwin_wchnstr(__win,__y,__x,__wchstr,__n) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 win_wchnstr(__win,__wchstr,__n))
#define mvwin_wchstr(__win,__y,__x,__wchstr) \
				(wmove(__win,__y,__x)==ERR ? ERR : \
				 win_wchnstr(__win,_wchstr,(-1)))
#define win_wchstr(__win,__wchstr) \
				win_wchnstr(__win,__wchstr,(-1))

/* functions to define environment flags of a window */
#if defined(__STDC__) || defined(__cplusplus)

extern	int	beep(void);
extern	int	box(WINDOW *, const chtype, const chtype);
extern	int	clearok(WINDOW *, int);
extern	int	crmode(void);
extern	int	echo(void);
extern	int	fixterm(void);
extern	int	flash(void);
extern	int	garbagedlines(WINDOW *, int, int);
extern	int	garbagedwin(WINDOW *);
extern	int	gettmode(void);
extern	int	halfdelay(int);
extern	void	idcok(WINDOW *, bool);
extern	int	intrflush(WINDOW *, int);
extern	bool	is_linetouched(WINDOW *, int);
extern	bool	is_wintouched(WINDOW *);
extern	int	leaveok(WINDOW *, int);
extern	int	meta(WINDOW *, int);
extern	SCREEN	*newterm(char *, FILE *, FILE *);
extern	int	nl(void);
extern	int	nocrmode(void);
extern	int	nodelay(WINDOW *, int);
extern	int	noecho(void);
extern	int	nonl(void);
extern	void	noqiflush(void);
extern	int	notimeout(WINDOW *, int);
extern	int	overlay(const WINDOW *, WINDOW *);
extern	int	overwrite(const WINDOW *, WINDOW *);
extern	void	qiflush(void);
extern	int	redrawwin(WINDOW *);
extern	int	resetterm(void);
extern	int	saveterm(void);
extern	int	scr_init(const char *);
extern	int	scr_restore(const char *);
extern	int	scr_set(const char *);
extern	int	scroll(WINDOW *);
extern	int	scrollok(WINDOW *, int);
extern	SCREEN	*set_term(SCREEN *);
extern	int	setterm(char *);
extern	int	slk_init(int);
extern	WINDOW	*subpad(WINDOW *, int, int, int, int);
extern	WINDOW	*subwin(WINDOW *, int, int, int, int);
extern	int	syncok(WINDOW *, int);
extern	int	touchline(WINDOW *, int, int);
extern	int	touchwin(WINDOW *);
extern	int	untouchwin(WINDOW *);
extern	void	use_env(int);
extern	int	waddchstr(WINDOW *, const chtype *);
extern	int	waddstr(WINDOW *, char *);
extern	void	wbkgdset(WINDOW *, chtype);
extern	int	wclear(WINDOW *);
extern	int	wdeleteln(WINDOW *);
extern	int	werase(WINDOW *);
extern	chtype	winch(WINDOW *);
extern	int	winchstr(WINDOW *, chtype *);
extern	int	winsertln(WINDOW *);
extern	int	winsstr(WINDOW *, const char *);
extern	int	winstr(WINDOW *, char *);
extern	int	wstandend(WINDOW *);
extern	int	wstandout(WINDOW *);
extern	void	wtimeout(WINDOW *, int);
extern	void	wbkgdset(WINDOW *, chtype);
extern	void	idcok(WINDOW *, bool);
extern	void	wtimeout(WINDOW *, int);
extern	void	use_env(int /*char*/);

extern	int	syncok(WINDOW *, int);
extern	int	notimeout(WINDOW *, int);
extern	int	clearok(WINDOW *, int);
extern	int	leaveok(WINDOW *, int);
extern	int	scrollok(WINDOW *, int);
extern	int	nodelay(WINDOW *, int);
extern	int	touchwin(WINDOW *);
extern	int	redrawwin(WINDOW *);
extern	int	winchstr(WINDOW *, chtype *);
extern	int	winstr(WINDOW *, char *);
extern	int	untouchwin(WINDOW *); 

extern	bool	is_linetouched(WINDOW *, int);
extern	bool	is_wintouched(WINDOW *);
extern	chtype  winch(WINDOW *);

extern	WINDOW	*subwin(WINDOW *, int, int, int, int);
extern	int	attr_get(attr_t *, short *, void *);
extern	int	wattr_get(WINDOW *, attr_t *, short *, void *);
extern	int	attr_off(attr_t, void *);
extern	int	wattr_off(WINDOW *, attr_t, void *);
extern	int	attr_on(attr_t, void *);
extern	int	wattr_on(WINDOW *, attr_t, void *);
extern	int	attr_set(attr_t, short, void *);
extern	int	wattr_set(WINDOW *, attr_t, short, void *);                   
extern	int	color_set(short, void *);
extern	int	wcolor_set(WINDOW *, short, void *);

#else  /* defined(__STDC__) || defined(__cplusplus) */

extern	int	beep();
extern	int	box();
extern	int	clearok();
extern	int	crmode();
extern	int	echo();
extern	int	fixterm();
extern	int	flash();
extern	int	garbagedlines();
extern	int	garbagedwin();
extern	int	gettmode();
extern	int	halfdelay();
extern	void	idcok();
extern	int	intrflush();
extern	bool	is_linetouched();
extern	bool	is_wintouched();
extern	int	leaveok();
extern	int	meta();
extern	SCREEN	*newterm();
extern	int	nl();
extern	int	nocrmode();
extern	int	nodelay();
extern	int	noecho();
extern	int	nonl();
extern	void	noqiflush();
extern	int	notimeout();
extern	int	overlay();
extern	int	overwrite();
extern	void	qiflush();
extern	int	redrawwin();
extern	int	resetterm();
extern	int	saveterm();
extern	int	scr_init();
extern	int	scr_restore();
extern	int	scr_set();
extern	int	scroll();
extern	int	scrollok();
extern	SCREEN	*set_term();
extern	int	setterm();
extern	int	slk_init();
extern	WINDOW	*subpad();
extern	WINDOW	*subwin();
extern	int	syncok();
extern	int	touchline();
extern	int	touchwin();
extern	int	untouchwin();
extern	void	use_env();
extern	int	waddchstr();
extern	int	waddstr();
extern	void	wbkgdset();
extern	int	wclear();
extern	int	wdeleteln();
extern	int	werase();
extern	chtype	winch();
extern	int	winchstr();
extern	int	winsertln();
extern	int	winsstr();
extern	int	winstr();
extern	int	wstandend();
extern	int	wstandout();
extern	void	wtimeout();

extern	void	wbkgdset();
extern	void	idcok();
extern	void	wtimeout();
extern	void	use_env();

extern	int	syncok();
extern	int	notimeout();
extern	int	clearok();
extern	int	leaveok();
extern	int	scrollok();
extern	int	nodelay();
extern	int	touchwin();
extern	int	redrawwin();
extern	int	winchstr();
extern	int	attr_on();                                                   
extern	int	wattr_on();                                                   
extern	int	attr_set();                                                   
extern	int	wattr_set();                                                  
extern	int	color_set();
extern	int	wcolor_set();
                 
#endif /* defined(__STDC__) || defined(__cplusplus) */

#ifdef CURS_MACROS
#define wdeleteln(__win)	winsdelln((__win),-1)
#define winsertln(__win)	winsdelln((__win),1)
#define wstandend(__win)	wattrset((__win),A_NORMAL)
#define wstandout(__win)	wattron((__win),A_STANDOUT)
#define scroll(__win)		wscrl((__win),1)
#define slk_init(__f)		slk_start(((__f == 0) ? 3 : 2),NULL)
#define subpad(__win,__nl,__nc,__by,__bx) \
				derwin((__win),(__nl),(__nc),(__by),(__bx))
#define box(__win,__v,__h) \
			wborder((__win),(__v),(__v),(__h),(__h),0,0,0,0)
#define newterm(__type,__fout,__fin) \
				newscreen((__type),0,0,0,(__fout),(__fin))
#define touchline(__win,__y,__n) \
				wtouchln((__win),(__y),(__n),TRUE)

#define waddstr(__win,__str)	waddnstr((__win),(__str),(-1))
#define werase(__win)		(wmove((__win),0,0), wclrtobot(__win))
#define wclear(__win)		(clearok((__win),TRUE), werase(__win))

#define setterm(__name)		setupterm((__name),1,((void *)0))
#define gettmode()		(OK)
#define halfdelay(__tens)	ttimeout((__tens)*100)


#else /* CURS_MACROS */

#if defined(__STDC__) || defined(__cplusplus)

extern	int	overlay(const WINDOW *, WINDOW *);
extern	int	overwrite(const WINDOW *, WINDOW *);
extern	int	wdeleteln(WINDOW *);
extern	int	winsertln(WINDOW *);
extern	int	wstandend(WINDOW *);
extern	int	wstandout(WINDOW *);
extern	int	beep(void);
extern	int	flash(void);
extern	int	scroll(WINDOW *);
extern	int	slk_init(int);
extern	int	scr_init(const char *);
extern	int	scr_restore(const char *);
extern	int	scr_set(const char *);
extern	int	box(WINDOW *, chtype, chtype);
extern	int	touchline(WINDOW *, int, int);
extern	int	waddstr(WINDOW *, char *);
extern	int	werase(WINDOW *);
extern	int	wclear(WINDOW *);
extern	int	intrflush(WINDOW *, int);
extern	int	meta(WINDOW *, int);
extern	int	setterm(char *);
extern	int	gettmode(void);
extern	int	halfdelay(int);
extern	int	echo(void);
extern	int	noecho(void);
extern	int	nl(void);
extern	int	nonl(void);

extern	WINDOW *subpad(WINDOW *, int, int, int, int);

extern	 SCREEN  *newterm(char *, FILE *, FILE *);

#else  /* defined(__STDC__) || defined(__cplusplus) */

extern	int	overlay();
extern	int	overwrite();
extern	int	wdeleteln();
extern	int	winsertln();
extern	int	wstandend();
extern	int	wstandout();
extern	int	beep();
extern	int	flash();
extern	int	scroll();
extern	int	slk_init();
extern	int	scr_init();
extern	int	scr_restore();
extern	int	scr_set();
extern	int	box();
extern	int	touchline();
extern	int	waddstr();
extern	int	werase();
extern	int	wclear();
extern	int	intrflush();
extern	int	meta();
extern	int	setterm();
extern	int	gettmode();
extern	int	halfdelay();
extern	int	echo();
extern	int	noecho();
extern	int	nl();
extern	int	nonl();

extern	WINDOW *subpad();

extern	 SCREEN  *newterm();

#endif /* defined(__STDC__) || defined(__cplusplus) */
#endif /* CURS_MACROS */

#define garbagedlines		wredrawln
#define garbagedwin		redrawwin

#define crmode			cbreak
#define nocrmode		nocbreak
#define saveterm		def_prog_mode
#define fixterm			reset_prog_mode
#define resetterm		reset_shell_mode

#define	waddchstr(__win,__str)	waddchnstr((__win),(__str),(-1))
#define winsstr(__win,__str)	winsnstr((__win),(__str),(-1))

/* iocontrol functions */

#define set_term		setcurscreen

#endif	/* NOMACROS || lint */


#if  (!defined(_XOPEN_SOURCE_EXTENDED) && !defined(_XOPEN_CURSES)) || defined(_ADD_MOUSE) 

#if defined(__STDC__) || defined(__cplusplus)
extern	int	mouse_set(long int);
extern	int	mouse_on(long int);
extern	int	mouse_off(long int);
extern	int	request_mouse_pos(void);
extern	int	map_button(unsigned long);

extern	void	wmouse_position (WINDOW *, int *, int *);

extern	unsigned long getmouse(void);
extern	unsigned long getbmap(void);

#else  /* defined(__STDC__) || defined(__cplusplus) */
extern	int	mouse_set();
extern	int	mouse_on();
extern	int	mouse_off();
extern	int	request_mouse_pos();
extern	int	map_button();

extern	void	wmouse_position ();

extern	unsigned long getmouse();
extern	unsigned long getbmap();
		

#endif  /* defined(__STDC__) || defined(__cplusplus) */
		
#endif /* !defined(_XOPEN_SOURCE_EXTENDED) || defined(_ADD_MOUSE) */

#ifdef __cplusplus
}
#endif

#endif /* _CURSES_INCLUDED */

#endif /* XOPEN header 
           defined(__HP_CURSES) && !defined(__LP64__) */
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || defined (__STRICT_ANSI__)
extern int getcurx (WINDOW *);
extern int getcury (WINDOW *);
#endif /* defined(__USE_FIXED_PROTOTYPES__) || ... */
#ifdef __cplusplus
}
#endif
