xserver

xserver with xephyr scale patch
git clone https://git.neptards.moe/u3shit/xserver.git
Log | Files | Refs | README | LICENSE

bigreq.c (2277B)


      1 /*
      2 
      3 Copyright 1992, 1998  The Open Group
      4 
      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
      9 documentation.
     10 
     11 The above copyright notice and this permission notice shall be included
     12 in all copies or substantial portions of the Software.
     13 
     14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     17 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
     18 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     19 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     20 OTHER DEALINGS IN THE SOFTWARE.
     21 
     22 Except as contained in this notice, the name of The Open Group shall
     23 not be used in advertising or otherwise to promote the sale, use or
     24 other dealings in this Software without prior written authorization
     25 from The Open Group.
     26 
     27 */
     28 
     29 #ifdef HAVE_DIX_CONFIG_H
     30 #include <dix-config.h>
     31 #endif
     32 
     33 #include <X11/X.h>
     34 #include <X11/Xproto.h>
     35 #include "misc.h"
     36 #include "os.h"
     37 #include "dixstruct.h"
     38 #include "extnsionst.h"
     39 #include <X11/extensions/bigreqsproto.h>
     40 #include "opaque.h"
     41 #include "extinit.h"
     42 
     43 static int
     44 ProcBigReqDispatch(ClientPtr client)
     45 {
     46     REQUEST(xBigReqEnableReq);
     47     xBigReqEnableReply rep;
     48 
     49     if (client->swapped) {
     50         swaps(&stuff->length);
     51     }
     52     if (stuff->brReqType != X_BigReqEnable)
     53         return BadRequest;
     54     REQUEST_SIZE_MATCH(xBigReqEnableReq);
     55     client->big_requests = TRUE;
     56     rep = (xBigReqEnableReply) {
     57         .type = X_Reply,
     58         .sequenceNumber = client->sequence,
     59         .length = 0,
     60         .max_request_size = maxBigRequestSize
     61     };
     62     if (client->swapped) {
     63         swaps(&rep.sequenceNumber);
     64         swapl(&rep.max_request_size);
     65     }
     66     WriteToClient(client, sizeof(xBigReqEnableReply), &rep);
     67     return Success;
     68 }
     69 
     70 void
     71 BigReqExtensionInit(void)
     72 {
     73     AddExtension(XBigReqExtensionName, 0, 0,
     74                  ProcBigReqDispatch, ProcBigReqDispatch,
     75                  NULL, StandardMinorOpcode);
     76 }