Amiga Unix — 68040 · 68060

Manual pages › General commands (1)

cxref(1)

generate C program cross-reference

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

NAME

cxref - generate C program cross-reference

SYNOPSIS

cxref [options] files

DESCRIPTION

The cxref command analyzes a collection of C files and builds a cross-reference table. cxref uses a special version of cc to include #define'd information in its symbol table. It generates a list of all symbols (auto, static, and global) in each individual file, or, with the -c option, in combination. The table includes four fields: NAME, FILE, FUNCTION, and LINE. The line numbers appearing in the LINE field also show reference marks as appropriate. The reference marks include:

assignment     =
declaration    -
definition     *

If no reference marks appear, you can assume a general reference.

OPTIONS

cxref interprets the -D, -I, -U options in the same manner that cc 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 printing 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 Operates silently; does not print input file names.

-t Format listing for 80-column width.

-wnum Width option that formats output no wider than num (decimal) columns. This option will default to 80 if num is not specified or is less than 51.

-C Runs only the first pass of cxref, creating a .cx file that can later be passed to cxref. This is similar to the -c option of cc or lint.

-F Prints the full path of the referenced file names.

-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.

-Wname,file, function, line

Changes the default width of at least one field. The default widths are:

Field             Characters

NAME           15
FILE           13
FUNCTION       15
LINE           20 (4 per column)

FILES

TMPDIR/tcx.* temporary files

TMPDIR/cx.* temporary 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)].

EXAMPLE

a.c

1    main()
2    {
3         int i;
4         extern char c;
5
6         i=65;
7         c=(char)i;
8    }

Resulting cross-reference table:

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*

SEE ALSO

cc(1), lint(1).

DIAGNOSTICS

Error messages usually mean you cannot compile the files.