Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Unmangle

Tool

SYNTAX

Unmangle [signature]… [-a[ctive]] [-h[elp]] [-t[arget]] [-v[erbose]]
< file

DESCRIPTION

A C++ "mangled" signature is unmangled. The signature(s) may be specified explicitly on the command line or as the current selection of the {active} or {target} window. If signature(s) are not specified in these ways, then they are read one per line from stdin.

If the input text can be unmangled, then the unmangled function name is written with no additional adornments (unless -verbose is specified), otherwise the unmodified input text is output.

Note that this tool differs from the previous MPW unmangling tool (UnmangleTool) by being more general in the form of its inputs (i.e., active, target, and stdin selections) and that only the unmangled name is output (unless -verbose is selected.) The previous tool always prefixed the unmangled name with the string "Unmangled symbol:" or "Wasn't mangled:". This change makes the new Unmangle more amenable for use in scripts and AddMenu commands.

INPUT

Unmangle reads from stdin (one signature per line) if signatures are not supplied in the argument list or via -a or -t.

OUTPUT

The unmangled function name is written to stdout.

STATUS

Unmangle can return the following status codes:

0

no errors

1

syntax error

2

execution error

PARAMETERS

signature

Specifies one or more signatures to be unmangled.

OPTIONS

-a[ctive]

Uses the current selection in the {active} window.

-h[elp]

Displays command syntax.

-t[arget]

Uses the current selection in the {target} window.

-v[erbose]

Duplicates the output of the old UnmangleTool command.

EXAMPLES

The following command line unmangles the signature "mangledname":

Unmangle mangledname

The following command line unmangles the specified signatures prefixing each line of output with "Unmangled symbol: " or "Wasn't mangled: ":

Unmangle -verbose mangledname1 mangledname2

The following command line unmangles the current selection in the target window:

Unmangle -target

The following command line unmangles the contents of a file via stdin. The file is assumed to consist ONLY of signatures to unmangle, one per line. Whitespace is ignored.

Unmangle < file

The following command line defines a menu command (which can be triggered using command-U) to REPLACE the current selection in the active window with the unmangled name. If the name is not mangled, the selection remains unchanged.

AddMenu Edit 'Unmangle/U' ∂
'Unmangle -a | Catenate >"{active}".§'

The following command line is similar to the previous example except stdin is used to get the current selection in the active window. When stdin is used for input, the output will have line-feeds. This permits the selection to have multiple lines of input, one signature per line.

AddMenu Edit 'Unmangle/U' ∂
'Unmangle <"{active}".§ | Catenate >"{active}".§'

The following command line defines a menu command that unmangles the current selection in the active window and displays the unmangled name in an alert dialog.

AddMenu Edit Unmangle 'Alert -s "`Unmangle -a`"'

 
 


Last Updated July 2000