macro.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _DOXYGEN_EXAMPLE_MACRO_H_
  2. #define _DOXYGEN_EXAMPLE_MACRO_H_
  3. /**
  4. * @page page_howto_macro How to write doxygen documentation for macro.
  5. *
  6. * There are two typical types of macro definitions.
  7. *
  8. * - One is to define constant macros. For this type of macro, we
  9. * recommend putting documentation after members. See `DOXYGEN_EXAMPLE_CONST_A`
  10. * and `DOXYGEN_EXAMPLE_CONST_B` in
  11. * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
  12. * for code exmaple.
  13. *
  14. * - The other is to define macros with parameters. For this type of
  15. * macro, we recommend using a method similar to documenting for
  16. * functions, that is, writing comment block before the macro definition.
  17. * More details please see @ref page_howto_function
  18. * See `DOXYGEN_EXAMPLE_ABS` in
  19. * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
  20. * for code example.
  21. *
  22. * See
  23. * <a href="./group__group__doxygen__example__macro.html">Doxygen Example of Macro</a>
  24. * for html output.
  25. */
  26. /**
  27. * @defgroup group_doxygen_example_macro Doxygen Example of Macro
  28. *
  29. * @ingroup group_doxygen_example
  30. *
  31. * @brief Doxygen Example of Macro.
  32. *
  33. * @{
  34. */
  35. #define DOXYGEN_EXAMPLE_CONST_A 100 /**< Description of macro const A */
  36. #define DOXYGEN_EXAMPLE_CONST_B 200 /**< Description of macro const B */
  37. /**
  38. * @brief Computes the absolute value of its argument @a x.
  39. *
  40. * @param[in] x input value.
  41. *
  42. * @return absolute value of @a x.
  43. */
  44. #define DOXYGEN_EXAMPLE_ABS(x) (((x)>0)?(x):-(x))
  45. /** @} */
  46. #endif