diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2023-09-07 17:11:52 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2023-09-07 17:11:52 +0200 |
| commit | 3ea3f34213f99990ff1108ed86393b35504df6e5 (patch) | |
| tree | e384cea2b87b59f9f75ecf87867fbd803bdd17d2 /lib/typesafe.h | |
| parent | 36bd815ba77564398e1398ad7f071bafa34e93be (diff) | |
lib: add inline comment about _const iteration
This is noted in doc/developer/lists.rst, but judging by the previous
commit that's not where people look for this thing. Let's try a comment
in the header file.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/typesafe.h')
| -rw-r--r-- | lib/typesafe.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/typesafe.h b/lib/typesafe.h index d2587160ea..a84298b062 100644 --- a/lib/typesafe.h +++ b/lib/typesafe.h @@ -17,6 +17,11 @@ extern "C" { /* generic macros for all list-like types */ +/* to iterate using the const variants of the functions, append "_const" to + * the name of the container, e.g. "frr_each (my_list, head, item)" becomes + * "frr_each (my_list_const, head, item)" + */ + #define frr_each(prefix, head, item) \ for (item = prefix##_first(head); item; \ item = prefix##_next(head, item)) |
