~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to Xi/setdval.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Xorg: setdval.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
2
 
 
3
1
/************************************************************
4
2
 
5
3
Copyright 1989, 1998  The Open Group
45
43
SOFTWARE.
46
44
 
47
45
********************************************************/
48
 
/* $XFree86: xc/programs/Xserver/Xi/setdval.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
49
46
 
50
47
/***********************************************************************
51
48
 *
59
56
#include <dix-config.h>
60
57
#endif
61
58
 
62
 
#include <X11/X.h>                              /* for inputstr.h    */
63
 
#include <X11/Xproto.h>                 /* Request macro     */
64
 
#include "inputstr.h"                   /* DeviceIntPtr      */
 
59
#include <X11/X.h>      /* for inputstr.h    */
 
60
#include <X11/Xproto.h> /* Request macro     */
 
61
#include "inputstr.h"   /* DeviceIntPtr      */
65
62
#include <X11/extensions/XI.h>
66
63
#include <X11/extensions/XIproto.h>
67
64
#include "XIstubs.h"
68
65
#include "extnsionst.h"
69
 
#include "extinit.h"                    /* LookupDeviceIntRec */
 
66
#include "extinit.h"    /* LookupDeviceIntRec */
70
67
#include "exglobals.h"
71
68
 
72
69
#include "setdval.h"
78
75
 */
79
76
 
80
77
int
81
 
SProcXSetDeviceValuators(client)
82
 
    register ClientPtr client;
83
 
    {
 
78
SProcXSetDeviceValuators(register ClientPtr client)
 
79
{
84
80
    register char n;
85
81
 
86
82
    REQUEST(xSetDeviceValuatorsReq);
87
83
    swaps(&stuff->length, n);
88
 
    return(ProcXSetDeviceValuators(client));
89
 
    }
 
84
    return (ProcXSetDeviceValuators(client));
 
85
}
90
86
 
91
87
/***********************************************************************
92
88
 *
95
91
 */
96
92
 
97
93
int
98
 
ProcXSetDeviceValuators(client)
99
 
    register ClientPtr client;
100
 
    {
 
94
ProcXSetDeviceValuators(register ClientPtr client)
 
95
{
101
96
    DeviceIntPtr dev;
102
 
    xSetDeviceValuatorsReply    rep;
 
97
    xSetDeviceValuatorsReply rep;
103
98
 
104
99
    REQUEST(xSetDeviceValuatorsReq);
105
100
    REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
110
105
    rep.status = Success;
111
106
    rep.sequenceNumber = client->sequence;
112
107
 
113
 
    if (stuff->length !=(sizeof(xSetDeviceValuatorsReq)>>2) + 
114
 
        stuff->num_valuators)
115
 
        {
116
 
        SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0, 
117
 
                BadLength);
118
 
        return Success;
119
 
        }
120
 
    dev = LookupDeviceIntRec (stuff->deviceid);
121
 
    if (dev == NULL)
122
 
        {
123
 
        SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0, 
124
 
            BadDevice);
125
 
        return Success;
126
 
        }
127
 
    if (dev->valuator == NULL)
128
 
        {
129
 
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, 
130
 
                BadMatch);
131
 
        return Success;
132
 
        }
 
108
    if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) +
 
109
        stuff->num_valuators) {
 
110
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength);
 
111
        return Success;
 
112
    }
 
113
    dev = LookupDeviceIntRec(stuff->deviceid);
 
114
    if (dev == NULL) {
 
115
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice);
 
116
        return Success;
 
117
    }
 
118
    if (dev->valuator == NULL) {
 
119
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch);
 
120
        return Success;
 
121
    }
133
122
 
134
 
    if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
135
 
        {
136
 
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, 
137
 
                BadValue);
 
123
    if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) {
 
124
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue);
138
125
        return Success;
139
 
        }
 
126
    }
140
127
 
141
128
    if ((dev->grab) && !SameClient(dev->grab, client))
142
129
        rep.status = AlreadyGrabbed;
143
130
    else
144
 
        rep.status = SetDeviceValuators (client, dev, (int *) &stuff[1],
145
 
            stuff->first_valuator, stuff->num_valuators);
 
131
        rep.status = SetDeviceValuators(client, dev, (int *)&stuff[1],
 
132
                                        stuff->first_valuator,
 
133
                                        stuff->num_valuators);
146
134
 
147
135
    if (rep.status != Success && rep.status != AlreadyGrabbed)
148
 
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, 
149
 
            rep.status);
 
136
        SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
 
137
                          rep.status);
150
138
    else
151
 
        WriteReplyToClient (client, sizeof (xSetDeviceValuatorsReply), &rep);
 
139
        WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
152
140
 
153
141
    return Success;
154
 
    }
 
142
}
155
143
 
156
144
/***********************************************************************
157
145
 *
161
149
 */
162
150
 
163
151
void
164
 
SRepXSetDeviceValuators (client, size, rep)
165
 
    ClientPtr   client;
166
 
    int         size;
167
 
    xSetDeviceValuatorsReply    *rep;
168
 
    {
 
152
SRepXSetDeviceValuators(ClientPtr client, int size,
 
153
                        xSetDeviceValuatorsReply * rep)
 
154
{
169
155
    register char n;
170
156
 
171
157
    swaps(&rep->sequenceNumber, n);
172
158
    swapl(&rep->length, n);
173
159
    WriteToClient(client, size, (char *)rep);
174
 
    }
 
160
}