]> ncurses.scripts.mit.edu Git - ncurses.git/blob - include/nc_alloc.h
362e41dd373da6b64b41fc0910efcc809068d837
[ncurses.git] / include / nc_alloc.h
1 /******************************************************************************
2  * Copyright 1996,1997 by Thomas E. Dickey <dickey@clark.net>                 *
3  * All Rights Reserved.                                                       *
4  *                                                                            *
5  * Permission to use, copy, modify, and distribute this software and its      *
6  * documentation for any purpose and without fee is hereby granted, provided  *
7  * that the above copyright notice appear in all copies and that both that    *
8  * copyright notice and this permission notice appear in supporting           *
9  * documentation, and that the name of the above listed copyright holder(s)   *
10  * not be used in advertising or publicity pertaining to distribution of the  *
11  * software without specific, written prior permission. THE ABOVE LISTED      *
12  * COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,  *
13  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO     *
14  * EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY         *
15  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER       *
16  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF       *
17  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN        *
18  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.                   *
19  ******************************************************************************/
20 /* $Id: nc_alloc.h,v 1.4 1997/02/15 18:51:39 tom Exp $ */
21
22 #ifndef NC_ALLOC_included
23 #define NC_ALLOC_included 1
24
25 #if HAVE_LIBDMALLOC
26 #include <dmalloc.h>    /* Gray Watson's library */
27 #else
28 #undef  HAVE_LIBDMALLOC
29 #define HAVE_LIBDMALLOC 0
30 #endif
31
32 #if HAVE_LIBDBMALLOC
33 #include <dbmalloc.h>   /* Conor Cahill's library */
34 #else
35 #undef  HAVE_LIBDBMALLOC
36 #define HAVE_LIBDBMALLOC 0
37 #endif
38
39 #ifndef NO_LEAKS
40 #define NO_LEAKS 0
41 #endif
42
43 #ifndef HAVE_NC_FREEALL
44 #define HAVE_NC_FREEALL 0
45 #endif
46
47 #if HAVE_LIBDBMALLOC || HAVE_LIBDMALLOC || NO_LEAKS || HAVE_NC_FREEALL
48 struct termtype;
49 extern void _nc_free_and_exit(int) GCC_NORETURN;
50 extern void _nc_free_tparm(void);
51 extern void _nc_leaks_dump_entry(void);
52 extern void _nc_free_termtype(struct termtype *, int);
53 #define ExitProgram(code) _nc_free_and_exit(code)
54 #endif
55
56 #ifndef ExitProgram
57 #define ExitProgram(code) return code
58 #endif
59
60 #endif /* NC_ALLOC_included */