Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | * Copyright (c) 2010,2012 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 2010 * |
| 31 | ****************************************************************************/ |
| 32 | |
| 33 | /* |
| 34 | * $Id: build.priv.h,v 1.9 2012/02/22 22:17:02 tom Exp $ |
| 35 | * |
| 36 | * build.priv.h |
| 37 | * |
| 38 | * This is a reduced version of curses.priv.h, for build-time utilties. |
| 39 | * Because it has fewer dependencies, this simplifies cross-compiling. |
| 40 | * |
| 41 | */ |
| 42 | |
| 43 | #ifndef CURSES_PRIV_H |
| 44 | #define CURSES_PRIV_H 1 |
| 45 | |
| 46 | #include <ncurses_dll.h> |
| 47 | |
| 48 | #ifdef __cplusplus |
| 49 | extern "C" { |
| 50 | #endif |
| 51 | |
| 52 | #include <ncurses_cfg.h> |
| 53 | |
| 54 | #if USE_RCS_IDS |
| 55 | #define MODULE_ID(id) static const char Ident[] = id; |
| 56 | #else |
| 57 | #define MODULE_ID(id) /*nothing*/ |
| 58 | #endif |
| 59 | |
| 60 | #include <stdlib.h> |
| 61 | #include <string.h> |
| 62 | #include <sys/types.h> |
| 63 | |
| 64 | #include <assert.h> |
| 65 | #include <stdio.h> |
| 66 | |
| 67 | #include <errno.h> |
| 68 | |
| 69 | #include <curses.h> /* we'll use -Ipath directive to get the right one! */ |
| 70 | |
| 71 | /* usually in <unistd.h> */ |
| 72 | #ifndef EXIT_SUCCESS |
| 73 | #define EXIT_SUCCESS 0 |
| 74 | #endif |
| 75 | |
| 76 | #ifndef EXIT_FAILURE |
| 77 | #define EXIT_FAILURE 1 |
| 78 | #endif |
| 79 | |
| 80 | #define FreeAndNull(p) free(p); p = 0 |
| 81 | #define UChar(c) ((unsigned char)(c)) |
| 82 | #define SIZEOF(v) (sizeof(v) / sizeof(v[0])) |
| 83 | |
| 84 | #include <nc_alloc.h> |
| 85 | #include <nc_string.h> |
| 86 | |
| 87 | /* declare these, to avoid needing term.h */ |
| 88 | #if BROKEN_LINKER || USE_REENTRANT |
| 89 | #define NCURSES_ARRAY(name) \ |
| 90 | NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, name) |
| 91 | |
| 92 | NCURSES_ARRAY(boolnames); |
| 93 | NCURSES_ARRAY(boolfnames); |
| 94 | NCURSES_ARRAY(numnames); |
| 95 | NCURSES_ARRAY(numfnames); |
| 96 | NCURSES_ARRAY(strnames); |
| 97 | NCURSES_ARRAY(strfnames); |
| 98 | #endif |
| 99 | |
| 100 | #if NO_LEAKS |
| 101 | NCURSES_EXPORT(void) _nc_names_leaks(void); |
| 102 | #endif |
| 103 | |
| 104 | #ifdef __cplusplus |
| 105 | } |
| 106 | #endif |
| 107 | |
| 108 | #endif /* CURSES_PRIV_H */ |