1 /*****
2 * XmHTMLfuncs.h : memory allocation macros.
3 *
4 * This file Version	$Revision: 1.18 $
5 *
6 * Creation date:		Tue Dec  3 15:00:14 GMT+0100 1996
7 * Last modification: 	$Date: 1998/04/27 06:58:02 $
8 * By:					$Author: newt $
9 * Current State:		$State: Exp $
10 *
11 * Author:				newt
12 * (C)Copyright 1995-1996 Ripley Software Development
13 * All Rights Reserved
14 *
15 * This file is part of the XmHTML Widget Library.
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Library General Public
19 * License as published by the Free Software Foundation; either
20 * version 2 of the License, or (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25 * Library General Public License for more details.
26 *
27 * You should have received a copy of the GNU Library General Public
28 * License along with this library; if not, write to the Free
29 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 *
31 *****/
32 /*****
33 * $Source: /usr/local/rcs/Newt/XmHTML/RCS/XmHTMLfuncs.h,v $
34 *****/
35 /*****
36 * ChangeLog
37 * $Log: XmHTMLfuncs.h,v $
38 * Revision 1.18  1998/04/27 06:58:02  newt
39 * Added a few more default values
40 *
41 * Revision 1.17  1998/04/04 06:27:56  newt
42 * XmHTML Beta 1.1.3
43 *
44 * Revision 1.16  1997/10/23 00:24:48  newt
45 * XmHTML Beta 1.1.0 release
46 *
47 * Revision 1.15  1997/08/30 00:43:02  newt
48 * HashTable stuff. Changed proto's for almost every routine in here.
49 *
50 * Revision 1.14  1997/08/01 12:56:02  newt
51 * Progressive image loading changes. Changes to debug memory alloc protos.
52 *
53 * Revision 1.13  1997/05/28 01:43:34  newt
54 * Added protos and defines for debug memory allocation functions.
55 *
56 * Revision 1.12  1997/04/29 14:23:32  newt
57 * Moved all XmHTML private functions to XmHTMLP.h
58 *
59 * Revision 1.11  1997/04/03 05:32:52  newt
60 * ImageInfoShared macro. _XmHTMLLoadBodyImage proto
61 *
62 * Revision 1.10  1997/03/28 07:06:42  newt
63 * Frame interface prototypes from frames.c
64 *
65 * Revision 1.9  1997/03/20 08:07:25  newt
66 * added external html_tokens definition, _XmHTMLReplaceOrUpdateImage
67 *
68 * Revision 1.8  1997/03/11 19:52:05  newt
69 * ImageBuffer; XmHTMLImage and XmImageInfo macros; new protos for animated Gifs
70 *
71 * Revision 1.7  1997/03/04 18:47:01  newt
72 * _XmHTMLDrawImagemapSelection proto added
73 *
74 * Revision 1.6  1997/03/04 00:57:29  newt
75 * Delayed Image Loading: _XmHTMLReplaceImage and _XmHTMLUpdateImage
76 *
77 * Revision 1.5  1997/03/02 23:14:13  newt
78 * malloc defines; function proto's for all private image/imagemap routines
79 *
80 * Revision 1.4  1997/02/11 02:02:57  newt
81 * Changes for NEED_STRCASECMP
82 *
83 * Revision 1.3  1997/01/09 06:55:59  newt
84 * expanded copyright marker
85 *
86 * Revision 1.2  1997/01/09 06:48:43  newt
87 * updated function definitions
88 *
89 * Revision 1.1  1996/12/19 02:17:18  newt
90 * Initial Revision
91 *
92 *****/
93 
94 #ifndef _XmHTMLfuncs_h_
95 #define _XmHTMLfuncs_h_
96 
97 #include <errno.h>
98 #include <X11/IntrinsicP.h>		/* for Widget definition & fast macros */
99 
100 /*****
101 * Using #if !defined(DMALLOC) && !defined(DEBUG) seems to trigger a bug
102 * on SparcWorks CPP, so we use the old #ifndef combi's to work around it.
103 * Fix 10/27/97-01, shl.
104 *****/
105 #ifndef DMALLOC
106 #ifndef DEBUG
107 
108 /* Normal builds use Xt memory functions */
109 #define malloc(SZ)			XtMalloc((SZ))
110 #define calloc(N,SZ)		XtCalloc((N),(SZ))
111 #define realloc(PTR,SZ)		XtRealloc((char*)(PTR),(SZ))
112 #define free(PTR)			XtFree((char*)(PTR))
113 #define strdup(STR)			XtNewString((STR))
114 
115 #else	/* DEBUG defined */
116 
117 /* debug builds use asserted functions unless DMALLOC is defined */
118 extern char *__rsd_malloc(size_t size, char *file, int line);
119 extern char *__rsd_calloc(size_t nmemb, size_t size, char *file, int line);
120 extern char *__rsd_realloc(void *ptr, size_t size, char *file, int line);
121 extern char *__rsd_strdup(const char *s1, char *file, int line);
122 extern void  __rsd_free(void *ptr, char *file, int line);
123 
124 /* redefine the real functions to use our private ones */
125 #define malloc(SZ)			__rsd_malloc((SZ), __FILE__, __LINE__)
126 #define calloc(N,SZ)		__rsd_calloc((N),(SZ), __FILE__, __LINE__)
127 #define realloc(PTR,SZ)		__rsd_realloc((PTR),(SZ), __FILE__, __LINE__)
128 #define free(PTR)			__rsd_free((PTR), __FILE__, __LINE__)
129 #define strdup(STR)			__rsd_strdup((STR), __FILE__, __LINE__)
130 
131 #endif /* DEBUG */
132 #else /* DMALLOC */
133 
134 /* let dmalloc.h define it all */
135 #include <dmalloc.h>
136 
137 #endif /* DMALLOC */
138 
139 /* Don't add anything after this endif! */
140 #endif /* _XmHTMLfuncs_h_ */
141