1 /************************************************************
3 Copyright 1989, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
25 ********************************************************/
27 /* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
31 #ifdef HAVE_DIX_CONFIG_H
32 #include <dix-config.h>
36 #include <X11/Xproto.h>
39 #include "dixstruct.h"
40 #include "extnsionst.h"
41 #define _MITMISC_SERVER_
42 #include <X11/extensions/mitmiscstr.h>
46 static unsigned char MITReqCode
;
49 static void MITResetProc(
50 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(INITARGS
)
64 ExtensionEntry
*extEntry
;
66 if ((extEntry
= AddExtension(MITMISCNAME
, 0, 0,
67 ProcMITDispatch
, SProcMITDispatch
,
68 MITResetProc
, StandardMinorOpcode
)) != 0)
69 MITReqCode
= (unsigned char)extEntry
->base
;
71 (void) AddExtension(MITMISCNAME
, 0, 0,
72 ProcMITDispatch
, SProcMITDispatch
,
73 MITResetProc
, StandardMinorOpcode
);
79 MITResetProc (extEntry
)
80 ExtensionEntry
*extEntry
;
85 ProcMITSetBugMode(client
)
86 register ClientPtr client
;
88 REQUEST(xMITSetBugModeReq
);
90 REQUEST_SIZE_MATCH(xMITSetBugModeReq
);
91 if (stuff
->onOff
!= xFalse
)
93 return(client
->noClientException
);
97 ProcMITGetBugMode(client
)
98 register ClientPtr client
;
100 xMITGetBugModeReply rep
;
103 REQUEST_SIZE_MATCH(xMITGetBugModeReq
);
106 rep
.sequenceNumber
= client
->sequence
;
108 if (client
->swapped
) {
109 swaps(&rep
.sequenceNumber
, n
);
110 swapl(&rep
.length
, n
);
112 WriteToClient(client
, sizeof(xMITGetBugModeReply
), (char *)&rep
);
113 return(client
->noClientException
);
117 ProcMITDispatch (client
)
118 register ClientPtr client
;
123 case X_MITSetBugMode
:
124 return ProcMITSetBugMode(client
);
125 case X_MITGetBugMode
:
126 return ProcMITGetBugMode(client
);
133 SProcMITSetBugMode(client
)
134 register ClientPtr client
;
137 REQUEST(xMITSetBugModeReq
);
139 swaps(&stuff
->length
, n
);
140 return ProcMITSetBugMode(client
);
144 SProcMITGetBugMode(client
)
145 register ClientPtr client
;
148 REQUEST(xMITGetBugModeReq
);
150 swaps(&stuff
->length
, n
);
151 return ProcMITGetBugMode(client
);
155 SProcMITDispatch (client
)
156 register ClientPtr client
;
161 case X_MITSetBugMode
:
162 return SProcMITSetBugMode(client
);
163 case X_MITGetBugMode
:
164 return SProcMITGetBugMode(client
);