Doxygen – Sweet :D

This is pretty amazing i think take a look at some Doxygen output:

I think its really worth learning + it will save you about a week or 2′s worth of documentation:

What you want to do is go to your projects directory and:

$ sudo apt-get install doxygen

$ doxygen -g

$ emacs -nw Doxyfile

$ echo “Now go through each of these options in the config file use CTRL-S to start searching in emacs ;)

EXTRACT_ALL = YES
Extract documentation even from those elements you haven’t yet commented.
INLINE_SOURCE = YES
Extract the relevant parts of the source and associate them with your description.
HAVE_DOT = YES
Use Graphviz for class and collaboration diagrams.
CALL_GRAPH = YES
Generate a dependency graph for functions and methods.
GENERATE_LATEX = NO
Skip generating LaTeX sources for PDF.

RECURSIVE              = YES

To go through each of your directorys! Probably the most important.

FILE_PATTERNS          = *.c *.h

The source files you want to document!

echo “Now run”

$ doxygen Doxyfile

#Hope it works :D

Finally to do documentation you need to go to your code and do documenation like:

  1. /**
  2.  * Return the size of the list.
  3.  *
  4.  * \return returns the size of the list as an int
  5.  * \param list The List you want to add the item to
  6.  */
  7. extern int size( LinkedList** list) {
  8.   int counter=0;
  9.   LinkedList *tmp=*list;
  10.  
  11.   if(tmp->contents != NULL) {
  12.     struct ListNode *next= tmp;
  13.     counter++;
  14.     while(next->nextnode != NULL){
  15.       next= next->nextnode;
  16.       counter++;
  17.     }
  18.     return counter;
  19.   }
  20.   else
  21.     return counter;
  22. }
  23.  

1 comment to Doxygen – Sweet :D

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>