summaryrefslogtreecommitdiffstats
path: root/server/red_channel.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-04-11 21:44:16 +0300
committerAlon Levy <alevy@redhat.com>2011-08-23 17:58:46 +0300
commit0f0bdb190b8586ef7ac20fcefffe641e44eb15b9 (patch)
treec60604668c0c1290f7a1d640c1ed5c65ea5d46b7 /server/red_channel.h
parent03cf66383ca9393e6521b96289a53dfc9d7cab60 (diff)
downloadspice-0f0bdb190b8586ef7ac20fcefffe641e44eb15b9.tar.gz
spice-0f0bdb190b8586ef7ac20fcefffe641e44eb15b9.tar.xz
spice-0f0bdb190b8586ef7ac20fcefffe641e44eb15b9.zip
server/red_channel: introduce pipes functions
Introduce functions to add (via producer method) the same item to multiple pipes, all for the same channel. Note: Right now there is only a single channel, but the next patches will do the per-channel breakdown to channel and channel_client before actually introducing a ring in RedChannel, this makes it easier to make smaller changes - the channel->rcc link will exist until removed in the ring introducing patch.
Diffstat (limited to 'server/red_channel.h')
-rw-r--r--server/red_channel.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/server/red_channel.h b/server/red_channel.h
index 09a613ae..f11565b6 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -270,6 +270,16 @@ void red_channel_client_set_message_serial(RedChannelClient *channel, uint64_t);
void red_channel_client_begin_send_message(RedChannelClient *rcc);
void red_channel_pipe_item_init(RedChannel *channel, PipeItem *item, int type);
+
+// TODO: add back the channel_pipe_add functionality - by adding reference counting
+// to the PipeItem.
+
+// helper to push a new item to all channels
+typedef PipeItem *(*new_pipe_item_t)(RedChannelClient *rcc, void *data, int num);
+void red_channel_pipes_new_add_push(RedChannel *channel, new_pipe_item_t creator, void *data);
+void red_channel_pipes_new_add(RedChannel *channel, new_pipe_item_t creator, void *data);
+void red_channel_pipes_new_add_tail(RedChannel *channel, new_pipe_item_t creator, void *data);
+
void red_channel_client_pipe_add_push(RedChannelClient *rcc, PipeItem *item);
void red_channel_client_pipe_add(RedChannelClient *rcc, PipeItem *item);
void red_channel_client_pipe_add_after(RedChannelClient *rcc, PipeItem *item, PipeItem *pos);
@@ -358,10 +368,10 @@ RedClient *red_channel_client_get_client(RedChannelClient *rcc);
SpiceDataHeader *red_channel_client_get_header(RedChannelClient *rcc);
/* apply given function to all connected clients */
-typedef void (*channel_client_visitor)(RedChannelClient *rcc);
-typedef void (*channel_client_visitor_data)(RedChannelClient *rcc, void *data);
-void red_channel_apply_clients(RedChannel *channel, channel_client_visitor v);
-void red_channel_apply_clients_data(RedChannel *channel, channel_client_visitor_data v, void *data);
+typedef void (*channel_client_callback)(RedChannelClient *rcc);
+typedef void (*channel_client_callback_data)(RedChannelClient *rcc, void *data);
+void red_channel_apply_clients(RedChannel *channel, channel_client_callback v);
+void red_channel_apply_clients_data(RedChannel *channel, channel_client_callback_data v, void *data);
struct RedClient {
RingItem link;