1 /************************************************************
3 Copyright (c) 1989 X Consortium
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of the X Consortium shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from the X Consortium.
26 ********************************************************/
28 /* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM BLESSING */
30 /* $XConsortium: mitmisc.c,v 1.5 94/04/17 20:32:54 rws Exp $ */
31 /* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.1 1996/05/06 05:55:29 dawes Exp $ */
38 #include "dixstruct.h"
39 #include "extnsionst.h"
40 #define _MITMISC_SERVER_
41 #include "mitmiscstr.h"
43 extern Bool permitOldBugs;
45 static unsigned char MITReqCode;
47 static void MITResetProc(
48 #if NeedFunctionPrototypes
49 ExtensionEntry * /* extEntry */
53 static DISPATCH_PROC(ProcMITDispatch);
54 static DISPATCH_PROC(ProcMITGetBugMode);
55 static DISPATCH_PROC(ProcMITSetBugMode);
56 static DISPATCH_PROC(SProcMITDispatch);
57 static DISPATCH_PROC(SProcMITGetBugMode);
58 static DISPATCH_PROC(SProcMITSetBugMode);
61 MITMiscExtensionInit()
63 ExtensionEntry *extEntry;
65 if ((extEntry = AddExtension(MITMISCNAME, 0, 0,
66 ProcMITDispatch, SProcMITDispatch,
67 MITResetProc, StandardMinorOpcode)) != 0)
68 MITReqCode = (unsigned char)extEntry->base;
73 MITResetProc (extEntry)
74 ExtensionEntry *extEntry;
79 ProcMITSetBugMode(client)
80 register ClientPtr client;
82 REQUEST(xMITSetBugModeReq);
84 REQUEST_SIZE_MATCH(xMITSetBugModeReq);
85 if ((stuff->onOff != xTrue) && (stuff->onOff != xFalse))
87 client->errorValue = stuff->onOff;
90 permitOldBugs = stuff->onOff;
91 return(client->noClientException);
95 ProcMITGetBugMode(client)
96 register ClientPtr client;
98 xMITGetBugModeReply rep;
101 REQUEST_SIZE_MATCH(xMITGetBugModeReq);
104 rep.sequenceNumber = client->sequence;
105 rep.onOff = permitOldBugs;
106 if (client->swapped) {
107 swaps(&rep.sequenceNumber, n);
108 swapl(&rep.length, n);
110 WriteToClient(client, sizeof(xMITGetBugModeReply), (char *)&rep);
111 return(client->noClientException);
115 ProcMITDispatch (client)
116 register ClientPtr client;
121 case X_MITSetBugMode:
122 return ProcMITSetBugMode(client);
123 case X_MITGetBugMode:
124 return ProcMITGetBugMode(client);
131 SProcMITSetBugMode(client)
132 register ClientPtr client;
135 REQUEST(xMITSetBugModeReq);
137 swaps(&stuff->length, n);
138 return ProcMITSetBugMode(client);
142 SProcMITGetBugMode(client)
143 register ClientPtr client;
146 REQUEST(xMITGetBugModeReq);
148 swaps(&stuff->length, n);
149 return ProcMITGetBugMode(client);
153 SProcMITDispatch (client)
154 register ClientPtr client;
159 case X_MITSetBugMode:
160 return SProcMITSetBugMode(client);
161 case X_MITGetBugMode:
162 return SProcMITGetBugMode(client);