blob: 9014e74abf09433990b80c9d7cb04a2e44de1b4b [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001/****************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002 * Copyright 2019,2020 Thomas E. Dickey *
3 * Copyright 2010,2012 Free Software Foundation, Inc. *
Steve Kondikae271bc2015-11-15 02:50:53 +01004 * *
5 * Permission is hereby granted, free of charge, to any person obtaining a *
6 * copy of this software and associated documentation files (the *
7 * "Software"), to deal in the Software without restriction, including *
8 * without limitation the rights to use, copy, modify, merge, publish, *
9 * distribute, distribute with modifications, sublicense, and/or sell *
10 * copies of the Software, and to permit persons to whom the Software is *
11 * furnished to do so, subject to the following conditions: *
12 * *
13 * The above copyright notice and this permission notice shall be included *
14 * in all copies or substantial portions of the Software. *
15 * *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * *
24 * Except as contained in this notice, the name(s) of the above copyright *
25 * holders shall not be used in advertising or otherwise to promote the *
26 * sale, use or other dealings in this Software without prior written *
27 * authorization. *
28 ****************************************************************************/
29
30/****************************************************************************
31 * Author: Thomas E. Dickey 2010 *
32 ****************************************************************************/
33
34/*
micky3879b9f5e72025-07-08 18:04:53 -040035 * $Id: build.priv.h,v 1.12 2020/02/02 23:34:34 tom Exp $
Steve Kondikae271bc2015-11-15 02:50:53 +010036 *
37 * build.priv.h
38 *
micky3879b9f5e72025-07-08 18:04:53 -040039 * This is a reduced version of curses.priv.h, for build-time utilities.
Steve Kondikae271bc2015-11-15 02:50:53 +010040 * Because it has fewer dependencies, this simplifies cross-compiling.
41 *
42 */
43
44#ifndef CURSES_PRIV_H
45#define CURSES_PRIV_H 1
46
47#include <ncurses_dll.h>
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53#include <ncurses_cfg.h>
54
55#if USE_RCS_IDS
56#define MODULE_ID(id) static const char Ident[] = id;
57#else
micky3879b9f5e72025-07-08 18:04:53 -040058#define MODULE_ID(id) /*nothing */
Steve Kondikae271bc2015-11-15 02:50:53 +010059#endif
60
61#include <stdlib.h>
62#include <string.h>
63#include <sys/types.h>
64
65#include <assert.h>
66#include <stdio.h>
67
68#include <errno.h>
69
micky3879b9f5e72025-07-08 18:04:53 -040070#include <curses.h> /* we'll use -Ipath directive to get the right one! */
Steve Kondikae271bc2015-11-15 02:50:53 +010071
72/* usually in <unistd.h> */
73#ifndef EXIT_SUCCESS
74#define EXIT_SUCCESS 0
75#endif
76
77#ifndef EXIT_FAILURE
78#define EXIT_FAILURE 1
79#endif
80
micky3879b9f5e72025-07-08 18:04:53 -040081#define FreeAndNull(p) do { free(p); p = 0; } while (0)
Steve Kondikae271bc2015-11-15 02:50:53 +010082#define UChar(c) ((unsigned char)(c))
83#define SIZEOF(v) (sizeof(v) / sizeof(v[0]))
84
85#include <nc_alloc.h>
86#include <nc_string.h>
87
88/* declare these, to avoid needing term.h */
89#if BROKEN_LINKER || USE_REENTRANT
90#define NCURSES_ARRAY(name) \
91 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, name)
92
micky3879b9f5e72025-07-08 18:04:53 -040093 NCURSES_ARRAY(boolnames);
94 NCURSES_ARRAY(boolfnames);
95 NCURSES_ARRAY(numnames);
96 NCURSES_ARRAY(numfnames);
97 NCURSES_ARRAY(strnames);
98 NCURSES_ARRAY(strfnames);
Steve Kondikae271bc2015-11-15 02:50:53 +010099#endif
100
101#if NO_LEAKS
micky3879b9f5e72025-07-08 18:04:53 -0400102 NCURSES_EXPORT(void) _nc_names_leaks(void);
Steve Kondikae271bc2015-11-15 02:50:53 +0100103#endif
104
105#ifdef __cplusplus
106}
107#endif
micky3879b9f5e72025-07-08 18:04:53 -0400108#endif /* CURSES_PRIV_H */