1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 01:53:51 +01:00

core/lib/clist: fix example of clist_foreach usage

Also fix some doxygen rendering issues.
This commit is contained in:
Leandro Lanzieri 2025-11-05 16:26:10 +01:00
parent 5d26414ecf
commit 79a54c5741

View File

@ -62,20 +62,21 @@
* *
* Or use the clist_foreach() helper function, e.g.,: * Or use the clist_foreach() helper function, e.g.,:
* *
* static int _print_node(clist_node_t *node) * static int _print_node(clist_node_t *node, void *arg)
* { * {
* printf("0x%08x ", (unsigned)node); * (void) arg; // unused optional argument
* return 0; * printf("0x%08x ", (unsigned)node);
* } * return 0;
* }
* *
* [...] * [...]
* clist_foreach(&list, _print_node); * clist_foreach(&list, _print_node, NULL);
* *
* To use clist as a queue, use clist_rpush() for adding elements and clist_lpop() * To use clist as a queue, use clist_rpush() for adding elements and clist_lpop()
* for removal. Using clist_lpush() and clist_rpop() is inefficient due to * for removal. Using clist_lpush() and clist_rpop() is inefficient due to
* clist_rpop()'s O(n) runtime. * clist_rpop()'s O(n) runtime.
* *
* To use clist as stack, use clist_lpush()/clist_lpop(). * To use clist as stack, use clist_lpush() / clist_lpop().
* *
* Implementation details: * Implementation details:
* *