Current File : //usr/share/man/man3ext/demangle.3ext
'\" te
.\"  Copyright (c) 1997 Sun Microsystems, Inc  All Rights Reserved
.TH demangle 3EXT "11 Mar 1997" "SunOS 5.11" "Extended Library Functions"
.SH NAME
demangle, cplus_demangle \- decode a C++ encoded symbol name
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR[ \fIlibrary\fR ... ]  \fB-ldemangle\fR

#include <demangle.h>



\fBint\fR \fBcplus_demangle\fR(\fBconst char *\fR\fIsymbol\fR, \fBchar *\fR\fIprototype\fR, \fBsize_t\fR \fIsize\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBcplus_demangle()\fR function decodes (demangles) a C++ linker symbol name (mangled name)  into a (partial) C++ prototype, if possible.   C++ mangled names may not have enough information to form a complete prototype.
.sp
.LP
The  \fIsymbol\fR string argument points to the input mangled name.
.sp
.LP
The \fIprototype\fR argument points to a user-specified output string buffer, of \fBsize\fR bytes.
.sp
.LP
The  \fBcplus_demangle()\fR function operates on mangled names generated by  SPARCompilers C++ 3.0.1, 4.0.1, 4.1 and 4.2.
.sp
.LP
The \fBcplus_demangle()\fR function improves and replaces the \fBdemangle()\fR function.
.sp
.LP
Refer to the \fBCC.1\fR, \fBdem.1\fR, and \fBc++filt.1\fR manual pages in the \fB/opt/SUNWspro/man/man1\fR directory.  These pages are only available with the SPROcc package.
.SH RETURN VALUES
.sp
.LP
The \fBcplus_demangle()\fR function returns the following values:
.sp
.ne 2
.mk
.na
\fB\fB0\fR\fR
.ad
.RS 19n
.rt  
The \fIsymbol\fR argument is a valid mangled name and \fIprototype\fR contains a (partial) prototype for the symbol.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDEMANGLE_ENAME\fR\fR
.ad
.RS 19n
.rt  
The \fIsymbol\fR argument is not a valid mangled name and the content of \fIprototype\fR is a copy of the symbol.
.RE

.sp
.ne 2
.mk
.na
\fB\fBDEMANGLE_ESPACE\fR\fR
.ad
.RS 19n
.rt  
The \fIprototype\fR output buffer is too small to contain the prototype (or the symbol), and the content of \fIprototype\fR is undefined.
.RE