cxref(1) CLIX cxref(1)
NAME
cxref - Cross-references C source files
SYNOPSIS
cxref [-FSCcfis] [-w width] [files]
FLAGS
-F Folds case in comparison. By default, case is distinct in
comparison of identifiers and string and character constants.
The cxref command simply passes the -F flag to the sort command
as the -f flag.
-S Cross references all files separately. The default action is to
cross reference all named files together.
-c Leaves character constants out of the cross reference listing.
-f Leaves floating point constants out of the cross reference
listing.
-i Leaves integer constants out of the cross reference listing.
-s Leaves string constants out of the cross reference listing.
-C Leaves all constants (character, string, integer, and floating
point) out of the cross reference listing. By default, all
types of constants are included in the cross reference.
-w width Makes the output width columns wide. The output width will
never be less than 51 or more than 132 columns. The cxref
command silently adjusts incorrect settings to the nearest
allowable setting. If no width is specified, the output will
default to 80 columns wide.
DESCRIPTION
The cxref command reads the named C source files and produces on stdout a
cross reference of all the identifiers and constants in the files.
Constants are integer constants (such as 12, 0421, and 0x1A), floating
point constants (123.45, and 0.2e-4), string constants ("this is a
string\n"), and character constants ('a', and '\033'). Identifiers,
character constants, and string constants are sorted lexicographically;
that is, according to the machine collating sequence (seven-bit ASCII on
the Vax or Pyramid). Integer and floating point constants are sorted
numerically. The trailing 'l' or
If no files are named, cxref reads from stdin. For multiple files, the
argument - (a single dash) indicates that the standard input should be
2/94 - Intergraph Corporation 1
cxref(1) CLIX cxref(1)
read at that point.
If flags are given, they must be specified before any file names.
The cxref command does not include #include files, or expand macro
definitions. Files named in #include lines can be listed on the command
line if they should also be cross referenced.
If a quoted string has a newline escape sequence in it, it will show up
inside the string in the output listing as \N. This makes it visible to
the programmer, and prevents confusion for the various filters which cxref
uses to actually do the work.
The cxref command is best run in the background, with its output
redirected into a file or the line printer spooler lpr, since it reads all
the named files, using the sort command as an intermediate pass. The
sorting can take time.
EXAMPLES
1. The following example creates a cross-reference table for the file
main.c and displays it to stdout.
cxref main.c
2. The following example creates a cross-reference table for all C files
in the current directory and places it in the file results. The
output width is set to 132.
cxref -w 132 *.c > results
FILES
/tmp/cxr.$$.* Temporary files for integer and floating point contstants.
The cxref command removes these files when it completes.
CAUTIONS
The cxref command does not do any formatting on its output (other than to
insure that it writes the proper number of columns), so it should probably
be run by piping its output into the pr command.
Floating point constants are converted to a common format for sorting;
therefore, they may appear in the output in a format different from (but
numerically equivalent to) their form in the original source code.
DIAGNOSTICS
The diagnostics are designed to be self-explanatory.
2 Intergraph Corporation - 2/94
cxref(1) CLIX cxref(1)
EXIT VALUES
The cxref command exits with a value of 0 if successful. Otherwise, it
exits with a value of 1.
RELATED INFORMATION
Commands: lex(1), lpr(1), pr(1), sort(1)
2/94 - Intergraph Corporation 3