C Language Cross Referencing: concise format suggestion

Mark A. Swanson marks at grkermit.UUCP
Mon Feb 6 03:34:55 AEST 1984


We developed a format which allows a concise C cross reference format.
While unavailable, others may be interested in it.  It is aimed at
supporting cases with LARGE programs composed of many modules. (I had
a 60,000 line, 200 module program to maintain. Plus library utilities.)

The output listing consists of:

1) A Table of Contents, listing the .h and .c files in alphabetical
order, all .h first.  Each entry provides:
<file number>    <full file name>   <page of listing it starts on>

2) Each file then appears, in the above order.  Each file starts on
a new page.  Each line of source is proceeded with an id of the form:
<file number>.<line number>   <c source>

If your people like to do long lines or have very long files, you will
have to be careful about wraparound, etc.

3) Then comes the cross reference.  It has entries of the general form

<token>   <file num>.<line num><usage> {  ... }

e.g.

FILE	1.124# 1.295 6.56 8.76 8.134 9.12... {for #define FILE  }
Gatetime 5.44 5.101 16.37= 16.142		{ for global variable initialized
	in file 16 at line 37, used in files 5 and 16 }
paldts  4.22<> 5.35<> 6.18<> 7.18<>      { for #include <paldts.h> }
pdout	14.127() 16.45 16.180            { for ftn pdout(): defined in
	file 14, called in file 16. }

This provides quite readable cross references which stay significantly
smaller than the listings. The usage markers help a lot in finding
definitions and unused variables, functions, etc.

	Mark Swanson
	decvax!genrad!grkermit!marks



More information about the Comp.unix.wizards mailing list