~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to test/test.priv.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
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
 ****************************************************************************/
28
28
 
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 $ */
33
33
 
34
34
#ifndef __TEST_PRIV_H
35
35
#define __TEST_PRIV_H 1
41
41
 * with wide-character ncurses.
42
42
 */
43
43
#ifdef  HAVE_LIBFORMW
44
 
#define HAVE_LIBFORM 1
 
44
#define HAVE_LIBFORMW 1
45
45
#endif
46
46
 
47
47
#ifdef  HAVE_LIBMENUW
48
 
#define HAVE_LIBMENU 1
 
48
#define HAVE_LIBMENUW 1
49
49
#endif
50
50
 
51
51
#ifdef  HAVE_LIBPANELW
52
 
#define HAVE_LIBPANEL 1
 
52
#define HAVE_LIBPANELW 1
53
53
#endif
54
54
 
55
55
/*
56
 
 * Fallback definitions to accommodate broken compilers
 
56
 * Fallback definitions to accommodate broken compilers.
57
57
 */
58
58
#ifndef HAVE_CURSES_VERSION
59
59
#define HAVE_CURSES_VERSION 0
60
60
#endif
61
61
 
 
62
#ifndef HAVE_FILTER
 
63
#define HAVE_FILTER 0
 
64
#endif
 
65
 
62
66
#ifndef HAVE_FORM_H
63
67
#define HAVE_FORM_H 0
64
68
#endif
65
69
 
 
70
#ifndef HAVE_GETBEGX
 
71
#define HAVE_GETBEGX 0
 
72
#endif
 
73
 
 
74
#ifndef HAVE_GETCURX
 
75
#define HAVE_GETCURX 0
 
76
#endif
 
77
 
 
78
#ifndef HAVE_GETMAXX
 
79
#define HAVE_GETMAXX 0
 
80
#endif
 
81
 
 
82
#ifndef HAVE_GETOPT_H
 
83
#define HAVE_GETOPT_H 0
 
84
#endif
 
85
 
 
86
#ifndef HAVE_GETWIN
 
87
#define HAVE_GETWIN 0
 
88
#endif
 
89
 
66
90
#ifndef HAVE_LIBFORM
67
91
#define HAVE_LIBFORM 0
68
92
#endif
83
107
#define HAVE_MENU_H 0
84
108
#endif
85
109
 
 
110
#ifndef HAVE_MVVLINE
 
111
#define HAVE_MVVLINE 0
 
112
#endif
 
113
 
 
114
#ifndef HAVE_MVWVLINE
 
115
#define HAVE_MVWVLINE 0
 
116
#endif
 
117
 
86
118
#ifndef HAVE_NAPMS
87
119
#define HAVE_NAPMS 1
88
120
#endif
95
127
#define HAVE_PANEL_H 0
96
128
#endif
97
129
 
 
130
#ifndef HAVE_PUTWIN
 
131
#define HAVE_PUTWIN 0
 
132
#endif
 
133
 
 
134
#ifndef HAVE_RESIZE_TERM
 
135
#define HAVE_RESIZE_TERM 0
 
136
#endif
 
137
 
 
138
#ifndef HAVE_RIPOFFLINE
 
139
#define HAVE_RIPOFFLINE 0
 
140
#endif
 
141
 
 
142
#ifndef HAVE_SETUPTERM
 
143
#define HAVE_SETUPTERM 0
 
144
#endif
 
145
 
98
146
#ifndef HAVE_SLK_COLOR
99
147
#define HAVE_SLK_COLOR 0
100
148
#endif
101
149
 
 
150
#ifndef HAVE_SLK_INIT
 
151
#define HAVE_SLK_INIT 0
 
152
#endif
 
153
 
 
154
#ifndef HAVE_TERMATTRS
 
155
#define HAVE_TERMATTRS 0
 
156
#endif
 
157
 
 
158
#ifndef HAVE_TERMNAME
 
159
#define HAVE_TERMNAME 0
 
160
#endif
 
161
 
 
162
#ifndef HAVE_TGETENT
 
163
#define HAVE_TGETENT 0
 
164
#endif
 
165
 
 
166
#ifndef HAVE_TIGETNUM
 
167
#define HAVE_TIGETNUM 0
 
168
#endif
 
169
 
 
170
#ifndef HAVE_TYPEAHEAD
 
171
#define HAVE_TYPEAHEAD 0
 
172
#endif
 
173
 
 
174
#ifndef HAVE_TIGETSTR
 
175
#define HAVE_TIGETSTR 0
 
176
#endif
 
177
 
 
178
#ifndef HAVE_WINSSTR
 
179
#define HAVE_WINSSTR 0
 
180
#endif
 
181
 
 
182
#ifndef HAVE_USE_DEFAULT_COLORS
 
183
#define HAVE_USE_DEFAULT_COLORS 0
 
184
#endif
 
185
 
102
186
#ifndef HAVE_WRESIZE
103
187
#define HAVE_WRESIZE 0
104
188
#endif
107
191
#define NCURSES_EXT_FUNCS 0
108
192
#endif
109
193
 
110
 
#ifndef NCURSES_NOMACROS
111
 
#define NCURSES_NOMACROS 0
112
 
#endif
113
 
 
114
194
#ifndef NEED_PTEM_H
115
195
#define NEED_PTEM_H 0
116
196
#endif
117
197
 
 
198
#ifndef NO_LEAKS
 
199
#define NO_LEAKS 0
 
200
#endif
 
201
 
118
202
#include <stdlib.h>
119
203
#include <string.h>
120
204
#include <sys/types.h>
125
209
 
126
210
#include <signal.h>     /* include before curses.h to work around glibc bug */
127
211
 
128
 
#if defined(HAVE_NCURSESW_NCURSES_H)
 
212
#if defined(HAVE_XCURSES)
 
213
#include <xcurses.h>
 
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>
 
218
#else
 
219
#include <curses.h>
 
220
#endif
 
221
 
 
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>
134
 
#else
135
 
#include <curses.h>
 
234
#elif defined(HAVE_TERM_H)
136
235
#include <term.h>
137
236
#endif
138
237
 
139
238
#ifdef NCURSES_VERSION
140
239
#define HAVE_COLOR_SET 1
141
 
#endif
142
 
 
143
 
#if NCURSES_NOMACROS
144
 
#include <nomacros.h>
 
240
#define HAVE_CHGAT 1
145
241
#endif
146
242
 
147
243
#if HAVE_GETOPT_H
166
262
#ifndef GCC_NORETURN
167
263
#define GCC_NORETURN /* nothing */
168
264
#endif
 
265
#ifndef GCC_PRINTFLIKE
 
266
#define GCC_PRINTFLIKE(a,b) /* nothing */
 
267
#endif
169
268
#ifndef GCC_UNUSED
170
269
#define GCC_UNUSED /* nothing */
171
270
#endif
174
273
#define getnstr(s,n) getstr(s)
175
274
#endif
176
275
 
 
276
#ifndef USE_SOFTKEYS
 
277
#if HAVE_SLK_INIT
 
278
#define USE_SOFTKEYS 1
 
279
#else
 
280
#define USE_SOFTKEYS 0
 
281
#endif
 
282
#endif
 
283
 
177
284
#ifndef USE_WIDEC_SUPPORT
178
285
#if defined(_XOPEN_SOURCE_EXTENDED) && defined(WACS_ULCORNER)
179
286
#define USE_WIDEC_SUPPORT 1
228
335
#define KEY_MIN 256     /* not defined in Solaris 8 */
229
336
#endif
230
337
 
231
 
#ifndef getcurx
 
338
/*
 
339
 * Workaround for HPUX
 
340
 */
 
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)
 
350
#endif
 
351
 
 
352
/*
 
353
 * These usually are implemented as macros, but may be functions.
 
354
 */
 
355
#if !defined(getcurx) && !HAVE_GETCURX
232
356
#define getcurx(win)            ((win)?(win)->_curx:ERR)
233
357
#define getcury(win)            ((win)?(win)->_cury:ERR)
234
358
#endif
235
359
 
236
 
#ifndef getbegx
 
360
#if !defined(getbegx) && !HAVE_GETBEGX
237
361
#define getbegx(win)            ((win)?(win)->_begx:ERR)
238
362
#define getbegy(win)            ((win)?(win)->_begy:ERR)
239
363
#endif
240
364
 
241
 
#ifndef getmaxx
 
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)
244
368
#endif
245
369
 
 
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))
 
373
#endif
 
374
 
 
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))
 
378
#endif
 
379
 
 
380
/*
 
381
 * Try to accommodate curses implementations that have no terminfo support.
 
382
 */
 
383
#if HAVE_TIGETNUM
 
384
#define TIGETNUM(ti,tc) tigetnum(ti)
 
385
#else
 
386
#define TIGETNUM(ti,tc) tgetnum(tc)
 
387
#endif
 
388
 
 
389
#if HAVE_TIGETSTR
 
390
#define TIGETSTR(ti,tc) tigetstr(ti)
 
391
#else
 
392
#define TIGETSTR(ti,tc) tgetstr(tc,&area_pointer)
 
393
#endif
 
394
 
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).
248
397
 */
295
444
 
296
445
#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~"
297
446
 
 
447
#define CATCHALL(handler) { \
 
448
                int nsig; \
 
449
                for (nsig = SIGHUP; nsig < SIGTERM; ++nsig) \
 
450
                    if (nsig != SIGKILL) \
 
451
                        signal(nsig, handler); \
 
452
            }
 
453
 
298
454
#endif /* __TEST_PRIV_H */