]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/test.priv.h
ncurses 5.2
[ncurses.git] / test / test.priv.h
1 /****************************************************************************
2  * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
3  *                                                                          *
4  * Permission is hereby granted, free of charge, to any person obtaining a  *
5  * copy of this software and associated documentation files (the            *
6  * "Software"), to deal in the Software without restriction, including      *
7  * without limitation the rights to use, copy, modify, merge, publish,      *
8  * distribute, distribute with modifications, sublicense, and/or sell       *
9  * copies of the Software, and to permit persons to whom the Software is    *
10  * furnished to do so, subject to the following conditions:                 *
11  *                                                                          *
12  * The above copyright notice and this permission notice shall be included  *
13  * in all copies or substantial portions of the Software.                   *
14  *                                                                          *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22  *                                                                          *
23  * Except as contained in this notice, the name(s) of the above copyright   *
24  * holders shall not be used in advertising or otherwise to promote the     *
25  * sale, use or other dealings in this Software without prior written       *
26  * authorization.                                                           *
27  ****************************************************************************/
28
29 /****************************************************************************
30  *  Author: Thomas E. Dickey <dickey@clark.net> 1996                        *
31  ****************************************************************************/
32 /* $Id: test.priv.h,v 1.19 2000/09/02 19:31:58 tom Exp $ */
33
34 #if HAVE_CONFIG_H
35 #include <ncurses_cfg.h>
36 #else
37 #define HAVE_CURSES_VERSION 0
38 #define HAVE_RESIZETERM 0
39 #define HAVE_USE_DEFAULT_COLORS 0
40 #define HAVE_WRESIZE 0
41 #endif
42
43 #ifndef HAVE_NC_ALLOC_H
44 #define HAVE_NC_ALLOC_H 0
45 #endif
46
47 #ifndef HAVE_LOCALE_H
48 #define HAVE_LOCALE_H 0
49 #endif
50
51 #ifndef NCURSES_NOMACROS
52 #define NCURSES_NOMACROS 0
53 #endif
54
55 #ifndef NEED_PTEM_H
56 #define NEED_PTEM_H 0
57 #endif
58
59 #include <stdlib.h>
60 #include <string.h>
61 #include <sys/types.h>
62
63 #if HAVE_UNISTD_H
64 #include <unistd.h>
65 #endif
66
67 #include <curses.h>
68
69 #if NCURSES_NOMACROS
70 #include <nomacros.h>
71 #endif
72
73 #if HAVE_GETOPT_H
74 #include <getopt.h>
75 #else
76 /* 'getopt()' may be prototyped in <stdlib.h>, but declaring its variables
77  * doesn't hurt.
78  */
79 extern char *optarg;
80 extern int optind;
81 #endif /* HAVE_GETOPT_H */
82
83 #ifndef GCC_NORETURN
84 #define GCC_NORETURN /* nothing */
85 #endif
86 #ifndef GCC_UNUSED
87 #define GCC_UNUSED /* nothing */
88 #endif
89
90 #define SIZEOF(table)   (sizeof(table)/sizeof(table[0]))
91
92 #if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H
93 #include <nc_alloc.h>
94 #else
95 #define typeMalloc(type,n) (type *) malloc(n * sizeof(type))
96 #define typeRealloc(type,n,p) (type *) realloc(p, n * sizeof(type))
97 #endif
98
99 #ifndef ExitProgram
100 #define ExitProgram(code) return code
101 #endif
102
103 #ifndef EXIT_SUCCESS
104 #define EXIT_SUCCESS 0
105 #endif
106 #ifndef EXIT_FAILURE
107 #define EXIT_FAILURE 1
108 #endif
109
110 /* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
111  * curses which doesn't have const parameters declared (so far) in the places
112  * that XSI shows.
113  */
114 #ifndef NCURSES_CONST
115 #define NCURSES_CONST /* nothing */
116 #endif