views:

149

answers:

1

I've got some C code from a 3rd party vendor (for an embedded platform) that uses global variables (for speed & space optimizations). I'm documenting the code, converting to Doxygen format.

How do I put a note in the function documentation that the function requires on global variables and functions?

Doxygen has special commands for annotating parameters and return values as describe here: Doxygen Special Commands. I did not see any commands for global variables.

Example C code:

    extern unsigned char data_buffer[]; //!< Global variable.

    /*! Returns the next available data byte.
     *  \return Next data byte.
     */
    unsigned char Get_Byte(void)
    {
      static unsigned int index = 0;
      return data_buffer[index++]; //!< Uses global variable.   
    }

In the above code, I would like to add Doxygen comments that the function depends on the global variable data_buffer.

A: 

You can just add a note to that effect and use the \link directive to direct the reader to the description of the global variable.

Judge Maygarden