summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/pso/macros.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/pso/macros.h b/include/pso/macros.h
index f7498c3..1a75d53 100644
--- a/include/pso/macros.h
+++ b/include/pso/macros.h
@@ -2,7 +2,11 @@
#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))
+#define FOREACH_NODE_MULTI_ITER(type, first, varname, ...) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next), __VA_ARGS__)
+#define FOREACH_NODE_NODECL_MULTI_ITER(type, first, varname, ...) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next), __VA_ARGS__)
+
#endif