1 /************************************************************
3 Copyright (c) 1987 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.
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
31 Permission to use, copy, modify, and distribute this software and its
32 documentation for any purpose and without fee is hereby granted,
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47 ********************************************************/
49 /* $XConsortium: swapreq.c,v 1.39 94/04/17 20:26:45 dpw Exp $ */
50 /* $XFree86: xc/programs/Xserver/dix/swapreq.c,v 3.1 1996/05/06 05:56:24 dawes Exp $ */
55 #include "Xprotostr.h"
57 #include "dixstruct.h"
58 #include "extnsionst.h" /* for SendEvent */
61 extern int (* ProcVector[256]) ();
63 /* Thanks to Jack Palevich for testing and subsequently rewriting all this */
65 /* Byte swap a list of longs */
68 SwapLongs (list, count)
69 register CARD32 *list;
70 register unsigned long count;
90 } while (--count != 0);
94 /* Byte swap a list of shorts */
97 SwapShorts (list, count)
99 register unsigned long count;
103 while (count >= 16) {
127 } while (--count != 0);
131 /* The following is used for all requests that have
132 no fields to be swapped (except "length") */
134 SProcSimpleReq(client)
135 register ClientPtr client;
140 swaps(&stuff->length, n);
141 return(*ProcVector[stuff->reqType])(client);
144 /* The following is used for all requests that have
145 only a single 32-bit field to be swapped, coming
146 right after the "length" field */
148 SProcResourceReq(client)
149 register ClientPtr client;
153 REQUEST(xResourceReq);
154 swaps(&stuff->length, n);
155 REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
156 swapl(&stuff->id, n);
157 return(*ProcVector[stuff->reqType])(client);
161 SProcCreateWindow(client)
162 register ClientPtr client;
166 REQUEST(xCreateWindowReq);
167 swaps(&stuff->length, n);
168 REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
169 swapl(&stuff->wid, n);
170 swapl(&stuff->parent, n);
173 swaps(&stuff->width, n);
174 swaps(&stuff->height, n);
175 swaps(&stuff->borderWidth, n);
176 swaps(&stuff->class, n);
177 swapl(&stuff->visual, n);
178 swapl(&stuff->mask, n);
180 return((* ProcVector[X_CreateWindow])(client));
184 SProcChangeWindowAttributes(client)
185 register ClientPtr client;
189 REQUEST(xChangeWindowAttributesReq);
190 swaps(&stuff->length, n);
191 REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
192 swapl(&stuff->window, n);
193 swapl(&stuff->valueMask, n);
195 return((* ProcVector[X_ChangeWindowAttributes])(client));
199 SProcReparentWindow(client)
200 register ClientPtr client;
203 REQUEST(xReparentWindowReq);
204 swaps(&stuff->length, n);
205 REQUEST_SIZE_MATCH(xReparentWindowReq);
206 swapl(&stuff->window, n);
207 swapl(&stuff->parent, n);
210 return((* ProcVector[X_ReparentWindow])(client));
214 SProcConfigureWindow(client)
215 register ClientPtr client;
218 REQUEST(xConfigureWindowReq);
219 swaps(&stuff->length, n);
220 REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
221 swapl(&stuff->window, n);
222 swaps(&stuff->mask, n);
224 return((* ProcVector[X_ConfigureWindow])(client));
230 SProcInternAtom(client)
231 register ClientPtr client;
234 REQUEST(xInternAtomReq);
235 swaps(&stuff->length, n);
236 REQUEST_AT_LEAST_SIZE(xInternAtomReq);
237 swaps(&stuff->nbytes, n);
238 return((* ProcVector[X_InternAtom])(client));
242 SProcChangeProperty(client)
243 register ClientPtr client;
246 REQUEST(xChangePropertyReq);
247 swaps(&stuff->length, n);
248 REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
249 swapl(&stuff->window, n);
250 swapl(&stuff->property, n);
251 swapl(&stuff->type, n);
252 swapl(&stuff->nUnits, n);
253 switch ( stuff->format ) {
263 return((* ProcVector[X_ChangeProperty])(client));
267 SProcDeleteProperty(client)
268 register ClientPtr client;
271 REQUEST(xDeletePropertyReq);
272 swaps(&stuff->length, n);
273 REQUEST_SIZE_MATCH(xDeletePropertyReq);
274 swapl(&stuff->window, n);
275 swapl(&stuff->property, n);
276 return((* ProcVector[X_DeleteProperty])(client));
281 SProcGetProperty(client)
282 register ClientPtr client;
285 REQUEST(xGetPropertyReq);
286 swaps(&stuff->length, n);
287 REQUEST_SIZE_MATCH(xGetPropertyReq);
288 swapl(&stuff->window, n);
289 swapl(&stuff->property, n);
290 swapl(&stuff->type, n);
291 swapl(&stuff->longOffset, n);
292 swapl(&stuff->longLength, n);
293 return((* ProcVector[X_GetProperty])(client));
297 SProcSetSelectionOwner(client)
298 register ClientPtr client;
301 REQUEST(xSetSelectionOwnerReq);
302 swaps(&stuff->length, n);
303 REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
304 swapl(&stuff->window, n);
305 swapl(&stuff->selection, n);
306 swapl(&stuff->time, n);
307 return((* ProcVector[X_SetSelectionOwner])(client));
311 SProcConvertSelection(client)
312 register ClientPtr client;
315 REQUEST(xConvertSelectionReq);
316 swaps(&stuff->length, n);
317 REQUEST_SIZE_MATCH(xConvertSelectionReq);
318 swapl(&stuff->requestor, n);
319 swapl(&stuff->selection, n);
320 swapl(&stuff->target, n);
321 swapl(&stuff->property, n);
322 swapl(&stuff->time, n);
323 return((* ProcVector[X_ConvertSelection])(client));
327 SProcSendEvent(client)
328 register ClientPtr client;
333 REQUEST(xSendEventReq);
334 swaps(&stuff->length, n);
335 REQUEST_SIZE_MATCH(xSendEventReq);
336 swapl(&stuff->destination, n);
337 swapl(&stuff->eventMask, n);
340 proc = EventSwapVector[stuff->event.u.u.type & 0177];
341 if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
343 (*proc)(&stuff->event, &eventT);
344 stuff->event = eventT;
346 return((* ProcVector[X_SendEvent])(client));
350 SProcGrabPointer(client)
351 register ClientPtr client;
354 REQUEST(xGrabPointerReq);
355 swaps(&stuff->length, n);
356 REQUEST_SIZE_MATCH(xGrabPointerReq);
357 swapl(&stuff->grabWindow, n);
358 swaps(&stuff->eventMask, n);
359 swapl(&stuff->confineTo, n);
360 swapl(&stuff->cursor, n);
361 swapl(&stuff->time, n);
362 return((* ProcVector[X_GrabPointer])(client));
366 SProcGrabButton(client)
367 register ClientPtr client;
370 REQUEST(xGrabButtonReq);
371 swaps(&stuff->length, n);
372 REQUEST_SIZE_MATCH(xGrabButtonReq);
373 swapl(&stuff->grabWindow, n);
374 swaps(&stuff->eventMask, n);
375 swapl(&stuff->confineTo, n);
376 swapl(&stuff->cursor, n);
377 swaps(&stuff->modifiers, n);
378 return((* ProcVector[X_GrabButton])(client));
382 SProcUngrabButton(client)
383 register ClientPtr client;
386 REQUEST(xUngrabButtonReq);
387 swaps(&stuff->length, n);
388 REQUEST_SIZE_MATCH(xUngrabButtonReq);
389 swapl(&stuff->grabWindow, n);
390 swaps(&stuff->modifiers, n);
391 return((* ProcVector[X_UngrabButton])(client));
395 SProcChangeActivePointerGrab(client)
396 register ClientPtr client;
399 REQUEST(xChangeActivePointerGrabReq);
400 swaps(&stuff->length, n);
401 REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
402 swapl(&stuff->cursor, n);
403 swapl(&stuff->time, n);
404 swaps(&stuff->eventMask, n);
405 return((* ProcVector[X_ChangeActivePointerGrab])(client));
409 SProcGrabKeyboard(client)
410 register ClientPtr client;
413 REQUEST(xGrabKeyboardReq);
414 swaps(&stuff->length, n);
415 REQUEST_SIZE_MATCH(xGrabKeyboardReq);
416 swapl(&stuff->grabWindow, n);
417 swapl(&stuff->time, n);
418 return((* ProcVector[X_GrabKeyboard])(client));
423 register ClientPtr client;
426 REQUEST(xGrabKeyReq);
427 swaps(&stuff->length, n);
428 REQUEST_SIZE_MATCH(xGrabKeyReq);
429 swapl(&stuff->grabWindow, n);
430 swaps(&stuff->modifiers, n);
431 return((* ProcVector[X_GrabKey])(client));
435 SProcUngrabKey(client)
436 register ClientPtr client;
439 REQUEST(xUngrabKeyReq);
440 swaps(&stuff->length, n);
441 REQUEST_SIZE_MATCH(xUngrabKeyReq);
442 swapl(&stuff->grabWindow, n);
443 swaps(&stuff->modifiers, n);
444 return((* ProcVector[X_UngrabKey])(client));
448 SProcGetMotionEvents(client)
449 register ClientPtr client;
452 REQUEST(xGetMotionEventsReq);
453 swaps(&stuff->length, n);
454 REQUEST_SIZE_MATCH(xGetMotionEventsReq);
455 swapl(&stuff->window, n);
456 swapl(&stuff->start, n);
457 swapl(&stuff->stop, n);
458 return((* ProcVector[X_GetMotionEvents])(client));
462 SProcTranslateCoords(client)
463 register ClientPtr client;
466 REQUEST(xTranslateCoordsReq);
467 swaps(&stuff->length, n);
468 REQUEST_SIZE_MATCH(xTranslateCoordsReq);
469 swapl(&stuff->srcWid, n);
470 swapl(&stuff->dstWid, n);
471 swaps(&stuff->srcX, n);
472 swaps(&stuff->srcY, n);
473 return((* ProcVector[X_TranslateCoords])(client));
477 SProcWarpPointer(client)
478 register ClientPtr client;
481 REQUEST(xWarpPointerReq);
482 swaps(&stuff->length, n);
483 REQUEST_SIZE_MATCH(xWarpPointerReq);
484 swapl(&stuff->srcWid, n);
485 swapl(&stuff->dstWid, n);
486 swaps(&stuff->srcX, n);
487 swaps(&stuff->srcY, n);
488 swaps(&stuff->srcWidth, n);
489 swaps(&stuff->srcHeight, n);
490 swaps(&stuff->dstX, n);
491 swaps(&stuff->dstY, n);
492 return((* ProcVector[X_WarpPointer])(client));
496 SProcSetInputFocus(client)
497 register ClientPtr client;
500 REQUEST(xSetInputFocusReq);
501 swaps(&stuff->length, n);
502 REQUEST_SIZE_MATCH(xSetInputFocusReq);
503 swapl(&stuff->focus, n);
504 swapl(&stuff->time, n);
505 return((* ProcVector[X_SetInputFocus])(client));
509 SProcOpenFont(client)
510 register ClientPtr client;
513 REQUEST(xOpenFontReq);
514 swaps(&stuff->length, n);
515 REQUEST_AT_LEAST_SIZE(xOpenFontReq);
516 swapl(&stuff->fid, n);
517 swaps(&stuff->nbytes, n);
518 return((* ProcVector[X_OpenFont])(client));
522 SProcListFonts(client)
523 register ClientPtr client;
526 REQUEST(xListFontsReq);
527 swaps(&stuff->length, n);
528 REQUEST_AT_LEAST_SIZE(xListFontsReq);
529 swaps(&stuff->maxNames, n);
530 swaps(&stuff->nbytes, n);
531 return((* ProcVector[X_ListFonts])(client));
535 SProcListFontsWithInfo(client)
536 register ClientPtr client;
539 REQUEST(xListFontsWithInfoReq);
540 swaps(&stuff->length, n);
541 REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
542 swaps(&stuff->maxNames, n);
543 swaps(&stuff->nbytes, n);
544 return((* ProcVector[X_ListFontsWithInfo])(client));
548 SProcSetFontPath(client)
549 register ClientPtr client;
552 REQUEST(xSetFontPathReq);
553 swaps(&stuff->length, n);
554 REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
555 swaps(&stuff->nFonts, n);
556 return((* ProcVector[X_SetFontPath])(client));
560 SProcCreatePixmap(client)
561 register ClientPtr client;
564 REQUEST(xCreatePixmapReq);
566 swaps(&stuff->length, n);
567 REQUEST_SIZE_MATCH(xCreatePixmapReq);
568 swapl(&stuff->pid, n);
569 swapl(&stuff->drawable, n);
570 swaps(&stuff->width, n);
571 swaps(&stuff->height, n);
572 return((* ProcVector[X_CreatePixmap])(client));
576 SProcCreateGC(client)
577 register ClientPtr client;
580 REQUEST(xCreateGCReq);
581 swaps(&stuff->length, n);
582 REQUEST_AT_LEAST_SIZE(xCreateGCReq);
583 swapl(&stuff->gc, n);
584 swapl(&stuff->drawable, n);
585 swapl(&stuff->mask, n);
587 return((* ProcVector[X_CreateGC])(client));
591 SProcChangeGC(client)
592 register ClientPtr client;
595 REQUEST(xChangeGCReq);
596 swaps(&stuff->length, n);
597 REQUEST_AT_LEAST_SIZE(xChangeGCReq);
598 swapl(&stuff->gc, n);
599 swapl(&stuff->mask, n);
601 return((* ProcVector[X_ChangeGC])(client));
606 register ClientPtr client;
610 swaps(&stuff->length, n);
611 REQUEST_SIZE_MATCH(xCopyGCReq);
612 swapl(&stuff->srcGC, n);
613 swapl(&stuff->dstGC, n);
614 swapl(&stuff->mask, n);
615 return((* ProcVector[X_CopyGC])(client));
619 SProcSetDashes(client)
620 register ClientPtr client;
623 REQUEST(xSetDashesReq);
624 swaps(&stuff->length, n);
625 REQUEST_AT_LEAST_SIZE(xSetDashesReq);
626 swapl(&stuff->gc, n);
627 swaps(&stuff->dashOffset, n);
628 swaps(&stuff->nDashes, n);
629 return((* ProcVector[X_SetDashes])(client));
634 SProcSetClipRectangles(client)
635 register ClientPtr client;
638 REQUEST(xSetClipRectanglesReq);
639 swaps(&stuff->length, n);
640 REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
641 swapl(&stuff->gc, n);
642 swaps(&stuff->xOrigin, n);
643 swaps(&stuff->yOrigin, n);
645 return((* ProcVector[X_SetClipRectangles])(client));
649 SProcClearToBackground(client)
650 register ClientPtr client;
653 REQUEST(xClearAreaReq);
654 swaps(&stuff->length, n);
655 REQUEST_SIZE_MATCH(xClearAreaReq);
656 swapl(&stuff->window, n);
659 swaps(&stuff->width, n);
660 swaps(&stuff->height, n);
661 return((* ProcVector[X_ClearArea])(client));
665 SProcCopyArea(client)
666 register ClientPtr client;
669 REQUEST(xCopyAreaReq);
670 swaps(&stuff->length, n);
671 REQUEST_SIZE_MATCH(xCopyAreaReq);
672 swapl(&stuff->srcDrawable, n);
673 swapl(&stuff->dstDrawable, n);
674 swapl(&stuff->gc, n);
675 swaps(&stuff->srcX, n);
676 swaps(&stuff->srcY, n);
677 swaps(&stuff->dstX, n);
678 swaps(&stuff->dstY, n);
679 swaps(&stuff->width, n);
680 swaps(&stuff->height, n);
681 return((* ProcVector[X_CopyArea])(client));
685 SProcCopyPlane(client)
686 register ClientPtr client;
689 REQUEST(xCopyPlaneReq);
690 swaps(&stuff->length, n);
691 REQUEST_SIZE_MATCH(xCopyPlaneReq);
692 swapl(&stuff->srcDrawable, n);
693 swapl(&stuff->dstDrawable, n);
694 swapl(&stuff->gc, n);
695 swaps(&stuff->srcX, n);
696 swaps(&stuff->srcY, n);
697 swaps(&stuff->dstX, n);
698 swaps(&stuff->dstY, n);
699 swaps(&stuff->width, n);
700 swaps(&stuff->height, n);
701 swapl(&stuff->bitPlane, n);
702 return((* ProcVector[X_CopyPlane])(client));
705 /* The following routine is used for all Poly drawing requests
706 (except FillPoly, which uses a different request format) */
709 register ClientPtr client;
713 REQUEST(xPolyPointReq);
714 swaps(&stuff->length, n);
715 REQUEST_AT_LEAST_SIZE(xPolyPointReq);
716 swapl(&stuff->drawable, n);
717 swapl(&stuff->gc, n);
719 return((* ProcVector[stuff->reqType])(client));
722 /* cannot use SProcPoly for this one, because xFillPolyReq
723 is longer than xPolyPointReq, and we don't want to swap
724 the difference as shorts! */
726 SProcFillPoly(client)
727 register ClientPtr client;
731 REQUEST(xFillPolyReq);
732 swaps(&stuff->length, n);
733 REQUEST_AT_LEAST_SIZE(xFillPolyReq);
734 swapl(&stuff->drawable, n);
735 swapl(&stuff->gc, n);
737 return((* ProcVector[X_FillPoly])(client));
741 SProcPutImage(client)
742 register ClientPtr client;
745 REQUEST(xPutImageReq);
746 swaps(&stuff->length, n);
747 REQUEST_AT_LEAST_SIZE(xPutImageReq);
748 swapl(&stuff->drawable, n);
749 swapl(&stuff->gc, n);
750 swaps(&stuff->width, n);
751 swaps(&stuff->height, n);
752 swaps(&stuff->dstX, n);
753 swaps(&stuff->dstY, n);
754 /* Image should already be swapped */
755 return((* ProcVector[X_PutImage])(client));
760 SProcGetImage(client)
761 register ClientPtr client;
764 REQUEST(xGetImageReq);
765 swaps(&stuff->length, n);
766 REQUEST_SIZE_MATCH(xGetImageReq);
767 swapl(&stuff->drawable, n);
770 swaps(&stuff->width, n);
771 swaps(&stuff->height, n);
772 swapl(&stuff->planeMask, n);
773 return((* ProcVector[X_GetImage])(client));
776 /* ProcPolyText used for both PolyText8 and PolyText16 */
779 SProcPolyText(client)
780 register ClientPtr client;
783 REQUEST(xPolyTextReq);
784 swaps(&stuff->length, n);
785 REQUEST_AT_LEAST_SIZE(xPolyTextReq);
786 swapl(&stuff->drawable, n);
787 swapl(&stuff->gc, n);
790 return((* ProcVector[stuff->reqType])(client));
793 /* ProcImageText used for both ImageText8 and ImageText16 */
796 SProcImageText(client)
797 register ClientPtr client;
800 REQUEST(xImageTextReq);
801 swaps(&stuff->length, n);
802 REQUEST_AT_LEAST_SIZE(xImageTextReq);
803 swapl(&stuff->drawable, n);
804 swapl(&stuff->gc, n);
807 return((* ProcVector[stuff->reqType])(client));
811 SProcCreateColormap(client)
812 register ClientPtr client;
815 REQUEST(xCreateColormapReq);
816 swaps(&stuff->length, n);
817 REQUEST_SIZE_MATCH(xCreateColormapReq);
818 swapl(&stuff->mid, n);
819 swapl(&stuff->window, n);
820 swapl(&stuff->visual, n);
821 return((* ProcVector[X_CreateColormap])(client));
826 SProcCopyColormapAndFree(client)
827 register ClientPtr client;
830 REQUEST(xCopyColormapAndFreeReq);
831 swaps(&stuff->length, n);
832 REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
833 swapl(&stuff->mid, n);
834 swapl(&stuff->srcCmap, n);
835 return((* ProcVector[X_CopyColormapAndFree])(client));
840 SProcAllocColor (client)
841 register ClientPtr client;
844 REQUEST(xAllocColorReq);
845 swaps(&stuff->length, n);
846 REQUEST_SIZE_MATCH(xAllocColorReq);
847 swapl(&stuff->cmap, n);
848 swaps(&stuff->red, n);
849 swaps(&stuff->green, n);
850 swaps(&stuff->blue, n);
851 return((* ProcVector[X_AllocColor])(client));
855 SProcAllocNamedColor (client)
856 register ClientPtr client;
860 REQUEST(xAllocNamedColorReq);
861 swaps(&stuff->length, n);
862 REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
863 swapl(&stuff->cmap, n);
864 swaps(&stuff->nbytes, n);
865 return((* ProcVector[X_AllocNamedColor])(client));
869 SProcAllocColorCells (client)
870 register ClientPtr client;
873 REQUEST(xAllocColorCellsReq);
874 swaps(&stuff->length, n);
875 REQUEST_SIZE_MATCH(xAllocColorCellsReq);
876 swapl(&stuff->cmap, n);
877 swaps(&stuff->colors, n);
878 swaps(&stuff->planes, n);
879 return((* ProcVector[X_AllocColorCells])(client));
883 SProcAllocColorPlanes(client)
884 register ClientPtr client;
887 REQUEST(xAllocColorPlanesReq);
888 swaps(&stuff->length, n);
889 REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
890 swapl(&stuff->cmap, n);
891 swaps(&stuff->colors, n);
892 swaps(&stuff->red, n);
893 swaps(&stuff->green, n);
894 swaps(&stuff->blue, n);
895 return((* ProcVector[X_AllocColorPlanes])(client));
899 SProcFreeColors (client)
900 register ClientPtr client;
903 REQUEST(xFreeColorsReq);
904 swaps(&stuff->length, n);
905 REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
906 swapl(&stuff->cmap, n);
907 swapl(&stuff->planeMask, n);
909 return((* ProcVector[X_FreeColors])(client));
919 swapl(&pItem->pixel, n);
920 swaps(&pItem->red, n);
921 swaps(&pItem->green, n);
922 swaps(&pItem->blue, n);
926 SProcStoreColors (client)
927 register ClientPtr client;
933 REQUEST(xStoreColorsReq);
934 swaps(&stuff->length, n);
935 REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
936 swapl(&stuff->cmap, n);
937 pItem = (xColorItem *) &stuff[1];
938 for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
939 SwapColorItem(pItem++);
940 return((* ProcVector[X_StoreColors])(client));
944 SProcStoreNamedColor (client)
945 register ClientPtr client;
948 REQUEST(xStoreNamedColorReq);
949 swaps(&stuff->length, n);
950 REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
951 swapl(&stuff->cmap, n);
952 swapl(&stuff->pixel, n);
953 swaps(&stuff->nbytes, n);
954 return((* ProcVector[X_StoreNamedColor])(client));
958 SProcQueryColors(client)
959 register ClientPtr client;
962 REQUEST(xQueryColorsReq);
963 swaps(&stuff->length, n);
964 REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
965 swapl(&stuff->cmap, n);
967 return((* ProcVector[X_QueryColors])(client));
971 SProcLookupColor(client)
972 register ClientPtr client;
975 REQUEST(xLookupColorReq);
976 swaps(&stuff->length, n);
977 REQUEST_AT_LEAST_SIZE(xLookupColorReq);
978 swapl(&stuff->cmap, n);
979 swaps(&stuff->nbytes, n);
980 return((* ProcVector[X_LookupColor])(client));
984 SProcCreateCursor( client)
985 register ClientPtr client;
988 REQUEST(xCreateCursorReq);
989 swaps(&stuff->length, n);
990 REQUEST_SIZE_MATCH(xCreateCursorReq);
991 swapl(&stuff->cid, n);
992 swapl(&stuff->source, n);
993 swapl(&stuff->mask, n);
994 swaps(&stuff->foreRed, n);
995 swaps(&stuff->foreGreen, n);
996 swaps(&stuff->foreBlue, n);
997 swaps(&stuff->backRed, n);
998 swaps(&stuff->backGreen, n);
999 swaps(&stuff->backBlue, n);
1000 swaps(&stuff->x, n);
1001 swaps(&stuff->y, n);
1002 return((* ProcVector[X_CreateCursor])(client));
1006 SProcCreateGlyphCursor( client)
1007 register ClientPtr client;
1010 REQUEST(xCreateGlyphCursorReq);
1011 swaps(&stuff->length, n);
1012 REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
1013 swapl(&stuff->cid, n);
1014 swapl(&stuff->source, n);
1015 swapl(&stuff->mask, n);
1016 swaps(&stuff->sourceChar, n);
1017 swaps(&stuff->maskChar, n);
1018 swaps(&stuff->foreRed, n);
1019 swaps(&stuff->foreGreen, n);
1020 swaps(&stuff->foreBlue, n);
1021 swaps(&stuff->backRed, n);
1022 swaps(&stuff->backGreen, n);
1023 swaps(&stuff->backBlue, n);
1024 return((* ProcVector[X_CreateGlyphCursor])(client));
1029 SProcRecolorCursor(client)
1030 register ClientPtr client;
1033 REQUEST(xRecolorCursorReq);
1034 swaps(&stuff->length, n);
1035 REQUEST_SIZE_MATCH(xRecolorCursorReq);
1036 swapl(&stuff->cursor, n);
1037 swaps(&stuff->foreRed, n);
1038 swaps(&stuff->foreGreen, n);
1039 swaps(&stuff->foreBlue, n);
1040 swaps(&stuff->backRed, n);
1041 swaps(&stuff->backGreen, n);
1042 swaps(&stuff->backBlue, n);
1043 return((* ProcVector[X_RecolorCursor])(client));
1047 SProcQueryBestSize (client)
1048 register ClientPtr client;
1051 REQUEST(xQueryBestSizeReq);
1052 swaps(&stuff->length, n);
1053 REQUEST_SIZE_MATCH(xQueryBestSizeReq);
1054 swapl(&stuff->drawable, n);
1055 swaps(&stuff->width, n);
1056 swaps(&stuff->height, n);
1057 return((* ProcVector[X_QueryBestSize])(client));
1062 SProcQueryExtension (client)
1063 register ClientPtr client;
1066 REQUEST(xQueryExtensionReq);
1067 swaps(&stuff->length, n);
1068 REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
1069 swaps(&stuff->nbytes, n);
1070 return((* ProcVector[X_QueryExtension])(client));
1074 SProcChangeKeyboardMapping (client)
1075 register ClientPtr client;
1078 REQUEST(xChangeKeyboardMappingReq);
1079 swaps(&stuff->length, n);
1080 REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
1082 return((* ProcVector[X_ChangeKeyboardMapping])(client));
1087 SProcChangeKeyboardControl (client)
1088 register ClientPtr client;
1091 REQUEST(xChangeKeyboardControlReq);
1092 swaps(&stuff->length, n);
1093 REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
1094 swapl(&stuff->mask, n);
1096 return((* ProcVector[X_ChangeKeyboardControl])(client));
1100 SProcChangePointerControl (client)
1101 register ClientPtr client;
1104 REQUEST(xChangePointerControlReq);
1105 swaps(&stuff->length, n);
1106 REQUEST_SIZE_MATCH(xChangePointerControlReq);
1107 swaps(&stuff->accelNum, n);
1108 swaps(&stuff->accelDenum, n);
1109 swaps(&stuff->threshold, n);
1110 return((* ProcVector[X_ChangePointerControl])(client));
1115 SProcSetScreenSaver (client)
1116 register ClientPtr client;
1119 REQUEST(xSetScreenSaverReq);
1120 swaps(&stuff->length, n);
1121 REQUEST_SIZE_MATCH(xSetScreenSaverReq);
1122 swaps(&stuff->timeout, n);
1123 swaps(&stuff->interval, n);
1124 return((* ProcVector[X_SetScreenSaver])(client));
1128 SProcChangeHosts(client)
1129 register ClientPtr client;
1133 REQUEST(xChangeHostsReq);
1134 swaps(&stuff->length, n);
1135 REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
1136 swaps(&stuff->hostLength, n);
1137 return((* ProcVector[X_ChangeHosts])(client));
1141 int SProcRotateProperties(client)
1142 register ClientPtr client;
1145 REQUEST(xRotatePropertiesReq);
1146 swaps(&stuff->length, n);
1147 REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
1148 swapl(&stuff->window, n);
1149 swaps(&stuff->nAtoms, n);
1150 swaps(&stuff->nPositions, n);
1152 return ((* ProcVector[X_RotateProperties])(client));
1157 SProcNoOperation(client)
1162 swaps(&stuff->length, n);
1163 return ((* ProcVector[X_NoOperation])(client));
1167 SwapConnClientPrefix(pCCP)
1168 xConnClientPrefix *pCCP;
1172 swaps(&pCCP->majorVersion, n);
1173 swaps(&pCCP->minorVersion, n);
1174 swaps(&pCCP->nbytesAuthProto, n);
1175 swaps(&pCCP->nbytesAuthString, n);