xref: /illumos-gate/usr/src/cmd/sgs/libelf/misc/elf_dem.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 
26 #pragma ident	"%Z%%M%	%I%	%E% SMI" 	/* SVr4.0 1.3	*/
27 
28 /* ELF interface header file for the C++ demangler.
29 
30    The C++ demangler is shared by the ELF library and the C++
31    translator.  Because the translator is used on many different
32    operating systems, not all of which use ELF, we have set up this
33    library so that it may be compiled to work with or without libelf.
34    The default is to compile for ELF.  Undefine the macro "ELF" in the
35    makefile before compiling for the translator.
36 
37    These macros tack an _elf_ on to the beginning of all global names
38    which should hidden outside of the demangler module.  The only
39    visible name at this time is the function "demangle" which is
40    mapped to "elf_demangle" for the ELF library.  Note that we use
41    "_elf_" to hide names even for the translator.  We could have used
42    just "_" but since the names are hidden why should we bother.
43 */
44 
45 #define	app_String	_elf_app_String
46 #define	demangle_doarg	_elf_demangle_doarg
47 #define	demangle_doargs	_elf_demangle_doargs
48 #define	findop		_elf_findop
49 #define	free_String	_elf_free_String
50 #define	mk_String	_elf_mk_String
51 #define	napp_String	_elf_napp_String
52 #define	nplist		_elf_nplist
53 #define	nprep_String	_elf_nprep_String
54 #define	prep_String	_elf_prep_String
55 #define	set_String	_elf_set_String
56 #define trunc_String	_elf_trunc_String
57 #define jbuf		_elf_jbuf
58 
59 extern	int		demangle_doarg();
60 extern	int		demangle_doargs();
61 
62 #if defined(ELF)
63 
64 #define	demangle	elf_demangle
65 
66 
67 /* Make sure that realloc isn't called inadvertantly.
68 */
69 #define realloc		__can_not_use_realloc_in_elf__
70 
71 #else /* defined(ELF) */
72 
73 #include <malloc.h>
74 
75 #endif	/* defined(ELF) */
76 
77 #ifdef __STDC__
78 #	include <limits.h>
79 #	define ID_NAME_MAX	INT_MAX
80 #else
81 	/* The only requirement on this is that it must be greater
82 	   than the length of any symbol.
83 	*/
84 #	define ID_NAME_MAX	30000
85 #endif
86