Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

cpp(1)

cxref(1)

NAME

cxref − generate C program cross-reference

SYNOPSIS

cxref [options] files

DESCRIPTION

cxref analyzes a collection of C files and attempts to build a cross-reference table.  cxref utilizes a special version of cpp to include #defined information in its symbol table.  It produces a listing on standard output of all symbols (auto, static, and global) in each file separately, or with the −c option, in combination.  Each symbol contains an asterisk (∗) before the declaring reference.  Output is sorted in ascending collation order (see Environment Variables below). 

In addition to the −D, −I and −U options (which are identical to their interpretation by cc(1)), the following options are interpreted by cxref:

−c Print a combined cross-reference of all input files. 

−wnum Width option; format output no wider than num (decimal) columns.  This option defaults to 80 if num is not specified or is less than 51. 

−o file Direct output to the named file.

−s Operate silently; do not print input file names. 

−t Format listing for 80-column width. 

−Aa Choose ANSI mode.  If not specified, compatibility mode (−Ac option) is selected by default. 

−Ac Choose compatibility mode.  This option is selected by default if neither −Aa nor −Ac is specified. 

EXTERNAL INFLUENCES

Environment Variables

LC_COLLATE determines the order in which the output is sorted. 

If LC_COLLATE is not specified in the environment or is set to the empty string, the value of LANG is used as a default.  If LANG is not specified or is set to the empty string, a default of “C” (see lang(5)) is used instead of LANG.  If any internationalization variable contains an invalid setting, cxref behaves as if all internationalization variables are set to “C” (see environ(5)).

International Code Set Support

Single- and multi-byte character code sets are supported with the exception that multi-byte character file names are not supported. 

DIAGNOSTICS

Error messages are unusually cryptic, but usually mean that you cannot compile these files, anyway. 

EXAMPLES

Create a combined cross-reference of the files orange.c, blue.c, and color.h:

cxref -c orange.c blue.c color.h

Create a combined cross-reference of the files orange.c, blue.c, and color.h: and direct the output to the file rainbow.x:

cxref -c -o rainbow.x orange.c blue.c color.h

WARNINGS

cxref considers a formal argument in a #define macro definition to be a declaration of that symbol.  For example, a program that #includes ctype.h will contain many declarations of the variable c. 

cxref uses a special version of the C compiler front end.  This means that a file that will not compile probably cannot be successfully processed by cxref. In addition, cxref generates references only for those source lines that are actually compiled.  This means that lines that are excluded by #ifdefs and the like (see cpp(1)) will not be cross-referenced.

cxref does not parse the CCOPTS environment variable. 

FILES

/lib/cpp C-preprocessor. 

/lib/xpass Compatibility-mode special version of C compiler front end. 

/lib/xpass.ansi ANSI-mode special version of C compiler front end. 

SEE ALSO

cc(1), cpp(1). 

STANDARDS CONFORMANCE

cxref: SVID2, XPG2, XPG3

Hewlett-Packard Company  —  HP-UX Release 8.05: June 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026