Skip to content

Commit 9f17fb0

Browse files
committed
Fix dlist API documentation
1 parent 6d0e083 commit 9f17fb0

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ and this project adheres to [0-based versioning](https://0ver.org/).
3232
- Fix documentation of `prio` parameter of `am_pal_task_create()` API.
3333
- Use proper type casting in `AM_ALIGNOF_PTR()` and `AM_ALIGN_SIZE()` implementations.
3434
- Fix `slist` API documentation.
35+
- Fix `dlist` API documentation.
3536

3637
## v0.12.0 - 23-July-2025
3738

libs/dlist/dlist.h

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
6887
struct 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
*/
97118
void 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
*/
124147
void 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
*

libs/slist/slist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool am_slist_item_is_linked(const struct am_slist_item *item);
138138
/**
139139
* Construct list item.
140140
*
141-
* Initializes the list item as not belonging to any list.
141+
* Initializes the list item as not being part to any list.
142142
*
143143
* @param item the list item to construct.
144144
*/

0 commit comments

Comments
 (0)