xref is an interface to ncxref(1) for C source-code cross-referencing, and to nm(1) and nawk(1) for object code cross-referencing. Object code may come from any language; it is not restricted to C code.
ncxref(1) produces a verbose listing of symbols and line number references. In a modern text editing environment, line numbers are less useful; the important information is the names of the files wherein each symbol is referenced. xref provides that in a convenient alternate form of output devoid of line number references.
The output of xref -c contains two tables, the first giving symbols and constants, and the files that define them, and the second, a reversed table with files and the symbols and constants they define. In order to make them fit in the tables, filenames are truncated to 10 characters, and symbols and constants to 20 characters.
The C preprocessor is not run on the source code, so that code from all branches of conditionals will be cross-referenced.
If you are interested only in symbols that are known after preprocessing and compilation, use xref -g to produce a single table of symbols and the files that define them.
xref -o produces two tables, one ordered by symbols, and one by files.
It is often convenient to be able to trace output strings back to the point in the source code where they were printed; the xref -c listings often suffice, but truncation from the 20-character limit may be a nuisance. Therefore, xref -s makes a table of complete strings and filenames, one tab-separated pair per line.
Self explanatory.
Nelson H.F. Beebe Center for Scientific Computing and Department of Mathematics South Physics Building University of Utah Salt Lake City, UT 84112 USA Tel: (801) 581-5254 Email: <beebe@science.utah.edu>