Demangle.h

Go to the documentation of this file.
00001 /* @(#)root/clib:$Id: Demangle.h 20882 2007-11-19 11:31:26Z rdm $ */
00002 /* Author: */
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 /* Defs for interface to demanglers.
00013    Copyright 1992 Free Software Foundation, Inc.
00014 
00015    This program is free software; you can redistribute it and/or modify
00016    it under the terms of the GNU General Public License as published by
00017    the Free Software Foundation; either version 2, or (at your option)
00018    any later version.
00019 
00020    This program is distributed in the hope that it will be useful,
00021    but WITHOUT ANY WARRANTY; without even the implied warranty of
00022    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023    GNU General Public License for more details.
00024 
00025    You should have received a copy of the GNU General Public License
00026    along with this program; if not, write to the Free Software
00027    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
00028 
00029 
00030 #if !defined (DEMANGLE_H)
00031 #define DEMANGLE_H
00032 
00033 /* Options passed to cplus_demangle (in 2nd parameter). */
00034 
00035 #define DMGL_NO_OPTS    0               /* For readability... */
00036 #define DMGL_PARAMS     (1 << 0)        /* Include function args */
00037 #define DMGL_ANSI       (1 << 1)        /* Include const, volatile, etc */
00038 
00039 #define DMGL_AUTO       (1 << 8)
00040 #define DMGL_GNU        (1 << 9)
00041 #define DMGL_LUCID      (1 << 10)
00042 #define DMGL_ARM        (1 << 11)
00043 /* If none of these are set, use 'current_demangling_style' as the default. */
00044 #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM)
00045 
00046 /* Define string names for the various demangling styles. */
00047 
00048 #define AUTO_DEMANGLING_STYLE_STRING    "auto"
00049 #define GNU_DEMANGLING_STYLE_STRING     "gnu"
00050 #define LUCID_DEMANGLING_STYLE_STRING   "lucid"
00051 #define ARM_DEMANGLING_STYLE_STRING     "arm"
00052 
00053 /* Some macros to test what demangling style is active. */
00054 
00055 #define CURRENT_DEMANGLING_STYLE current_demangling_style
00056 #define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
00057 #define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
00058 #define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
00059 #define ARM_DEMANGLING (CURRENT_DEMANGLING_STYLE & DMGL_ARM)
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 /* Enumeration of possible demangling styles.
00066 
00067    Lucid and ARM styles are still kept logically distinct, even though
00068    they now both behave identically.  The resulting style is actual the
00069    union of both.  I.E. either style recognizes both "__pt__" and "__rf__"
00070    for operator "->", even though the first is lucid style and the second
00071    is ARM style. (FIXME?) */
00072 
00073 extern enum demangling_styles
00074 {
00075   unknown_demangling = 0,
00076   auto_demangling = DMGL_AUTO,
00077   gnu_demangling = DMGL_GNU,
00078   lucid_demangling = DMGL_LUCID,
00079   arm_demangling = DMGL_ARM
00080 } current_demangling_style;
00081 
00082 
00083 extern char *
00084 cplus_demangle (const char *mangled, int options);
00085 
00086 extern int
00087 cplus_demangle_opname (char *opname, char *result, int options);
00088 
00089 /* Note: This sets global state.  FIXME if you care about multi-threading. */
00090 
00091 extern void
00092 set_cplus_marker_for_demangling (int ch);
00093 
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097 
00098 #endif  /* DEMANGLE_H */

Generated on Tue Jul 5 14:11:24 2011 for ROOT_528-00b_version by  doxygen 1.5.1