CSIRO Mathematics, Informatics and Statistics
|
|
|
Next: LIAR Keywords Up: No Title Previous: Purify and Sentinel
LIAR function documentationLIAR functions need to be documented, but the question is how to achieve this task without having to perform multi-edits or any arduous task that would be offputting to the average programmer. Therefore, the philosophy we have adopted is to use the C programming language as far as possible to express the documentation in the form of source code comments, which have been strategically place in the source file. This then means that the documentation and the source code are bounded together in one file; thus, facilitating documentation and source code updates to occur simultaneously. The LIAR strategy is then to pipe the souce code files through c2man, which extracts the appropriate comment blocks into various forms of output; such as, man pages, web pages, LaTeX documents, etc. Here, we will essentially be concerned with producing Unix man pages outputs. As an example, consider the following C function:
The above function would then be documented by placing a comment after each parameter in the function heading and by adding the standard LIAR comment block immediate after the first opening curly bracket, {, of the function:
Note, the first line of the LIAR comment block holds a one liner, which briefy describes the function and that each section in the comment block is preceded by a blank line and the title of the each section starts with an uppercase word followed by a colon. The fields or sections in the LIAR comment block are further explained in Table 3.
Once the function has been documented, it is then piped through c2man: where contour.c is the file that holds the function reflectContour, plus possibly other documentated functions, and the include_directories is used to specify any include directories that the source file may be dependent on; for example, /home/liar/include. The above command will produces a man page such as:% c2man -b -I/include_directories contour.c
Next: LIAR Keywords Up: No Title Previous: Purify and Sentinel Ed Breen Tue Sep 3 17:19:31 EST 1996 |