Doxygen: Add new type or structure

205 Views Asked by At

I want to use doxygen to document a c-like language. I got some issues to solve keywords which are unknown in the context.

One example, I have to use a callback function called

on timer
{
  //normal c- code
}

My question is now, can I adopt doxygen to accept the new keyword? I would like to add this keyword like a function or variable acc. to

/** This timer is used for something. */   
on timer
{
}

or maybe

/** \ontimer This timer is used for something. */   
on timer
{
}

The documentation of doxygen describes something with ALIASES or \xrefitem but as I understand I can only generate new sections for known types or am I wrong? Actually I am surrounding the unknown code with a condition block out to avoid errors in the generated output.

1

There are 1 best solutions below

0
On

As I understand is "on" a keyword which doxygen cannot interpret. One solution could be to declare the keyword on as a predfined macro in the doxyile by using the the PREDEFINED tag as follows:

PREDEFINED             = on=   

Yes, the = at the end is not a typo! This tells the preprocessor of doxygen to substitute the keyword on with a empty string. Note that you have to set ENABLE_PREPROCESSING to YES.

If the on keyword only appears before callback functions you could alternatively set the PREDEFINED macro to void:

PREDEFINED             = on=void