From 00b03683d0e5cda40fa23b9fe6a83d7227f86f5d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 30 Jan 2009 14:31:08 +1000 Subject: dix: Add temporary conversion function ConvertBackToXI. Until the InternalEvents are used throughout the server, we can use this one to drop us back into XI la-la land where every event is the wire format. Signed-off-by: Peter Hutterer --- dix/eventconvert.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'dix/eventconvert.c') diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 2ade378f8..31fb47be2 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -328,3 +328,34 @@ GetXIType(InternalEvent *event) } return xitype; } + +/* + * FIXME: A temporary solution to make the server bisectable. This code + * allocates during SIGIO and makes a number of assumptions about what's in + * events. Will be removed soon. + */ +static int +ConvertBackToXI(EventListPtr events, int num_events) +{ + int count = GetMaximumEventsNum(); + int num = (num_events == 2) ? 1 : 0; + int i; + EventListPtr tmp_list = InitEventList(count); + + SetMinimumEventSize(tmp_list, count, 1000); /* just to be sure */ + + if (num_events == 2) /* DCCE Event? */ + { + if (EventToXI(events->event, tmp_list, &count)) + ErrorF("[dix] conversion to XI failed\n"); + memcpy(events->event, tmp_list->event, events->evlen); + events++; + } + + if (EventToXI(events->event, tmp_list, &count)) + ErrorF("[dix] conversion to XI failed\n"); + + for (i = 0; i < count; i++) + memcpy((events + i)->event, (tmp_list + i)->event, events->evlen); + return (count + num); +} -- cgit v1.2.3