~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to Xext/bigreq.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Xorg: bigreq.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
 
2
/*
 
3
 
 
4
Copyright 1992, 1998  The Open Group
 
5
 
 
6
Permission to use, copy, modify, distribute, and sell this software and its
 
7
documentation for any purpose is hereby granted without fee, provided that
 
8
the above copyright notice appear in all copies and that both that
 
9
copyright notice and this permission notice appear in supporting
 
10
documentation.
 
11
 
 
12
The above copyright notice and this permission notice shall be included
 
13
in all copies or substantial portions of the Software.
 
14
 
 
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
16
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
17
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
18
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
19
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
20
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
21
OTHER DEALINGS IN THE SOFTWARE.
 
22
 
 
23
Except as contained in this notice, the name of The Open Group shall
 
24
not be used in advertising or otherwise to promote the sale, use or
 
25
other dealings in this Software without prior written authorization
 
26
from The Open Group.
 
27
 
 
28
*/
 
29
/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.8 2003/10/28 23:08:43 tsi Exp $ */
 
30
 
 
31
#define NEED_EVENTS
 
32
#ifdef HAVE_DIX_CONFIG_H
 
33
#include <dix-config.h>
 
34
#endif
 
35
 
 
36
#include <X11/X.h>
 
37
#include <X11/Xproto.h>
 
38
#include "misc.h"
 
39
#include "os.h"
 
40
#include "dixstruct.h"
 
41
#include "extnsionst.h"
 
42
#include <X11/extensions/bigreqstr.h>
 
43
#include "opaque.h"
 
44
#include "modinit.h"
 
45
 
 
46
#if 0
 
47
static unsigned char XBigReqCode;
 
48
#endif
 
49
 
 
50
static void BigReqResetProc(
 
51
    ExtensionEntry * /* extEntry */
 
52
);
 
53
 
 
54
static DISPATCH_PROC(ProcBigReqDispatch);
 
55
 
 
56
void
 
57
BigReqExtensionInit(INITARGS)
 
58
{
 
59
#if 0
 
60
    ExtensionEntry *extEntry;
 
61
 
 
62
    if ((extEntry = AddExtension(XBigReqExtensionName, 0, 0,
 
63
                                 ProcBigReqDispatch, ProcBigReqDispatch,
 
64
                                 BigReqResetProc, StandardMinorOpcode)) != 0)
 
65
        XBigReqCode = (unsigned char)extEntry->base;
 
66
#else
 
67
    (void) AddExtension(XBigReqExtensionName, 0, 0,
 
68
                        ProcBigReqDispatch, ProcBigReqDispatch,
 
69
                        BigReqResetProc, StandardMinorOpcode);
 
70
#endif
 
71
 
 
72
    DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
 
73
}
 
74
 
 
75
/*ARGSUSED*/
 
76
static void
 
77
BigReqResetProc (extEntry)
 
78
    ExtensionEntry      *extEntry;
 
79
{
 
80
}
 
81
 
 
82
static int
 
83
ProcBigReqDispatch (client)
 
84
    register ClientPtr  client;
 
85
{
 
86
    REQUEST(xBigReqEnableReq);
 
87
    xBigReqEnableReply rep;
 
88
    register int n;
 
89
 
 
90
    if (client->swapped) {
 
91
        swaps(&stuff->length, n);
 
92
    }
 
93
    if (stuff->brReqType != X_BigReqEnable)
 
94
        return BadRequest;
 
95
    REQUEST_SIZE_MATCH(xBigReqEnableReq);
 
96
    client->big_requests = TRUE;
 
97
    rep.type = X_Reply;
 
98
    rep.length = 0;
 
99
    rep.sequenceNumber = client->sequence;
 
100
    rep.max_request_size = maxBigRequestSize;
 
101
    if (client->swapped) {
 
102
        swaps(&rep.sequenceNumber, n);
 
103
        swapl(&rep.max_request_size, n);
 
104
    }
 
105
    WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
 
106
    return(client->noClientException);
 
107
}