|
15 | 15 | * can add a detailed description part, which is also optional. |
16 | 16 | * |
17 | 17 | * Put member comments inside the structure definition and after every member. |
| 18 | + * See `struct dogygen_example_struct` for example. |
| 19 | + * |
| 20 | + * If the structure member is too long (this often happens when the structure |
| 21 | + * member is a callback function), when the comment is written after the member, |
| 22 | + * it will make the code line too long. In this case, we can also put the comment |
| 23 | + * before the member. See `struct dogygen_example_struct_another` for example. |
| 24 | + * |
| 25 | + * Going a step further, for this kind of structure whose members are callback |
| 26 | + * functions, we can describe the members in style for functions, it is more |
| 27 | + * complicated and contains more content. It is useful when we want to describe |
| 28 | + * the parameters and return values of the callback function in more detail. |
| 29 | + * See `struct dogygen_example_struct_another2` for example. |
18 | 30 | * |
19 | 31 | * See |
20 | 32 | * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/struct.h">documentation/0.doxygen/example/include/struct.h</a> |
21 | 33 | * for code example. |
22 | 34 | * |
23 | | - * See |
24 | | - * <a href="./group__group__doxygen__example__struct.html">Doxygen Example of Structure</a> |
25 | | - * for html output. |
| 35 | + * See @ref group_doxygen_example_struct for html output. |
26 | 36 | */ |
27 | 37 |
|
28 | 38 | /** |
@@ -68,17 +78,40 @@ struct dogygen_example_struct |
68 | 78 | */ |
69 | 79 | struct dogygen_example_struct_another |
70 | 80 | { |
71 | | - int m1; /**< Some documentation for member 'm1'... |
72 | | - * Multiple lines ... Note the "multi-line" here refers |
73 | | - * to the code. Whether it is displayed in multiple lines |
74 | | - * on the specific HTML page depends on the browser rendering. |
75 | | - * |
76 | | - * @note We can also embed note for member 'm1'... |
77 | | - */ |
78 | | - int m2; /**< Some documentation for member 'm2'... */ |
79 | | - int m3; /**< Some documentation for member 'm3'... */ |
80 | | - int m4; /**< Some documentation for member 'm4'... */ |
81 | | - int m5; /**< Some documentation for member 'm5'... */ |
| 81 | + /** Some documentation for member 'm1'... */ |
| 82 | + int (*m1)(int *param1, int param2, int param3, int param4); |
| 83 | + /** Some documentation for member 'm2'... */ |
| 84 | + int (*m2)(int *param1, int param2, int param3, int param4); |
| 85 | +}; |
| 86 | + |
| 87 | +/** |
| 88 | + * @brief Brief description this structure |
| 89 | + * |
| 90 | + * Detailed description starts here, one line or multiple lines. |
| 91 | + * Blah blah blah... |
| 92 | + * |
| 93 | + * @note This is a note for this structure, blah blah blah... |
| 94 | + */ |
| 95 | +struct dogygen_example_struct_another2 |
| 96 | +{ |
| 97 | + /** |
| 98 | + * @brief Brief description of m1 |
| 99 | + * @param param1 The first param. |
| 100 | + * @param param2 The second param. |
| 101 | + * @param param3 The third param. |
| 102 | + * @param param4 The fourth param. |
| 103 | + * @return the operation status, 0 on successful |
| 104 | + */ |
| 105 | + int (*m1)(int *param1, int param2, int param3, int param4); |
| 106 | + /** |
| 107 | + * @brief Brief description of m2 |
| 108 | + * @param param1 The first param. |
| 109 | + * @param param2 The second param. |
| 110 | + * @param param3 The third param. |
| 111 | + * @param param4 The fourth param. |
| 112 | + * @return the operation status, 0 on successful |
| 113 | + */ |
| 114 | + int (*m2)(int *param1, int param2, int param3, int param4); |
82 | 115 | }; |
83 | 116 |
|
84 | 117 | /** @} */ |
|
0 commit comments