xref: /illumos-gate/usr/src/cmd/sgs/libelf/misc/elf_dem.h (revision 2a8bcb4e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1988 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 /* ELF interface header file for the C++ demangler.
26 
27    The C++ demangler is shared by the ELF library and the C++
28    translator.  Because the translator is used on many different
29    operating systems, not all of which use ELF, we have set up this
30    library so that it may be compiled to work with or without libelf.
31    The default is to compile for ELF.  Undefine the macro "ELF" in the
32    makefile before compiling for the translator.
33 
34    These macros tack an _elf_ on to the beginning of all global names
35    which should hidden outside of the demangler module.  The only
36    visible name at this time is the function "demangle" which is
37    mapped to "elf_demangle" for the ELF library.  Note that we use
38    "_elf_" to hide names even for the translator.  We could have used
39    just "_" but since the names are hidden why should we bother.
40 */
41 
42 #define	app_String	_elf_app_String
43 #define	demangle_doarg	_elf_demangle_doarg
44 #define	demangle_doargs	_elf_demangle_doargs
45 #define	findop		_elf_findop
46 #define	free_String	_elf_free_String
47 #define	mk_String	_elf_mk_String
48 #define	napp_String	_elf_napp_String
49 #define	nplist		_elf_nplist
50 #define	nprep_String	_elf_nprep_String
51 #define	prep_String	_elf_prep_String
52 #define	set_String	_elf_set_String
53 #define trunc_String	_elf_trunc_String
54 #define jbuf		_elf_jbuf
55 
56 extern	int		demangle_doarg();
57 extern	int		demangle_doargs();
58 
59 #if defined(ELF)
60 
61 #define	demangle	elf_demangle
62 
63 
64 /* Make sure that realloc isn't called inadvertantly.
65 */
66 #define realloc		__can_not_use_realloc_in_elf__
67 
68 #else /* defined(ELF) */
69 
70 #include <malloc.h>
71 
72 #endif	/* defined(ELF) */
73 
74 #ifdef __STDC__
75 #	include <limits.h>
76 #	define ID_NAME_MAX	INT_MAX
77 #else
78 	/* The only requirement on this is that it must be greater
79 	   than the length of any symbol.
80 	*/
81 #	define ID_NAME_MAX	30000
82 #endif
83