CVS Repository/ src/ gnu/ usr.bin/ binutils/ include/ demangle.h

Annotated Revision 1.7 Back
1.1  (niklas 08-Jan-96)  1
: /* Defs for interface to demanglers.
1.7  (fgsch 13-May-02)  2
:    Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
1.1  (niklas 08-Jan-96)  3
:    
   4
:    This program is free software; you can redistribute it and/or modify
   5
:    it under the terms of the GNU General Public License as published by
   6
:    the Free Software Foundation; either version 2, or (at your option)
   7
:    any later version.
   8
: 
   9
:    This program is distributed in the hope that it will be useful,
   10
:    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11
:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12
:    GNU General Public License for more details.
   13
: 
   14
:    You should have received a copy of the GNU General Public License
   15
:    along with this program; if not, write to the Free Software
1.2  (niklas 10-Jun-96)  16
:    Foundation, Inc., 59 Temple Place - Suite 330,
   17
:    Boston, MA 02111-1307, USA.  */
1.1  (niklas 08-Jan-96)  18
: 
   19
: 
   20
: #if !defined (DEMANGLE_H)
   21
: #define DEMANGLE_H
   22
: 
   23
: #include <ansidecl.h>
   24
: 
   25
: /* Options passed to cplus_demangle (in 2nd parameter). */
   26
: 
1.7  (fgsch 13-May-02)  27
: #define DMGL_NO_OPTS	 0		/* For readability... */
   28
: #define DMGL_PARAMS	 (1 << 0)	/* Include function args */
   29
: #define DMGL_ANSI	 (1 << 1)	/* Include const, volatile, etc */
   30
: #define DMGL_JAVA	 (1 << 2)	/* Demangle as Java rather than C++. */
   31
: 
   32
: #define DMGL_AUTO	 (1 << 8)
   33
: #define DMGL_GNU	 (1 << 9)
   34
: #define DMGL_LUCID	 (1 << 10)
   35
: #define DMGL_ARM	 (1 << 11)
   36
: #define DMGL_HP 	 (1 << 12)       /* For the HP aCC compiler;
   37
:                                             same as ARM except for
   38
:                                             template arguments, etc. */
   39
: #define DMGL_EDG	 (1 << 13)
1.3  (espie 12-Sep-00)  40
: 
1.1  (niklas 08-Jan-96)  41
: /* If none of these are set, use 'current_demangling_style' as the default. */
1.5  (espie 09-Jun-01)  42
: #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG)
1.1  (niklas 08-Jan-96)  43
: 
   44
: /* Enumeration of possible demangling styles.
   45
: 
   46
:    Lucid and ARM styles are still kept logically distinct, even though
   47
:    they now both behave identically.  The resulting style is actual the
   48
:    union of both.  I.E. either style recognizes both "__pt__" and "__rf__"
   49
:    for operator "->", even though the first is lucid style and the second
   50
:    is ARM style. (FIXME?) */
   51
: 
   52
: extern enum demangling_styles
   53
: {
   54
:   unknown_demangling = 0,
   55
:   auto_demangling = DMGL_AUTO,
   56
:   gnu_demangling = DMGL_GNU,
   57
:   lucid_demangling = DMGL_LUCID,
1.3  (espie 12-Sep-00)  58
:   arm_demangling = DMGL_ARM,
   59
:   hp_demangling = DMGL_HP,
1.5  (espie 09-Jun-01)  60
:   edg_demangling = DMGL_EDG
1.1  (niklas 08-Jan-96)  61
: } current_demangling_style;
   62
: 
   63
: /* Define string names for the various demangling styles. */
   64
: 
1.7  (fgsch 13-May-02)  65
: #define AUTO_DEMANGLING_STYLE_STRING	      "auto"
   66
: #define GNU_DEMANGLING_STYLE_STRING    	      "gnu"
   67
: #define LUCID_DEMANGLING_STYLE_STRING	      "lucid"
   68
: #define ARM_DEMANGLING_STYLE_STRING	      "arm"
   69
: #define HP_DEMANGLING_STYLE_STRING	      "hp"
   70
: #define EDG_DEMANGLING_STYLE_STRING	      "edg"
1.1  (niklas 08-Jan-96)  71
: 
   72
: /* Some macros to test what demangling style is active. */
   73
: 
   74
: #define CURRENT_DEMANGLING_STYLE current_demangling_style
   75
: #define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
   76
: #define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
   77
: #define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
1.3  (espie 12-Sep-00)  78
: #define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
   79
: #define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
   80
: #define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
1.1  (niklas 08-Jan-96)  81
: 
1.7  (fgsch 13-May-02)  82
: /* Provide information about the available demangle styles. This code is
   83
:    pulled from gdb into libiberty because it is useful to binutils also.  */
   84
: 
   85
: extern struct demangler_engine
   86
: {
   87
:   const char *demangling_style_name;
   88
:   enum demangling_styles demangling_style;
   89
:   const char *demangling_style_doc;
   90
: } libiberty_demanglers[];
   91
: 
1.1  (niklas 08-Jan-96)  92
: extern char *
   93
: cplus_demangle PARAMS ((const char *mangled, int options));
   94
: 
   95
: extern int
1.2  (niklas 10-Jun-96)  96
: cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
1.1  (niklas 08-Jan-96)  97
: 
1.2  (niklas 10-Jun-96)  98
: extern const char *
   99
: cplus_mangle_opname PARAMS ((const char *opname, int options));
1.1  (niklas 08-Jan-96)  100
: 
   101
: /* Note: This sets global state.  FIXME if you care about multi-threading. */
   102
: 
   103
: extern void
   104
: set_cplus_marker_for_demangling PARAMS ((int ch));
1.7  (fgsch 13-May-02)  105
: 
   106
: extern enum demangling_styles 
   107
: cplus_demangle_set_style PARAMS ((enum demangling_styles style));
   108
: 
   109
: extern enum demangling_styles 
   110
: cplus_demangle_name_to_style PARAMS ((const char *name));
1.1  (niklas 08-Jan-96)  111
: 
   112
: #endif	/* DEMANGLE_H */