[comp.lang.c] C documentation

dwilbert@bbn.com (Deborah Wilbert) (07/26/90)

Hi,

I am looking for ways to generate documentation from C source code.
I'm not sure what it can/should do aside from extracting headers and
comments, which would be pretty simple. I would be open to inserting
keywords into the C source comments to format the generated document.

Public domain software would be best. I am also vaguely interested in
other documentation aids, such as static flow analysis tools.

Thanks for any leads,
Deborah Wilbert

ssdken@watson.Claremont.EDU (Ken Nelson) (07/26/90)

My employer (Software Systems Design) offers CDADL, DocGen and Testgen.



   CDADL  - source code analyzer, many cross references,
	    printing, lots more....



|> I am looking for ways to generate documentation from C source code.
|> I'm not sure what it can/should do aside from extracting headers and
|> comments, which would be pretty simple. I would be open to inserting
|> keywords into the C source comments to format the generated document.

   DocGen - extract documentation from source, including many
	     automatic items, as well as user entered by special
             keys.  Documents formatted by a writing a 
	     table of contents (like in a book), DocGen does
	     the rest.  You could generate a Unix style man
	     page from source, or just about any type of 
	     document.  A lot of our customers use it for 

|> other documentation aids, such as static flow analysis tools.


   TestGen - TestGen analyzes paths through the program and then
	     verifies execution of paths (test path coverage).



|> Public domain software would be best. 

    These cost, but you get what you pay for. Price depends on
    hardare, OS and # of users.  Please call, email or write if
    you would like more info or a brochure.


|> Thanks for any leads,
|> Deborah Wilbert

	Your Welcome:

				Ken Nelson
				Principal Engineer
				Software Systems Design
				3627 Padua Av.
				Claremont, CA 91711
				(714) 624-3402

weiss@mrsvr.UUCP (Reinhard Weiss) (07/31/90)

From article <58440@bbn.BBN.COM>, by dwilbert@bbn.com (Deborah Wilbert):
> Hi,
> 
> I am looking for ways to generate documentation from C source code.
> I'm not sure what it can/should do aside from extracting headers and
> comments, which would be pretty simple. I would be open to inserting
> keywords into the C source comments to format the generated document.
> 
> Public domain software would be best. I am also vaguely interested in
> other documentation aids, such as static flow analysis tools.
> 
> Thanks for any leads,
> Deborah Wilbert

Although it is not the most elegant way of doing things, we use keywords
in our software to extract headers for purposes of documentation.  We 
don't add comments, however, because our headers are quite extensive.
An example follows:

/* "DESC:1
*********************************************************************

  Function:      fooProgram

  Purpose:       generates lots of foo.

  Global Data:   input:  none
                 output: none

  Interrupt Compatibility: this program generates a lot of foo, don't
                 use/call from an ISR

  Returns:       (int) the status of this function

  Errors:        hardware errors result in a core dump, software errors
                 are reported (return value) as follows:

                 0 - everything is OK
                 etc.

  Details:       Function begins by setting up the hardware to generate
                 as much foo as the user can possibly handle.  Initialization
                 takes place by (blah, blah, blah).

  _Generation_   _Date_     _Author_         _Comments_

    01.01.01   07-31-90  Reinhard M. Weiss   First pass

***********************************************************************
  "ETC
*/


The command to extract the header is then:

sed -n -e '/DESC/,/ETC/p' file_name

(Oh, by the way, this is on unix.  I can't speak for any other OpSystems.)
If your finicky and want to group in comments as well, just put the
keywords around the comments.