cxref(1) — Commands
NAME
cxref − Creates a C program cross-reference listing
SYNOPSIS
cxref [−cFlstV] [−o file] [−w [number]|[−L cols] ] [−D name[=def]]... [−I dir]... [−U name]... [−Ndnumber] [−Nlnumber] [−Nnnumber] [−Ntnumber] file...
The token −− (double−dash) is accepted as a delimiter indicating the end of options. Any following arguments are treated as operands, even if they begin with the − character.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
cxref: SVID 3, XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
The following options conform to both the X/Open and SVID 3 standards:
−cDisplays a combined listing of the cross-references in all input files.
−sDoes not display the input filenames.
−o file
Directs the output to the specified file.
−w [number]
Formats the output no wider than number (decimal) columns. This option defaults to 80 if number is unspecified or is less than 51.
−D name[=def]
Defines name, as if by a C-language #define directive. If no =def is given, a value of 1 is used.
−I dir
Adds the directory specified by dir to the list of directories in which the lint program searches for #include files.
−U name
Removes any initial definition of name, where name is a reserved symbol that is predefined by the particular preprocessor.
The following are additional DIGITAL and SVID 3 options:
−F[Compaq] Prints the full path of the referenced file names. By default, only the last component of the full path is printed.
−L cols
[Compaq] Specifies the maximum number of columns that can be printed in the LINE field to the cols argument. The default is five columns for this field.
−l[Compaq] Suppresses printing of local variables. Only global variables and file scope statistics are printed.
−Ndnumber
[Compaq] Changes the dimension table size to number. The default is 2000.
−Nlnumber
[Compaq] Changes the number of type nodes to number. The default is 8000.
−Nnnumber
[Compaq] Changes the symbol table size to number. The default is 1500.
−Ntnumber
[Compaq] Changes the number of tree nodes to number. The default is 1000.
−t[Compaq] Makes the listing 80 bytes wide.
−V[SVID 3] Prints the version number information for the cxref command to standard error.
DESCRIPTION
The cxref command analyzes C program files and creates a cross-reference table, using a version of the cpp macro preprocessor to include #define directives in its symbol table.
The cxref command writes to standard output a listing of all symbols in each file processed, either separately or in combination (see the −c option).
[Compaq] Function prototypes are handled in a special way: for an old-style function declaration, the function prototype name is listed, but the optional prototype identifiers are not. The formal parameters in a function definition are always listed, whether or not the prototype is an old-style function definition. When a reference to a symbol is that symbol’s declaration, an asterisk (∗) precedes it.
EXAMPLES
To provide a combined cross-reference listing of stdin1.c and stdin2.c, making the output 60 columns wide, enter:
cxref -c -w 60 stdin1.c stdin2.c > output
ENVIRONMENT VARIABLES
The following environment variables affect the behavior of cxref():
LANG
Provides a default value for the locale category variables that are not set or null.
LC_ALL
If set, overrides the values of all other locale variables.
LC_COLLATE
Determines the order in which output is sorted for the −x option.
LC_CTYPE
Determines the locale for the interpretation of byte sequences as characters (single-byte or multibyte) in input parameters and files.
LC_MESSAGES
Determines the locale used to affect the format and contents of diagnostic messages displayed by the command.
NLSPATH
Determines the location of message catalogs for processing of LC_MESSAGES.
FILES
/usr/ccs/lib/xpass
Special version of C preprocessor.