1
1
/****************************************************************************
2
* Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
2
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
4
4
* Permission is hereby granted, free of charge, to any person obtaining a *
5
5
* copy of this software and associated documentation files (the *
27
27
****************************************************************************/
29
29
/****************************************************************************
30
* Author: Thomas E. Dickey <dickey@clark.net> 1996 *
30
* Author: Thomas E. Dickey 1996-on *
31
31
****************************************************************************/
32
/* $Id: test.priv.h,v 1.48 2004/04/10 20:11:37 tom Exp $ */
32
/* $Id: test.priv.h,v 1.63 2006/07/15 18:27:24 tom Exp $ */
34
34
#ifndef __TEST_PRIV_H
35
35
#define __TEST_PRIV_H 1
126
210
#include <signal.h> /* include before curses.h to work around glibc bug */
128
#if defined(HAVE_NCURSESW_NCURSES_H)
212
#if defined(HAVE_XCURSES)
214
#elif defined(HAVE_NCURSESW_NCURSES_H)
129
215
#include <ncursesw/curses.h>
130
#include <ncursesw/term.h>
131
216
#elif defined(HAVE_NCURSES_NCURSES_H)
132
217
#include <ncurses/curses.h>
222
#if defined(HAVE_XCURSES)
223
/* no other headers */
224
#undef HAVE_SETUPTERM /* nonfunctional */
225
#define HAVE_SETUPTERM 0
226
#undef HAVE_TGETENT /* nonfunctional */
227
#define HAVE_TGETENT 0
228
#undef HAVE_TIGETSTR /* nonfunctional */
229
#define HAVE_TIGETSTR 0
230
#elif defined(HAVE_NCURSESW_TERM_H)
231
#include <ncursesw/term.h>
232
#elif defined(HAVE_NCURSES_TERM_H)
133
233
#include <ncurses/term.h>
234
#elif defined(HAVE_TERM_H)
136
235
#include <term.h>
139
238
#ifdef NCURSES_VERSION
140
239
#define HAVE_COLOR_SET 1
144
#include <nomacros.h>
147
243
#if HAVE_GETOPT_H
228
335
#define KEY_MIN 256 /* not defined in Solaris 8 */
339
* Workaround for HPUX
341
#if defined(__hpux) && !defined(NCURSES_VERSION)
342
#define getbegx(w) __getbegx(w)
343
#define getbegy(w) __getbegy(w)
344
#define getcurx(w) __getcurx(w)
345
#define getcury(w) __getcury(w)
346
#define getmaxx(w) __getmaxx(w)
347
#define getmaxy(w) __getmaxy(w)
348
#define getparx(w) __getparx(w)
349
#define getpary(w) __getpary(w)
353
* These usually are implemented as macros, but may be functions.
355
#if !defined(getcurx) && !HAVE_GETCURX
232
356
#define getcurx(win) ((win)?(win)->_curx:ERR)
233
357
#define getcury(win) ((win)?(win)->_cury:ERR)
360
#if !defined(getbegx) && !HAVE_GETBEGX
237
361
#define getbegx(win) ((win)?(win)->_begx:ERR)
238
362
#define getbegy(win) ((win)?(win)->_begy:ERR)
365
#if !defined(getmaxx) && !HAVE_GETMAXX
242
366
#define getmaxx(win) ((win)?((win)->_maxx + 1):ERR)
243
367
#define getmaxy(win) ((win)?((win)->_maxy + 1):ERR)
370
#if !defined(mvwvline) && !HAVE_MVWVLINE
371
#define mvwvline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : wvline(w,ch,n))
372
#define mvwhline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : whline(w,ch,n))
375
#if !defined(mvvline) && !HAVE_MVVLINE
376
#define mvvline(y,x,ch,n) (move(y,x) == ERR ? ERR : vline(ch,n))
377
#define mvhline(y,x,ch,n) (move(y,x) == ERR ? ERR : hline(ch,n))
381
* Try to accommodate curses implementations that have no terminfo support.
384
#define TIGETNUM(ti,tc) tigetnum(ti)
386
#define TIGETNUM(ti,tc) tgetnum(tc)
390
#define TIGETSTR(ti,tc) tigetstr(ti)
392
#define TIGETSTR(ti,tc) tgetstr(tc,&area_pointer)
246
395
/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list
247
396
* (which is incompatible with legacy usage, doesn't solve any problems).