cxref(1) cxref(1)
NAME
cxref - generate C program cross-reference table
SYNOPSIS
cxref [option...] file...
DESCRIPTION
The cxref (C cross reference) command analyzes a collection of C files
and builds a cross-reference table. cxref uses a special version of cc
to include information declared in #define statements in its symbol
table. It generates a list of all symbols (auto, static, and global)
in each individual file, or in combination if the -c option is used.
The table includes four fields: NAME, FILE, FUNCTION, and LINE. The
LINE field contains the numbers of the lines in which the symbol NAME
appears, and the nature of the reference in the lines concerned. The
following three types of access are marked:
assignment, using =
declaration, using -
definition, using *
Other types of access are not marked.
OPTIONS
cxref interprets the -D, -I, -U options in the same manner that cc/c89
does. In addition, cxref interprets the following options:
-c Combine the source files into a single report. Without the -c
option, cxref generates a separate report for each file on the
command line.
-d Disables the printing of declarations, making the report
easier to read.
-l Does not print local variables. Prints only global and file
scope statistics.
-o file Direct output to file.
-s Does not print input filenames.
-t Formats listing for 80-column width (default).
-w num The output is formatted to be no wider than num (decimal)
columns.
The default value is 80 if num is not specified or is less
than 51.
Page 1 Reliant UNIX 5.44 Printed 11/98
cxref(1) cxref(1)
-C Runs only the first pass of cxref, creating a .cx file that
can later be passed to cxref. -C is similar to the -c option
of cc or lint.
-F Prints the full path of the referenced filenames.
-Lcols Modifies the number of columns in the LINE field. If you do
not specify a number, cxref defaults to five columns.
-V Prints version information on the standard error output.
-Wwname,wfile,wfunction,wline
Changes the column widths of the fields to the value specified
by w*. All 4 values must be specified, separated by commas.
The default widths are:
Field Characters
NAME 15
FILE 13
FUNCTION 15
LINE 20 (4 per column)
-- If the first filename begins with a dash (-), the end of the
command-line options must be marked with --.
EXAMPLE
a.c
1 main()
2 {
3 int i;
4 extern char c;
5
6 i=65;
7 c=(char)i;
8 }
Page 2 Reliant UNIX 5.44 Printed 11/98
cxref(1) cxref(1)
Resulting cross-reference table:
a.c:
NAME FILE FUNCTION LINE
c a.c --- 4- 7=
i a.c main 3* 6= 7
main a.c --- 2*
u3b2 predefined --- 0*
unix predefined --- 0*
DIAGNOSTICS
Error messages usually mean you cannot compile the files.
LOCALE
The language of the message texts is governed by the environment vari-
able LCALL, LCMESSAGES or LANG.
When the default is set, the system behaves as if it were not interna-
tionalized, i.e. the message texts are in English. You must change one
of these variables in order to change the language of the message
texts.
Detailed information on the dependencies of the environment variables
and on internationalization in general can be found in the manual
"Programmer's Guide: Internationalization - Localization". Refer also
to environ(5) for information on setting the user environment.
FILES
TMPDIR/tcx.*
temporary files
TMPDIR/cx.*
provisional files
LIBDIR/xref
accessed by cxref
LIBDIR
usually /usr/ccs/lib
TMPDIR
usually /var/tmp, but can be redefined by setting the environment
variable TMPDIR [see tempnam in tmpnam(3S)].
SEE ALSO
cc(1), lint(1).
Page 3 Reliant UNIX 5.44 Printed 11/98