summaryrefslogtreecommitdiff
path: root/dix/eventconvert.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-01-30 14:31:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-02-23 17:52:39 +1000
commit00b03683d0e5cda40fa23b9fe6a83d7227f86f5d (patch)
tree71e177d8c49c3db13fc04ade200424a2c02cc2c8 /dix/eventconvert.c
parent269d4d9f2e86fde8c6a28ef0293fb0e44b577886 (diff)
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 <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r--dix/eventconvert.c31
1 files changed, 31 insertions, 0 deletions
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);
+}