summaryrefslogtreecommitdiff
path: root/urcu-list-compat.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2017-01-19 01:09:03 +0200
committerTobias Klauser <tklauser@distanz.ch>2017-01-25 13:23:34 +0100
commit60648a858b83b63e8dbdd1c45bb901d1206ae444 (patch)
tree04e14eac4d7e81dd31305f0cac334a341609f6b0 /urcu-list-compat.h
parenta1351738ba11c8e2d38f6df5276cc59f7acb2d2f (diff)
flowtop: Add tab control to switch between tables
Add ui_tab API to create ui tab control to switch between different ui tables which may contain different aggregated info per unique pid/port/proto/dst/src. Meanwhile there is only 1 ui tab entry for flows table. Added some missing cds_list_{next,prev,last}_entry functions into urcu-list-compat.h header. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'urcu-list-compat.h')
-rw-r--r--urcu-list-compat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/urcu-list-compat.h b/urcu-list-compat.h
new file mode 100644
index 0000000..44117ad
--- /dev/null
+++ b/urcu-list-compat.h
@@ -0,0 +1,21 @@
+#ifndef URCU_LIST_COMPAT_H
+#define URCU_LIST_COMPAT_H
+
+#include <urcu/list.h>
+
+#ifndef cds_list_last_entry
+#define cds_list_last_entry(ptr, type, member) \
+ cds_list_entry((ptr)->prev, type, member)
+#endif
+
+#ifndef cds_list_next_entry
+#define cds_list_next_entry(pos, member) \
+ cds_list_entry((pos)->member.next, typeof(*(pos)), member)
+#endif
+
+#ifndef cds_list_prev_entry
+#define cds_list_prev_entry(pos, member) \
+ cds_list_entry((pos)->member.prev, typeof(*(pos)), member)
+#endif
+
+#endif /* URCU_LIST_COMPAT_H */