index
documentation
download
development
authors

CODOC - a C Documentation program

It is designed to allow the authors of the documentation to not modify the actual code, but still allow the documentation to be easily updated when the code changes.

Here's how it works.

Suppose you wanted to document your header file, tmpheader.h:

#ifndef __TMP_HEADER_H_
#define __TMP_HEADER_H_

int tmp_make_file_descriptor      (const char    *prefix);

#endif
Run codoc and it will make codoc.template for you:
@SECTION tmpheader.h
@FUNCTION tmp_make_file_descriptor int
@FUNCTION_PARAM tmp_make_file_descriptor 0 prefix const char *
Now you may enter comments for:
  • the header file
  • the function
  • the function's parameter.
codoc knows many other common constructs. When you run codoc again it will use the comments you have entered to make the codoc.sgml file.

Now, suppose the header file changes. Just run codoc again. If file timestamps are working, codoc.template will be read in and updated, and codoc.sgml will be generated from that. If timestamps aren't working, use codoc --force.

Sometimes, if really unusual changes occur, names can conflict, and codoc won't do anything until the old comments are manually removed from the template file. (Currently a bug exists where if a function starts taking one fewer parameter we don't notice that the old sgml blurb is stale...)

For more specific information, please see the user documentation.