Thursday, April 30, 2009

Open source tool for code documentation : Doxygen and Graphviz

The platform used was windows and i dont think their will be much differece with linux.
Get the tools installers and install both the tools.
Method of installation: just click click type.
Usage : Just the normal brain. See the options and experiment with them.

Steps:
1. Open doxygen
2. specify the working directory,project name, source code directory
3. Enable recursive scan, give destination directory(this is where you fill find html folder after running of doxygen)
4. Rest all options see them and enable as you want.
5. In diagrams enable dot tool and enable all the options
6. Go on run tab and click run.
you will find a file in html folder called “index.html”
click on it and this is your documentaion .

What you want?
Ultimately from documetation you may want(wishlist)
1. how the module is organised
2. what are the different files
3. their dependency graphs, call graphs,
4. various function and their usage
5. globals used(macros, variables, structure, enums ,typedefs)
6. mainpage(what the documetation is about)
7. description of individual files

Hey if you intend to use these tools than first of all change your coding style in some form.
First of all change your commenting style
/*!
anything for multiple comments lines
*/
and
///for single line comments.

These are the list of efforts what you have to do for fulfilling your wishlists:
(it is to do list point by point wise according to wishlist)
1. just automatic, u have to do nothing .

2. just automatic, u have to do nothing.

3. Enable the option “use dot tool” in wizard->diagram.
Their check all the options.

4.Whenever you write any function
Than write in this form:
/*!
This is anyfunction doing anyting
\param integer named arg
\return integer value
*/
int anyfunction(int arg)

5.If you want to document any global(macros, functiondef, variables) than you can document
with /// comment. But note that it should come first and than what you want to document.
Incorrect:
int global; ///u know it is global
typedef unsigned int ui32; ///defines 32 bit

Correct:
///u know it is global
int global;
///defines 32 bit
typedef unsigned int ui32;

6.In mainfile(where main() exists) it is better to write
the following. This is called mainpage which is like is like brief of what the documentation is about.
/*!
\mainpage This is mainpage
This is the main file of file that i am trying to manipulata.
*/
and yes anythin with \ or @ in doxy comments are called commands.

7. At start of your file write
/*! \file filename
* \brief sth about this file
*/

This is what i think for now. Maybe i will get back for more if i get something more useful.
In future i will get with blog which gives the practical example for Doxygen together with fix point code examples.

There is another interested reading for interested ones:
http://justcheckingonall.wordpress.com/2…

No comments:

Post a Comment