diff options
-rw-r--r-- | server/main-dispatcher.c | 4 | ||||
-rw-r--r-- | server/main-dispatcher.h | 2 | ||||
-rw-r--r-- | server/red-channel.c | 6 | ||||
-rw-r--r-- | server/red-channel.h | 6 | ||||
-rw-r--r-- | server/red-common.h | 17 | ||||
-rw-r--r-- | server/red-worker.c | 2 | ||||
-rw-r--r-- | server/reds-stream.c | 2 | ||||
-rw-r--r-- | server/reds.c | 5 | ||||
-rw-r--r-- | server/reds.h | 2 | ||||
-rw-r--r-- | server/tests/test_playback.c | 1 |
10 files changed, 32 insertions, 15 deletions
diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c index 78b2fed2..77f20716 100644 --- a/server/main-dispatcher.c +++ b/server/main-dispatcher.c @@ -49,7 +49,7 @@ typedef struct { Dispatcher base; - SpiceCoreInterface *core; + SpiceCoreInterfaceInternal *core; } MainDispatcher; MainDispatcher main_dispatcher; @@ -195,7 +195,7 @@ static void dispatcher_handle_read(int fd, int event, void *opaque) * Reds routines shouldn't be exposed. Instead reds.c should register the callbacks, * and the corresponding operations should be made only via main_dispatcher. */ -void main_dispatcher_init(SpiceCoreInterface *core) +void main_dispatcher_init(SpiceCoreInterfaceInternal *core) { memset(&main_dispatcher, 0, sizeof(main_dispatcher)); main_dispatcher.core = core; diff --git a/server/main-dispatcher.h b/server/main-dispatcher.h index a1a2e77c..1a062299 100644 --- a/server/main-dispatcher.h +++ b/server/main-dispatcher.h @@ -31,6 +31,6 @@ void main_dispatcher_set_mm_time_latency(RedClient *client, uint32_t latency); */ void main_dispatcher_client_disconnect(RedClient *client); -void main_dispatcher_init(SpiceCoreInterface *core); +void main_dispatcher_init(SpiceCoreInterfaceInternal *core); #endif //MAIN_DISPATCHER_H diff --git a/server/red-channel.c b/server/red-channel.c index 1cc65349..f79605a6 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -1008,7 +1008,7 @@ void red_channel_client_default_migrate(RedChannelClient *rcc) } RedChannel *red_channel_create(int size, - const SpiceCoreInterface *core, + const SpiceCoreInterfaceInternal *core, uint32_t type, uint32_t id, int handle_acks, channel_handle_message_proc handle_message, @@ -1080,7 +1080,7 @@ static void dummy_watch_remove(SpiceWatch *watch) } // TODO: actually, since I also use channel_client_dummy, no need for core. Can be NULL -SpiceCoreInterface dummy_core = { +SpiceCoreInterfaceInternal dummy_core = { .watch_update_mask = dummy_watch_update_mask, .watch_add = dummy_watch_add, .watch_remove = dummy_watch_remove, @@ -1123,7 +1123,7 @@ static int do_nothing_handle_message(RedChannelClient *rcc, } RedChannel *red_channel_create_parser(int size, - const SpiceCoreInterface *core, + const SpiceCoreInterfaceInternal *core, uint32_t type, uint32_t id, int handle_acks, spice_parse_channel_func_t parser, diff --git a/server/red-channel.h b/server/red-channel.h index c5784e65..791bc5b5 100644 --- a/server/red-channel.h +++ b/server/red-channel.h @@ -311,7 +311,7 @@ struct RedChannel { RingItem link; // channels link for reds - const SpiceCoreInterface *core; + const SpiceCoreInterfaceInternal *core; int handle_acks; // RedChannel will hold only connected channel clients (logic - when pushing pipe item to all channel clients, there @@ -359,7 +359,7 @@ struct RedChannel { /* if one of the callbacks should cause disconnect, use red_channel_shutdown and don't * explicitly destroy the channel */ RedChannel *red_channel_create(int size, - const SpiceCoreInterface *core, + const SpiceCoreInterfaceInternal *core, uint32_t type, uint32_t id, int handle_acks, channel_handle_message_proc handle_message, @@ -369,7 +369,7 @@ RedChannel *red_channel_create(int size, /* alternative constructor, meant for marshaller based (inputs,main) channels, * will become default eventually */ RedChannel *red_channel_create_parser(int size, - const SpiceCoreInterface *core, + const SpiceCoreInterfaceInternal *core, uint32_t type, uint32_t id, int handle_acks, spice_parse_channel_func_t parser, diff --git a/server/red-common.h b/server/red-common.h index f6098f6e..40da0b17 100644 --- a/server/red-common.h +++ b/server/red-common.h @@ -39,4 +39,21 @@ #include "spice.h" #include "utils.h" +typedef struct SpiceCoreInterfaceInternal SpiceCoreInterfaceInternal; + +struct SpiceCoreInterfaceInternal { + SpiceBaseInterface base; + + SpiceTimer *(*timer_add)(SpiceTimerFunc func, void *opaque); + void (*timer_start)(SpiceTimer *timer, uint32_t ms); + void (*timer_cancel)(SpiceTimer *timer); + void (*timer_remove)(SpiceTimer *timer); + + SpiceWatch *(*watch_add)(int fd, int event_mask, SpiceWatchFunc func, void *opaque); + void (*watch_update_mask)(SpiceWatch *watch, int event_mask); + void (*watch_remove)(SpiceWatch *watch); + + void (*channel_event)(int event, SpiceChannelEventInfo *info); +}; + #endif diff --git a/server/red-worker.c b/server/red-worker.c index ae798eca..9d2034c9 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -579,7 +579,7 @@ static void worker_watch_remove(SpiceWatch *watch) memset(watch, 0, sizeof(SpiceWatch)); } -SpiceCoreInterface worker_core = { +SpiceCoreInterfaceInternal worker_core = { .timer_add = spice_timer_queue_add, .timer_start = spice_timer_set, .timer_cancel = spice_timer_cancel, diff --git a/server/reds-stream.c b/server/reds-stream.c index d87cb232..d8e4fe4d 100644 --- a/server/reds-stream.c +++ b/server/reds-stream.c @@ -43,7 +43,7 @@ struct AsyncRead { }; typedef struct AsyncRead AsyncRead; -extern SpiceCoreInterface *core; +extern SpiceCoreInterfaceInternal *core; #if HAVE_SASL #include <sasl/sasl.h> diff --git a/server/reds.c b/server/reds.c index e8cf168e..54a398e1 100644 --- a/server/reds.c +++ b/server/reds.c @@ -72,7 +72,8 @@ #include "reds-private.h" -SpiceCoreInterface *core = NULL; +SpiceCoreInterfaceInternal *core = NULL; + static SpiceCharDeviceInstance *vdagent = NULL; static SpiceMigrateInstance *migration_interface = NULL; @@ -3274,7 +3275,7 @@ static int do_spice_init(SpiceCoreInterface *core_interface) spice_warning("bad core interface version"); goto err; } - core = core_interface; + core = (SpiceCoreInterfaceInternal *) core_interface; reds->listen_socket = -1; reds->secure_listen_socket = -1; init_vd_agent_resources(); diff --git a/server/reds.h b/server/reds.h index 4d1b6318..f3a9ce48 100644 --- a/server/reds.h +++ b/server/reds.h @@ -69,7 +69,7 @@ enum { extern uint32_t renderers[RED_RENDERER_LAST]; extern uint32_t num_renderers; -extern struct SpiceCoreInterface *core; +extern struct SpiceCoreInterfaceInternal *core; extern uint32_t streaming_video; extern SpiceImageCompression image_compression; extern spice_wan_compression_t jpeg_state; diff --git a/server/tests/test_playback.c b/server/tests/test_playback.c index cf31155a..12834273 100644 --- a/server/tests/test_playback.c +++ b/server/tests/test_playback.c @@ -22,7 +22,6 @@ #include <math.h> #include <spice.h> -#include "reds.h" #include "basic_event_loop.h" /* test the audio playback interface. Really basic no frils test - create |