@@ -54,16 +54,35 @@ enum am_dlist_direction {
5454 * a doubly linked list item:
5555 *
5656 * [1]
57- * struct foo {int bar; struct am_dlist_item list;}
57+ * @code{.c}
58+ * struct foo {
59+ * int bar;
60+ * struct am_dlist_item list;
61+ * };
62+ * @endcode
5863 *
5964 * [2]
60- * struct foo {int bar; }
61- * struct foo_item {struct foo foo; struct am_dlist_item list}
65+ * @code{.c}
66+ * struct foo {
67+ * int bar;
68+ * };
69+ *
70+ * struct foo_item {
71+ * struct foo foo;
72+ * struct am_dlist_item list;
73+ * };
74+ * @endcode
6275 *
6376 * Also `struct foo` can be part of several independent lists.
6477 * For example,
6578 *
66- * struct foo {int bar; struct am_dlist_item list1; struct am_dlist_item list2;}
79+ * @code{.c}
80+ * struct foo {
81+ * int bar;
82+ * struct am_dlist_item list1;
83+ * struct am_dlist_item list2;
84+ * };
85+ * @endcode
6786 */
6887struct am_dlist_item {
6988 /** next item in list */
@@ -92,6 +111,8 @@ extern "C" {
92111/**
93112 * List construction.
94113 *
114+ * Must be called before calling any other doubly linked list API functions.
115+ *
95116 * @param list the list
96117 */
97118void am_dlist_ctor (struct am_dlist * list );
@@ -119,6 +140,8 @@ bool am_dlist_item_is_linked(const struct am_dlist_item *item);
119140/**
120141 * Construct list item.
121142 *
143+ * Initializes the list item as not being part to any list.
144+ *
122145 * @param item list item to construct
123146 */
124147void am_dlist_item_ctor (struct am_dlist_item * item );
@@ -127,7 +150,7 @@ void am_dlist_item_ctor(struct am_dlist_item *item);
127150 * Give next item after the given one.
128151 *
129152 * Can be used to iterate a list. However if item pop operation is expected
130- * during the iteration, then list iterator APIs are to be used instead.
153+ * during the iteration, then list iterator APIs must be used instead.
131154 *
132155 * @param list the list
133156 * @param item the item next to this one is returned
@@ -142,7 +165,7 @@ struct am_dlist_item *am_dlist_next(
142165 * Give previous item for the given one.
143166 *
144167 * Can be used to iterate a list. However if item pop operation is expected
145- * during the iteration, then list iterator APIs are to be used instead.
168+ * during the iteration, then list iterator APIs must be used instead.
146169 *
147170 * @param list the list
148171 * @param item the item previous to this one is returned
@@ -242,6 +265,8 @@ struct am_dlist_item *am_dlist_peek_back(struct am_dlist *list);
242265/**
243266 * Predicate callback type that tells if item is found.
244267 *
268+ * Used by am_dlist_find() API.
269+ *
245270 * @param context the predicate context
246271 * @param item item to analyze
247272 *
0 commit comments