'\macro stdmacro .if n .pH g1.cxref @(#)cxref 40.17 of 10/10/89 .\" Copyright 1989 AT&T .nr X .if \nX=0 .ds x} cxref 1 "" "\&" .if \nX=1 .ds x} cxref 1 "" .if \nX=2 .ds x} cxref 1 "" "\&" .if \nX=3 .ds x} cxref "" "" "\&" .TH cxref 1 "23 March 1998" .SH NAME cxref \- generate C program cross-reference .SH SYNOPSIS \f4cxref [\f2options\f4] \f2files\f1 .SH DESCRIPTION .ds ]W The \f4cxref\fP command analyzes a collection of C files and builds a cross-reference table. \f4cxref\f uses a special version of \f4cc\fP to include \f4#define\f1'd information in its symbol table. It generates a list of all symbols (auto, static, and global) in each individual file, or, with the \f4\-c\f1 option, in combination. The table includes four fields: .SM NAME, .SM FILE, .SM FUNCTION, and .SM LINE. The line numbers appearing in the .SM LINE field also show reference marks as appropriate. The reference marks include: .PP .nf .sp assignment = declaration \- definition * .sp .fi .PP If no reference marks appear, you can assume a general reference. .PP .SH OPTIONS \f4cxref\fP interprets the \f4-D\f1, \f4-I\f1, \f4-U\f1 options in the same manner that \f4cc\f1 does. In addition, \f4cxref\fP interprets the following options: .TP 8 \f4\-C\f1 Run only the first pass of \f4cxref\fP, creating a \f4.cx\f1 file that can later be passed to \f4cxref\fP. This is similar to the \f4-c\f1 option of \f4cc\fP or \f4lint\f1. .TP \f4\-c\f1 Combine the source files into a single report. Without the \f4-c\f1 option, \f4cxref\fP generates a separate report for each file on the command line. .TP \f4\-d\f1 Disable printing declarations, making the report easier to read. .TP \f4\-F\f1 Print the full path of the referenced file names. .TP \f4\-L\f2cols\f1 Modify the number of columns in the .SM LINE field. If you do not specify .BR \-L , .B cxref defaults to five columns. .TP \f4\-l\f1 Do not print local variables. Print only global and file scope statistics. .TP \f4\-o \f2file\f1 Direct output to \f2file\fP. .TP .B \-R Include referenced functions in the cross-reference list.. .TP \f4\-s\f1 Operate silently; do not print input file names. .TP \f4\-t\f1 Format listing for 80-column width. .TP \f4\-V\f1 Print version information on the standard error. .TP \f4\-W\f2name,file, function, line\f1 Change the default width of at least one field. The default widths are: .RS .nf .ta 12n .ne 7 Field Characters \s-1NAME\s0 15 \s-1FILE\s0 13 \s-1FUNCTION\s0 15 \s-1LINE\s0 20 (4 per column) .DT .fi .RE .TP \f4\-w\f2num\f1 Format output no wider than \f2num\f1 (decimal) columns. If .B \-w is not specified, or if .I num is less than 51, the width will default to 80 columns. .SH ENVIRONMENT .TP 10 .SB TMPDIR .B cxref writes temporary files to the directory set by this environmental variable. If .SB TMPDIR is not set, .B cxref uses .B "/var/tmp" [see .B tempnam in .BR tmpnam (3S)]. .SH FILES .TP 20 \f4TMPDIR/tcx.\(**\f1 temporary files .TP \f4TMPDIR/cx.\(**\f1 temporary files .SH EXAMPLE .nf .ft B a.c 1 main() 2 { 3 int i; 4 extern char c; 5 6 i=65; 7 c=(char)i; 8 } .ft R .sp2 .ne 10 Resulting cross-reference table: .sp1 .ta 8n +14n +12n +8n .ft B NAME FILE FUNCTION LINE .sp c a.c --- 4- 7= i a.c main 3\(** 6= 7 main a.c --- 2* .\"u3b2 predefined --- 0* .\"unix predefined --- 0* .ft R .sp .fi .SH SEE ALSO .BR lint (1), .BR cc (1) .SH DIAGNOSTICS Error messages usually mean you cannot compile the files. .\" @(#)cxref.1 6.2 of 9/2/83 .Ee