*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> cxref (1)              


CXREF(1)		       Silicon Graphics			      CXREF(1)

NAME    [Toc]    [Back]

     cxref - generate C	program	cross-reference

SYNOPSIS    [Toc]    [Back]

     cxref [ options ] files

DESCRIPTION    [Toc]    [Back]

     The cxref command analyzes	a collection of	C, yacc, and lex files and
     attempts to build a cross-reference 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.

     If	the environment	variable _XPG is defined, cxref	operates in
     conformance with the X/Open XPG4 specifications.  The format of the
     output may	differ in accordance to	the XPG4 standards.

     In	addition to the	-D, -I -nostdinc and -U	options	[which are interpreted
     just as they are by cc(1) and cpp(1)], the	following options are
     interpreted by cxref:

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

     -h	     Do	not print column headers.

     -w<num> Width option which	formats	output no wider	than <num> (decimal)
	     columns.  This option will	default	to 80 if <num> is not
	     specified or is less than 51.  If _XPG is set then	there should
	     be	at least one space between -w and num.

     -o	file Direct output to file.

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

     -t	     Format listing for	80-column width.

     -v	     Print on standard error the arguments passed to sub-passes	and
	     such other	information as seems interesting.

     -exclude	 regex
	     excludes cross-reference data from	files whose name matches
	     regex, where regex	is a regular expression(see regex(3)).

     -include	 regex
	     includes cross-reference data from	files whose name matches
	     regex, where regex	is a regular expression(see regex(3)).	By
	     default everything	in the named files is cross-referenced.	 For
	     example, to cross-reference leaving out all headers from
	     /usr/include but including	<stdio.h>, the following suffices:

Page 1				 Release 6.4

CXREF(1)		       Silicon Graphics			      CXREF(1)

	cxref -exclude '/usr/include/.*' -include '.*/stdio.h' test.c

     -raw Instead of being processed into a cross reference output, the	raw
	  cross-reference information from the C compiler is passed directly
	  to the output.  The format of	this data is described below.

     -rawin    file
	  Pass in to cxref for formatting the file as if it were the output of
	  cxref	-raw.  The file	must be	in the proper format: if it is not,
	  the result will likely be chaos.

DIAGNOSTICS    [Toc]    [Back]

     Most error/warning	messages come from the C compiler.  The	C compiler is
     not the same as cc.

RAW DATA FORMAT    [Toc]    [Back]

     A cross raw reference record (the format may change from release to
     release) is a line	of white-space separated fields.  Each record documents
 a single cross-reference instance and is terminated with a newline.
  All	data is	in plain text.	All numbers are	in decimal.

	  is the integer internal symbol address.  Not used.

	  is the name of a variable or function.

     code is one of D,M,A, or R.  D if this is a declaration.  M if this is a
	  modification of the variable.	 A if the address is taken.  R if this
	  is a reference to the	variable or function.

	  is the source	file name where	found.

	  is the line number where the reference was found.

	  is the column	number where the reference was found.

     type is one of B, F, or N.	 B means this is a function body (so code
	  above	is D).	F means	this is	a function, not	a data variable, and
	  not a	function body (code may	be D, as a declaration,	or A, or R).
	  N means this is not a	function.

	  is an	integer	giving the current local scope level.  Local (inner)
	  scopes with no declarations are not interesting so they are not

Page 2				 Release 6.4

CXREF(1)		       Silicon Graphics			      CXREF(1)

	  is an	integer	giving the current #include nesting depth.

FILES    [Toc]    [Back]


SEE ALSO    [Toc]    [Back]


NOTES    [Toc]    [Back]

     The -acpp option is ignored.  There is no way to combine K&R C with ANSI

     The -nocpp	option is ignored.  However, cxref accepts files suffixed with
     .i	as C files.

     The -nostdinc option does not work.

     cxref attempts to understand many of the options normally passed to
     cc(1).  Many options are irrelevant to cxref so they are silently
     ignored.  Options not understood by cxref must not	be passed on the command

     Since  the	compiler predefines know and created by	cc are not identical
     to	those built into cxref,	it is wise to use -show	option to cc  to
     create a script file with the -D and -U options shown as being passed to
     the compiler.  Invoke cxref via the script	(there are too many -D items
     to	do this	command	creation reliably on the command line).	 Edit the
     script to remove options that cxref does not understand.

     Some #pragmas known to the	regular	cc command are not known to cxref, so
     useless warnings about unknown pragmas may	appear at times.

Page 3				 Release 6.4
[ Back ]
 Similar pages
Name OS Title
yyref Linux generate cross-reference for yacc input
cxref Tru64 Creates a C program cross-reference listing
cxref-query Linux A program to query the cross reference database from cxref.
cxref-cc Linux compile and document/cross-reference a C source file
mkdep Tru64 generate dependency list from a C program
update-xpdfrc Linux program to generate xpdf's configuration file
cxref Linux C Cross Referencing & Documenting tool.
mmroff FreeBSD reference preprocessor
perlxs OpenBSD XS language reference manual
perlxs IRIX XS language reference manual
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service