summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-02-07 19:21:42 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-02-07 19:21:42 +0100
commitd06a875b042b608e61b2d5a2bb594641d3e1322f (patch)
treea4eae99c62b0b2349a42f229ac558e11f2f445d5 /lib
parent5d414309ec5a01024d4de4c4f9521f8daa5c06ff (diff)
Filter: Recursive filter iteration code
Add macros for recursive filter iteration that allows to examine all instructions reachable from a filter.
Diffstat (limited to 'lib')
-rw-r--r--lib/buffer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/buffer.h b/lib/buffer.h
index cd9bab86..fd40baa0 100644
--- a/lib/buffer.h
+++ b/lib/buffer.h
@@ -50,6 +50,8 @@
#define BUFFER_FLUSH(v) ({ (v).used = 0; })
+#define BUFFER_EMPTY(v) ({ (v).used == 0; })
+
#define BUFFER_WALK(v,n) \
for (BUFFER_TYPE(v) *_n = (v).data, n; _n < ((v).data + (v).used) && (n = *_n, 1); _n++)