summaryrefslogtreecommitdiff
path: root/server/red_worker.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/red_worker.h')
-rw-r--r--server/red_worker.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/server/red_worker.h b/server/red_worker.h
index bbbd5230..a76c805e 100644
--- a/server/red_worker.h
+++ b/server/red_worker.h
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <errno.h>
+#include "utils.h"
#include "red_common.h"
#include "red_dispatcher.h"
#include "red_parse_qxl.h"
@@ -30,7 +31,7 @@ typedef struct CommonChannelClient {
RedChannelClient base;
uint32_t id;
- struct RedWorker *worker;
+ RedWorker *worker;
int is_low_bandwidth;
} CommonChannelClient;
@@ -79,16 +80,6 @@ static inline void red_pipe_add_verb(RedChannelClient* rcc, uint16_t verb)
red_channel_client_pipe_add(rcc, &item->base);
}
-/* a generic safe for loop macro */
-#define SAFE_FOREACH(link, next, cond, ring, data, get_data) \
- for ((((link) = ((cond) ? ring_get_head(ring) : NULL)), \
- ((next) = ((link) ? ring_next((ring), (link)) : NULL)), \
- ((data) = ((link)? (get_data) : NULL))); \
- (link); \
- (((link) = (next)), \
- ((next) = ((link) ? ring_next((ring), (link)) : NULL)), \
- ((data) = ((link)? (get_data) : NULL))))
-
#define LINK_TO_RCC(ptr) SPICE_CONTAINEROF(ptr, RedChannelClient, channel_link)
#define RCC_FOREACH_SAFE(link, next, rcc, channel) \
SAFE_FOREACH(link, next, channel, &(channel)->clients, rcc, LINK_TO_RCC(link))