summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:39 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:39 +0000
commite287f7e43a1dfbbea4de73e438f94cdbed95c6cf (patch)
treec6cc0f025121b48a378f8b1a15e663e1007c2d9c
parentdbc4148c35316a8813966fb7ba6357a8c3d4f346 (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
-rw-r--r--src/XF86Misc.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/XF86Misc.c b/src/XF86Misc.c
index 88d7895..3312d07 100644
--- a/src/XF86Misc.c
+++ b/src/XF86Misc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/Xxf86misc/XF86Misc.c,v 3.12 2002/11/20 04:04:57 dawes Exp $ */
+/* $XFree86: xc/lib/Xxf86misc/XF86Misc.c,v 3.13 2003/04/03 16:15:47 dawes Exp $ */
/*
* Copyright (c) 1995, 1996 The XFree86 Project, Inc
@@ -354,3 +354,53 @@ Bool XF86MiscGetFilePaths(dpy, filpaths)
return True;
}
+Status XF86MiscPassMessage(dpy, screen, msgtype, msgval, retmsg)
+ Display* dpy;
+ int screen;
+ const char* msgtype;
+ const char* msgval;
+ char** retmsg;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86MiscPassMessageReply rep;
+ xXF86MiscPassMessageReq *req;
+ int len;
+
+ XF86MiscCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86MiscPassMessage, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86miscReqType = X_XF86MiscPassMessage;
+ req->screen = screen;
+ if ((len = strlen(msgtype))) {
+ req->typelen = len + 1;
+ len = (req->typelen + 3) >> 2;
+ SetReqLen(req,len,len);
+ Data(dpy, msgtype, req->typelen);
+ }
+ if ((len = strlen(msgval))) {
+ req->vallen = len + 1;
+ len = (req->vallen + 3) >> 2;
+ SetReqLen(req,len,len);
+ Data(dpy, msgval, req->vallen);
+ }
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return BadImplementation;
+ }
+
+ if (rep.mesglen) {
+ if (!(*retmsg = Xcalloc(rep.mesglen + 1, 1))) {
+ _XEatData(dpy, ((rep.mesglen+3) & ~3));
+ return BadAlloc;
+ }
+ _XReadPad(dpy, *retmsg, rep.mesglen);
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status;
+}
+