summaryrefslogtreecommitdiff
path: root/include/pso
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-01-30 14:33:31 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-01-30 14:33:31 -0400
commit24d879de227c348cc21880f047287f79accb44d1 (patch)
treee18f9d830a279fcec2e4039449af4583c31065ac /include/pso
parent2b94b732c9e71a5884de4729ca50d9a8eda42049 (diff)
TObject, macros: Add `FOREACH_NODE` macros for dealing with TObject
iteration Thanks to EpochFlame for suggesting this.
Diffstat (limited to 'include/pso')
-rw-r--r--include/pso/macros.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/pso/macros.h b/include/pso/macros.h
index c449b6f..f7498c3 100644
--- a/include/pso/macros.h
+++ b/include/pso/macros.h
@@ -2,5 +2,7 @@
#define MACROS_H
#define OBJECT_NAME(name) static const char *name##_name = #name;
+#define FOREACH_NODE(type, first, varname) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next))
+#define FOREACH_NODE_NODECL(type, first, varname) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next))
#endif