1 #ifndef _DOXYGEN_EXAMPLE_TYPEDEF_H_ 2 #define _DOXYGEN_EXAMPLE_TYPEDEF_H_ 3 4 /** 5 * @page page_howto_typedef How to write doxygen documentation for typedef. 6 * 7 * It is recommended to use separate typedef statements rather 8 * than a combination. That is: 9 * 10 * Recommended: 11 * 12 * ```c 13 * struct S { ... }; 14 * typedef struct S S_t; 15 * ``` 16 * 17 * Not recommended: 18 * 19 * ```c 20 * typedef struct S { ... } S_t; 21 * ``` 22 * 23 * The reason is we found that the former is more readable, and when we 24 * write comment block with `@typedef`, the latter may 25 * cause unexpceted behaviour for doxygen (as of version 1.9.1). 26 * 27 * See 28 * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/typedef.h">documentation/0.doxygen/example/include/typedef.h</a> 29 * for code example. 30 * 31 * See @ref group_doxygen_example_typedef for html output. 32 */ 33 34 #include "struct.h" 35 #include "enum.h" 36 37 /** 38 * @defgroup group_doxygen_example_typedef Doxygen Example of Typedef 39 * 40 * @ingroup group_doxygen_example 41 * 42 * @brief Doxygen Example of Typedef. 43 * 44 * @{ 45 */ 46 47 /** 48 * @typedef dogygen_example_struct_t 49 * Alias of `struct dogygen_example_struct`. 50 * 51 * @typedef dogygen_example_struct_another_t 52 * Alias of `struct dogygen_example_struct_another`. 53 */ 54 typedef struct dogygen_example_struct dogygen_example_struct_t; 55 typedef struct dogygen_example_struct_another dogygen_example_struct_another_t; 56 57 /** 58 * @typedef doxygen_example_enum_t 59 * Alias of `enum doxygen_example_enum`. 60 */ 61 typedef enum doxygen_example_enum doxygen_example_enum_t; 62 63 /** @} */ 64 65 #endif /* _DOXYGEN_EXAMPLE_TYPEDEF_H_ */ 66