|
|
1.1 root 1: /************************************************************
2: Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
3: and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
4:
5: All Rights Reserved
6:
7: Permission to use, copy, modify, and distribute this software and its
8: documentation for any purpose and without fee is hereby granted,
9: provided that the above copyright notice appear in all copies and that
10: both that copyright notice and this permission notice appear in
11: supporting documentation, and that the names of Digital or MIT not be
12: used in advertising or publicity pertaining to distribution of the
13: software without specific, written prior permission.
14:
15: DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17: DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21: SOFTWARE.
22:
23: ********************************************************/
24:
25: /* $Header: swapreq.c,v 1.26 87/08/14 22:40:54 newman Exp $ */
26:
27: #include "X.h"
28: #define NEED_EVENTS
29: #include "Xproto.h"
30: #include "Xprotostr.h"
31: #include "misc.h"
32: #include "dixstruct.h"
33:
34: extern int (* ProcVector[256]) ();
35: extern void (* EventSwapVector[128]) (); /* for SendEvent */
36:
37: /* Thanks to Jack Palevich for testing and subsequently rewriting all this */
38:
39: #define LengthRestB(stuff) \
40: ((stuff->length << 2) - sizeof(*stuff))
41:
42: #define LengthRestS(stuff) \
43: ((stuff->length << 1) - (sizeof(*stuff) >> 1))
44:
45: #define LengthRestL(stuff) \
46: (stuff->length - (sizeof(*stuff) >> 2))
47:
48: #define SwapRestS(stuff) \
49: SwapShorts(stuff + 1, LengthRestS(stuff))
50:
51: #define SwapRestL(stuff) \
52: SwapLongs(stuff + 1, LengthRestL(stuff))
53:
54:
55: /* The following is used for all requests that have
56: no fields to be swapped (except "length") */
57: int
58: SProcSimpleReq(client)
59: register ClientPtr client;
60: {
61: register char n;
62:
63: REQUEST(xReq);
64: swaps(&stuff->length, n);
65: return(*ProcVector[stuff->reqType])(client);
66: }
67:
68: /* The following is used for all requests that have
69: only a single 32-bit field to be swapped, coming
70: right after the "length" field */
71: int
72: SProcResourceReq(client)
73: register ClientPtr client;
74: {
75: register char n;
76:
77: REQUEST(xResourceReq);
78: swaps(&stuff->length, n);
79: swapl(&stuff->id, n);
80: return(*ProcVector[stuff->reqType])(client);
81: }
82:
83: int
84: SProcCreateWindow(client)
85: register ClientPtr client;
86: {
87: register char n;
88:
89: REQUEST(xCreateWindowReq);
90: swaps(&stuff->length, n);
91: swapl(&stuff->wid, n);
92: swapl(&stuff->parent, n);
93: swaps(&stuff->x, n);
94: swaps(&stuff->y, n);
95: swaps(&stuff->width, n);
96: swaps(&stuff->height, n);
97: swaps(&stuff->borderWidth, n);
98: swaps(&stuff->class, n);
99: swapl(&stuff->visual, n);
100: swapl(&stuff->mask, n);
101: SwapRestL(stuff);
102: return((* ProcVector[X_CreateWindow])(client));
103: }
104:
105: int
106: SProcChangeWindowAttributes(client)
107: register ClientPtr client;
108: {
109: register char n;
110:
111: REQUEST(xChangeWindowAttributesReq);
112: swaps(&stuff->length, n);
113: swapl(&stuff->window, n);
114: swapl(&stuff->valueMask, n);
115: SwapRestL(stuff);
116: return((* ProcVector[X_ChangeWindowAttributes])(client));
117: }
118:
119: int
120: SProcReparentWindow(client)
121: register ClientPtr client;
122: {
123: register char n;
124: REQUEST(xReparentWindowReq);
125: swaps(&stuff->length, n);
126: swapl(&stuff->window, n);
127: swapl(&stuff->parent, n);
128: swaps(&stuff->x, n);
129: swaps(&stuff->y, n);
130: return((* ProcVector[X_ReparentWindow])(client));
131: }
132:
133: int
134: SProcConfigureWindow(client)
135: register ClientPtr client;
136: {
137: register char n;
138: REQUEST(xConfigureWindowReq);
139: swaps(&stuff->length, n);
140: swapl(&stuff->window, n);
141: swaps(&stuff->mask, n);
142: SwapRestL(stuff);
143: return((* ProcVector[X_ConfigureWindow])(client));
144:
145: }
146:
147:
148: int
149: SProcInternAtom(client)
150: register ClientPtr client;
151: {
152: register char n;
153: REQUEST(xInternAtomReq);
154: swaps(&stuff->length, n);
155: swaps(&stuff->nbytes, n);
156: return((* ProcVector[X_InternAtom])(client));
157: }
158:
159: int
160: SProcChangeProperty(client)
161: register ClientPtr client;
162: {
163: register char n;
164: REQUEST(xChangePropertyReq);
165: swaps(&stuff->length, n);
166: swapl(&stuff->window, n);
167: swapl(&stuff->property, n);
168: swapl(&stuff->type, n);
169: swapl(&stuff->nUnits, n);
170: switch ( stuff->format ) {
171: case 8 : break;
172: case 16:
173: SwapShorts(stuff + 1, stuff->nUnits);
174: break;
175: case 32:
176: SwapLongs(stuff + 1, stuff->nUnits);
177: break;
178: }
179: return((* ProcVector[X_ChangeProperty])(client));
180: }
181:
182: int
183: SProcDeleteProperty(client)
184: register ClientPtr client;
185: {
186: register char n;
187: REQUEST(xDeletePropertyReq);
188: swaps(&stuff->length, n);
189: swapl(&stuff->window, n);
190: swapl(&stuff->property, n);
191: return((* ProcVector[X_DeleteProperty])(client));
192:
193: }
194:
195: int
196: SProcGetProperty(client)
197: register ClientPtr client;
198: {
199: register char n;
200: REQUEST(xGetPropertyReq);
201: swaps(&stuff->length, n);
202: swapl(&stuff->window, n);
203: swapl(&stuff->property, n);
204: swapl(&stuff->type, n);
205: swapl(&stuff->longOffset, n);
206: swapl(&stuff->longLength, n);
207: return((* ProcVector[X_GetProperty])(client));
208: }
209:
210: int
211: SProcSetSelectionOwner(client)
212: register ClientPtr client;
213: {
214: register char n;
215: REQUEST(xSetSelectionOwnerReq);
216: swaps(&stuff->length, n);
217: swapl(&stuff->window, n);
218: swapl(&stuff->selection, n);
219: swapl(&stuff->time, n);
220: return((* ProcVector[X_SetSelectionOwner])(client));
221: }
222:
223: int
224: SProcConvertSelection(client)
225: register ClientPtr client;
226: {
227: register char n;
228: REQUEST(xConvertSelectionReq);
229: swaps(&stuff->length, n);
230: swapl(&stuff->requestor, n);
231: swapl(&stuff->selection, n);
232: swapl(&stuff->target, n);
233: swapl(&stuff->property, n);
234: swapl(&stuff->time, n);
235: return((* ProcVector[X_ConvertSelection])(client));
236: }
237:
238: int
239: SProcSendEvent(client)
240: register ClientPtr client;
241: {
242: register char n;
243: xEvent eventT;
244: void (*proc)();
245: REQUEST(xSendEventReq);
246: swaps(&stuff->length, n);
247: swapl(&stuff->destination, n);
248: swapl(&stuff->eventMask, n);
249:
250: /* Swap event */
251: proc = EventSwapVector[stuff->event.u.u.type & 0177];
252: if (!proc) /* no swapping proc; invalid event type? */
253: return (BadValue);
254: (*proc)(&stuff->event, &eventT);
255: stuff->event = eventT;
256:
257: return((* ProcVector[X_SendEvent])(client));
258: }
259:
260: int
261: SProcGrabPointer(client)
262: register ClientPtr client;
263: {
264: register char n;
265: REQUEST(xGrabPointerReq);
266: swaps(&stuff->length, n);
267: swapl(&stuff->grabWindow, n);
268: swaps(&stuff->eventMask, n);
269: swapl(&stuff->confineTo, n);
270: swapl(&stuff->cursor, n);
271: swapl(&stuff->time, n);
272: return((* ProcVector[X_GrabPointer])(client));
273: }
274:
275: int
276: SProcGrabButton(client)
277: register ClientPtr client;
278: {
279: register char n;
280: REQUEST(xGrabButtonReq);
281: swaps(&stuff->length, n);
282: swapl(&stuff->grabWindow, n);
283: swaps(&stuff->eventMask, n);
284: swapl(&stuff->confineTo, n);
285: swapl(&stuff->cursor, n);
286: swaps(&stuff->modifiers, n);
287: return((* ProcVector[X_GrabButton])(client));
288: }
289:
290: int
291: SProcUngrabButton(client)
292: register ClientPtr client;
293: {
294: register char n;
295: REQUEST(xUngrabButtonReq);
296: swaps(&stuff->length, n);
297: swapl(&stuff->grabWindow, n);
298: swaps(&stuff->modifiers, n);
299: return((* ProcVector[X_UngrabButton])(client));
300: }
301:
302: int
303: SProcChangeActivePointerGrab(client)
304: register ClientPtr client;
305: {
306: register char n;
307: REQUEST(xChangeActivePointerGrabReq);
308: swaps(&stuff->length, n);
309: swapl(&stuff->cursor, n);
310: swapl(&stuff->time, n);
311: swaps(&stuff->eventMask, n);
312: return((* ProcVector[X_ChangeActivePointerGrab])(client));
313: }
314:
315: int
316: SProcGrabKeyboard(client)
317: register ClientPtr client;
318: {
319: register char n;
320: REQUEST(xGrabKeyboardReq);
321: swaps(&stuff->length, n);
322: swapl(&stuff->grabWindow, n);
323: swapl(&stuff->time, n);
324: return((* ProcVector[X_GrabKeyboard])(client));
325: }
326:
327: int
328: SProcGrabKey(client)
329: register ClientPtr client;
330: {
331: register char n;
332: REQUEST(xGrabKeyReq);
333: swaps(&stuff->length, n);
334: swapl(&stuff->grabWindow, n);
335: swaps(&stuff->modifiers, n);
336: return((* ProcVector[X_GrabKey])(client));
337: }
338:
339: int
340: SProcUngrabKey(client)
341: register ClientPtr client;
342: {
343: register char n;
344: REQUEST(xUngrabKeyReq);
345: swaps(&stuff->length, n);
346: swapl(&stuff->grabWindow, n);
347: swaps(&stuff->modifiers, n);
348: return((* ProcVector[X_UngrabKey])(client));
349: }
350:
351: int
352: SProcGetMotionEvents(client)
353: register ClientPtr client;
354: {
355: register char n;
356: REQUEST(xGetMotionEventsReq);
357: swaps(&stuff->length, n);
358: swapl(&stuff->window, n);
359: swapl(&stuff->start, n);
360: swapl(&stuff->stop, n);
361: return((* ProcVector[X_GetMotionEvents])(client));
362: }
363:
364: int
365: SProcTranslateCoords(client)
366: register ClientPtr client;
367: {
368: register char n;
369: REQUEST(xTranslateCoordsReq);
370: swaps(&stuff->length, n);
371: swapl(&stuff->srcWid, n);
372: swapl(&stuff->dstWid, n);
373: swaps(&stuff->srcX, n);
374: swaps(&stuff->srcY, n);
375: return((* ProcVector[X_TranslateCoords])(client));
376: }
377:
378: int
379: SProcWarpPointer(client)
380: register ClientPtr client;
381: {
382: register char n;
383: REQUEST(xWarpPointerReq);
384: swaps(&stuff->length, n);
385: swapl(&stuff->srcWid, n);
386: swapl(&stuff->dstWid, n);
387: swaps(&stuff->srcX, n);
388: swaps(&stuff->srcY, n);
389: swaps(&stuff->srcWidth, n);
390: swaps(&stuff->srcHeight, n);
391: swaps(&stuff->dstX, n);
392: swaps(&stuff->dstY, n);
393: return((* ProcVector[X_WarpPointer])(client));
394: }
395:
396: int
397: SProcSetInputFocus(client)
398: register ClientPtr client;
399: {
400: register char n;
401: REQUEST(xSetInputFocusReq);
402: swaps(&stuff->length, n);
403: swapl(&stuff->focus, n);
404: swapl(&stuff->time, n);
405: return((* ProcVector[X_SetInputFocus])(client));
406: }
407:
408:
409: SProcOpenFont(client)
410: register ClientPtr client;
411: {
412: register char n;
413: REQUEST(xOpenFontReq);
414: swaps(&stuff->length, n);
415: swapl(&stuff->fid, n);
416: swaps(&stuff->nbytes, n);
417: return((* ProcVector[X_OpenFont])(client));
418: }
419:
420: int
421: SProcListFonts(client)
422: register ClientPtr client;
423: {
424: register char n;
425: REQUEST(xListFontsReq);
426: swaps(&stuff->length, n);
427: swaps(&stuff->maxNames, n);
428: swaps(&stuff->nbytes, n);
429: return((* ProcVector[X_ListFonts])(client));
430: }
431:
432: int
433: SProcListFontsWithInfo(client)
434: register ClientPtr client;
435: {
436: register char n;
437: REQUEST(xListFontsWithInfoReq);
438: swaps(&stuff->length, n);
439: swaps(&stuff->maxNames, n);
440: swaps(&stuff->nbytes, n);
441: return((* ProcVector[X_ListFontsWithInfo])(client));
442: }
443:
444: int
445: SProcSetFontPath(client)
446: register ClientPtr client;
447: {
448: register char n;
449: REQUEST(xSetFontPathReq);
450: swaps(&stuff->length, n);
451: swaps(&stuff->nFonts, n);
452: return((* ProcVector[X_SetFontPath])(client));
453: }
454:
455: int
456: SProcCreatePixmap(client)
457: register ClientPtr client;
458: {
459: register char n;
460: REQUEST(xCreatePixmapReq);
461:
462: swaps(&stuff->length, n);
463: swapl(&stuff->pid, n);
464: swapl(&stuff->drawable, n);
465: swaps(&stuff->width, n);
466: swaps(&stuff->height, n);
467: return((* ProcVector[X_CreatePixmap])(client));
468: }
469:
470: int
471: SProcCreateGC(client)
472: register ClientPtr client;
473: {
474: register char n;
475: REQUEST(xCreateGCReq);
476: swaps(&stuff->length, n);
477: swapl(&stuff->gc, n);
478: swapl(&stuff->drawable, n);
479: swapl(&stuff->mask, n);
480: SwapRestL(stuff);
481: return((* ProcVector[X_CreateGC])(client));
482: }
483:
484: int
485: SProcChangeGC(client)
486: register ClientPtr client;
487: {
488: register char n;
489: REQUEST(xChangeGCReq);
490: swaps(&stuff->length, n);
491: swapl(&stuff->gc, n);
492: swapl(&stuff->mask, n);
493: SwapRestL(stuff);
494: return((* ProcVector[X_ChangeGC])(client));
495: }
496:
497: int
498: SProcCopyGC(client)
499: register ClientPtr client;
500: {
501: register char n;
502: REQUEST(xCopyGCReq);
503: swaps(&stuff->length, n);
504: swapl(&stuff->srcGC, n);
505: swapl(&stuff->dstGC, n);
506: swapl(&stuff->mask, n);
507: return((* ProcVector[X_CopyGC])(client));
508: }
509:
510: int
511: SProcSetDashes(client)
512: register ClientPtr client;
513: {
514: register char n;
515: REQUEST(xSetDashesReq);
516: swaps(&stuff->length, n);
517: swapl(&stuff->gc, n);
518: swaps(&stuff->dashOffset, n);
519: swaps(&stuff->nDashes, n);
520: return((* ProcVector[X_SetDashes])(client));
521:
522: }
523:
524: int
525: SProcSetClipRectangles(client)
526: register ClientPtr client;
527: {
528: register char n;
529: REQUEST(xSetClipRectanglesReq);
530: swaps(&stuff->length, n);
531: swapl(&stuff->gc, n);
532: swaps(&stuff->xOrigin, n);
533: swaps(&stuff->yOrigin, n);
534: SwapRestS(stuff);
535: return((* ProcVector[X_SetClipRectangles])(client));
536: }
537:
538: int
539: SProcClearToBackground(client)
540: register ClientPtr client;
541: {
542: register char n;
543: REQUEST(xClearAreaReq);
544: swaps(&stuff->length, n);
545: swapl(&stuff->window, n);
546: swaps(&stuff->x, n);
547: swaps(&stuff->y, n);
548: swaps(&stuff->width, n);
549: swaps(&stuff->height, n);
550: return((* ProcVector[X_ClearArea])(client));
551: }
552:
553: int
554: SProcCopyArea(client)
555: register ClientPtr client;
556: {
557: register char n;
558: REQUEST(xCopyAreaReq);
559: swaps(&stuff->length, n);
560: swapl(&stuff->srcDrawable, n);
561: swapl(&stuff->dstDrawable, n);
562: swapl(&stuff->gc, n);
563: swaps(&stuff->srcX, n);
564: swaps(&stuff->srcY, n);
565: swaps(&stuff->dstX, n);
566: swaps(&stuff->dstY, n);
567: swaps(&stuff->width, n);
568: swaps(&stuff->height, n);
569: return((* ProcVector[X_CopyArea])(client));
570: }
571:
572: int
573: SProcCopyPlane(client)
574: register ClientPtr client;
575: {
576: register char n;
577: REQUEST(xCopyPlaneReq);
578: swaps(&stuff->length, n);
579: swapl(&stuff->srcDrawable, n);
580: swapl(&stuff->dstDrawable, n);
581: swapl(&stuff->gc, n);
582: swaps(&stuff->srcX, n);
583: swaps(&stuff->srcY, n);
584: swaps(&stuff->dstX, n);
585: swaps(&stuff->dstY, n);
586: swaps(&stuff->width, n);
587: swaps(&stuff->height, n);
588: swapl(&stuff->bitPlane, n);
589: return((* ProcVector[X_CopyPlane])(client));
590: }
591:
592: /* The following routine is used for all Poly drawing requests
593: (except FillPoly, which uses a different request format) */
594: int
595: SProcPoly(client)
596: register ClientPtr client;
597: {
598: register char n;
599:
600: REQUEST(xPolyPointReq);
601: swaps(&stuff->length, n);
602: swapl(&stuff->drawable, n);
603: swapl(&stuff->gc, n);
604: SwapRestS(stuff);
605: return((* ProcVector[stuff->reqType])(client));
606: }
607:
608: /* cannot use SProcPoly for this one, because xFillPolyReq
609: is longer than xPolyPointReq, and we don't want to swap
610: the difference as shorts! */
611: int
612: SProcFillPoly(client)
613: register ClientPtr client;
614: {
615: register char n;
616:
617: REQUEST(xFillPolyReq);
618: swaps(&stuff->length, n);
619: swapl(&stuff->drawable, n);
620: swapl(&stuff->gc, n);
621: SwapRestS(stuff);
622: return((* ProcVector[X_FillPoly])(client));
623: }
624:
625: int
626: SProcPutImage(client)
627: register ClientPtr client;
628: {
629: register char n;
630: REQUEST(xPutImageReq);
631: swaps(&stuff->length, n);
632: swapl(&stuff->drawable, n);
633: swapl(&stuff->gc, n);
634: swaps(&stuff->width, n);
635: swaps(&stuff->height, n);
636: swaps(&stuff->dstX, n);
637: swaps(&stuff->dstY, n);
638: /* Image should already be swapped */
639: return((* ProcVector[X_PutImage])(client));
640:
641: }
642:
643: int
644: SProcGetImage(client)
645: register ClientPtr client;
646: {
647: register char n;
648: REQUEST(xGetImageReq);
649: swaps(&stuff->length, n);
650: swapl(&stuff->drawable, n);
651: swaps(&stuff->x, n);
652: swaps(&stuff->y, n);
653: swaps(&stuff->width, n);
654: swaps(&stuff->height, n);
655: swapl(&stuff->planeMask, n);
656: return((* ProcVector[X_GetImage])(client));
657: }
658:
659: /* ProcPolyText used for both PolyText8 and PolyText16 */
660:
661: int
662: SProcPolyText(client)
663: register ClientPtr client;
664: {
665: register char n;
666: REQUEST(xPolyTextReq);
667: swaps(&stuff->length, n);
668: swapl(&stuff->drawable, n);
669: swapl(&stuff->gc, n);
670: swaps(&stuff->x, n);
671: swaps(&stuff->y, n);
672: return((* ProcVector[stuff->reqType])(client));
673: }
674:
675: /* ProcImageText used for both ImageText8 and ImageText16 */
676:
677: int
678: SProcImageText(client)
679: register ClientPtr client;
680: {
681: register char n;
682: REQUEST(xImageTextReq);
683: swaps(&stuff->length, n);
684: swapl(&stuff->drawable, n);
685: swapl(&stuff->gc, n);
686: swaps(&stuff->x, n);
687: swaps(&stuff->y, n);
688: return((* ProcVector[stuff->reqType])(client));
689: }
690:
691: int
692: SProcCreateColormap(client)
693: register ClientPtr client;
694: {
695: register char n;
696: REQUEST(xCreateColormapReq);
697: swaps(&stuff->length, n);
698: swapl(&stuff->mid, n);
699: swapl(&stuff->window, n);
700: swapl(&stuff->visual, n);
701: return((* ProcVector[X_CreateColormap])(client));
702: }
703:
704:
705: int
706: SProcCopyColormapAndFree(client)
707: register ClientPtr client;
708: {
709: register char n;
710: REQUEST(xCopyColormapAndFreeReq);
711: swaps(&stuff->length, n);
712: swapl(&stuff->mid, n);
713: swapl(&stuff->srcCmap, n);
714: return((* ProcVector[X_CopyColormapAndFree])(client));
715:
716: }
717:
718: int
719: SProcAllocColor (client)
720: register ClientPtr client;
721: {
722: register char n;
723: REQUEST(xAllocColorReq);
724: swaps(&stuff->length, n);
725: swapl(&stuff->cmap, n);
726: swaps(&stuff->red, n);
727: swaps(&stuff->green, n);
728: swaps(&stuff->blue, n);
729: return((* ProcVector[X_AllocColor])(client));
730: }
731:
732: int
733: SProcAllocNamedColor (client)
734: register ClientPtr client;
735: {
736: register char n;
737:
738: REQUEST(xAllocNamedColorReq);
739: swaps(&stuff->length, n);
740: swapl(&stuff->cmap, n);
741: swaps(&stuff->nbytes, n);
742: return((* ProcVector[X_AllocNamedColor])(client));
743: }
744:
745: int
746: SProcAllocColorCells (client)
747: register ClientPtr client;
748: {
749: register char n;
750: REQUEST(xAllocColorCellsReq);
751: swaps(&stuff->length, n);
752: swapl(&stuff->cmap, n);
753: swaps(&stuff->colors, n);
754: swaps(&stuff->planes, n);
755: return((* ProcVector[X_AllocColorCells])(client));
756: }
757:
758: int
759: SProcAllocColorPlanes(client)
760: register ClientPtr client;
761: {
762: register char n;
763: REQUEST(xAllocColorPlanesReq);
764: swaps(&stuff->length, n);
765: swapl(&stuff->cmap, n);
766: swaps(&stuff->colors, n);
767: swaps(&stuff->red, n);
768: swaps(&stuff->green, n);
769: swaps(&stuff->blue, n);
770: return((* ProcVector[X_AllocColorPlanes])(client));
771: }
772:
773: int
774: SProcFreeColors (client)
775: register ClientPtr client;
776: {
777: register char n;
778: REQUEST(xFreeColorsReq);
779: swaps(&stuff->length, n);
780: swapl(&stuff->cmap, n);
781: swapl(&stuff->planeMask, n);
782: SwapRestL(stuff);
783: return((* ProcVector[X_FreeColors])(client));
784:
785: }
786:
787: int
788: SProcStoreColors (client)
789: register ClientPtr client;
790: {
791: register char n;
792: xColorItem *pItem;
793:
794: REQUEST(xStoreColorsReq);
795: swaps(&stuff->length, n);
796: swapl(&stuff->cmap, n);
797: pItem = (xColorItem *) &stuff[1];
798: for(n = 0; n < LengthRestB(stuff)/sizeof(xColorItem); n++)
799: SwapColorItem(pItem++);
800: return((* ProcVector[X_StoreColors])(client));
801: }
802:
803: int
804: SProcStoreNamedColor (client)
805: register ClientPtr client;
806: {
807: register char n;
808: REQUEST(xStoreNamedColorReq);
809: swaps(&stuff->length, n);
810: swapl(&stuff->cmap, n);
811: swapl(&stuff->pixel, n);
812: swaps(&stuff->nbytes, n);
813: return((* ProcVector[X_StoreNamedColor])(client));
814: }
815:
816: int
817: SProcQueryColors(client)
818: register ClientPtr client;
819: {
820: register char n;
821: REQUEST(xQueryColorsReq);
822: swaps(&stuff->length, n);
823: swapl(&stuff->cmap, n);
824: SwapRestL(stuff);
825: return((* ProcVector[X_QueryColors])(client));
826: }
827:
828: int
829: SProcLookupColor(client)
830: register ClientPtr client;
831: {
832: register char n;
833: REQUEST(xLookupColorReq);
834: swaps(&stuff->length, n);
835: swapl(&stuff->cmap, n);
836: swaps(&stuff->nbytes, n);
837: return((* ProcVector[X_LookupColor])(client));
838: }
839:
840: int
841: SProcCreateCursor( client)
842: register ClientPtr client;
843: {
844: register char n;
845: REQUEST(xCreateCursorReq);
846: swaps(&stuff->length, n);
847: swapl(&stuff->cid, n);
848: swapl(&stuff->source, n);
849: swapl(&stuff->mask, n);
850: swaps(&stuff->foreRed, n);
851: swaps(&stuff->foreGreen, n);
852: swaps(&stuff->foreBlue, n);
853: swaps(&stuff->backRed, n);
854: swaps(&stuff->backGreen, n);
855: swaps(&stuff->backBlue, n);
856: swaps(&stuff->x, n);
857: swaps(&stuff->y, n);
858: return((* ProcVector[X_CreateCursor])(client));
859: }
860:
861: int
862: SProcCreateGlyphCursor( client)
863: register ClientPtr client;
864: {
865: register char n;
866: REQUEST(xCreateGlyphCursorReq);
867: swaps(&stuff->length, n);
868: swapl(&stuff->cid, n);
869: swapl(&stuff->source, n);
870: swapl(&stuff->mask, n);
871: swaps(&stuff->sourceChar, n);
872: swaps(&stuff->maskChar, n);
873: swaps(&stuff->foreRed, n);
874: swaps(&stuff->foreGreen, n);
875: swaps(&stuff->foreBlue, n);
876: swaps(&stuff->backRed, n);
877: swaps(&stuff->backGreen, n);
878: swaps(&stuff->backBlue, n);
879: return((* ProcVector[X_CreateGlyphCursor])(client));
880: }
881:
882:
883: int
884: SProcRecolorCursor(client)
885: register ClientPtr client;
886: {
887: register char n;
888: REQUEST(xRecolorCursorReq);
889: swaps(&stuff->length, n);
890: swapl(&stuff->cursor, n);
891: swaps(&stuff->foreRed, n);
892: swaps(&stuff->foreGreen, n);
893: swaps(&stuff->foreBlue, n);
894: swaps(&stuff->backRed, n);
895: swaps(&stuff->backGreen, n);
896: swaps(&stuff->backBlue, n);
897: return((* ProcVector[X_RecolorCursor])(client));
898: }
899:
900: int
901: SProcQueryBestSize (client)
902: register ClientPtr client;
903: {
904: register char n;
905: REQUEST(xQueryBestSizeReq);
906: swaps(&stuff->length, n);
907: swapl(&stuff->drawable, n);
908: swaps(&stuff->width, n);
909: swaps(&stuff->height, n);
910: return((* ProcVector[X_QueryBestSize])(client));
911:
912: }
913:
914: int
915: SProcQueryExtension (client)
916: register ClientPtr client;
917: {
918: register char n;
919: REQUEST(xQueryExtensionReq);
920: swaps(&stuff->length, n);
921: swaps(&stuff->nbytes, n);
922: return((* ProcVector[X_QueryExtension])(client));
923: }
924:
925: int
926: SProcChangeKeyboardMapping (client)
927: register ClientPtr client;
928: {
929: register char n;
930: register long *p;
931: register int i, count;
932:
933: REQUEST(xChangeKeyboardMappingReq);
934: swaps(&stuff->length, n);
935: p = (long *)&stuff[1];
936: count = stuff->keyCodes * stuff->keySymsPerKeyCode;
937: for(i = 0; i < count; i++)
938: {
939: swapl(p, n);
940: p++;
941: }
942: return((* ProcVector[X_ChangeKeyboardMapping])(client));
943: }
944:
945:
946: int
947: SProcChangeKeyboardControl (client)
948: register ClientPtr client;
949: {
950: register char n;
951: REQUEST(xChangeKeyboardControlReq);
952: swaps(&stuff->length, n);
953: swapl(&stuff->mask, n);
954: SwapRestL(stuff);
955: return((* ProcVector[X_ChangeKeyboardControl])(client));
956: }
957:
958: int
959: SProcChangePointerControl (client)
960: register ClientPtr client;
961: {
962: register char n;
963: REQUEST(xChangePointerControlReq);
964: swaps(&stuff->length, n);
965: swaps(&stuff->accelNum, n);
966: swaps(&stuff->accelDenum, n);
967: swaps(&stuff->threshold, n);
968: return((* ProcVector[X_ChangePointerControl])(client));
969: }
970:
971:
972: int
973: SProcSetScreenSaver (client)
974: register ClientPtr client;
975: {
976: register char n;
977: REQUEST(xSetScreenSaverReq);
978: swaps(&stuff->length, n);
979: swaps(&stuff->timeout, n);
980: swaps(&stuff->interval, n);
981: return((* ProcVector[X_SetScreenSaver])(client));
982: }
983:
984: int
985: SProcChangeHosts(client)
986: register ClientPtr client;
987: {
988: register char n;
989:
990: REQUEST(xChangeHostsReq);
991: swaps(&stuff->length, n);
992: swaps(&stuff->hostLength, n);
993: return((* ProcVector[X_ChangeHosts])(client));
994:
995: }
996:
997: int SProcRotateProperties(client)
998: register ClientPtr client;
999: {
1000: register char n;
1001: REQUEST(xRotatePropertiesReq);
1002: swaps(&stuff->length, n);
1003: swapl(&stuff->window, n);
1004: swaps(&stuff->nAtoms, n);
1005: swaps(&stuff->nPositions, n);
1006: SwapRestL(stuff);
1007: return ((* ProcVector[X_RotateProperties])(client));
1008: }
1009:
1010: int SProcNoOperation(client)
1011: register ClientPtr client;
1012: {
1013: /* noop -- don't do anything */
1014: return(Success);
1015: }
1016:
1017: SwapTimecoord(pCoord)
1018: xTimecoord *pCoord;
1019: {
1020: register char n;
1021:
1022: swapl(&pCoord->time, n);
1023: swaps(&pCoord->x, n);
1024: swaps(&pCoord->y, n);
1025: }
1026:
1027:
1028: SwapRGB(prgb)
1029: xrgb *prgb;
1030: {
1031: register char n;
1032:
1033: swaps(&prgb->red, n);
1034: swaps(&prgb->green, n);
1035: swaps(&prgb->blue, n);
1036: }
1037:
1038: SwapColorItem(pItem)
1039: xColorItem *pItem;
1040: {
1041: register char n;
1042:
1043: swapl(&pItem->pixel, n);
1044: swaps(&pItem->red, n);
1045: swaps(&pItem->green, n);
1046: swaps(&pItem->blue, n);
1047: }
1048:
1049: SwapConnClientPrefix(pCCP)
1050: xConnClientPrefix *pCCP;
1051: {
1052: register char n;
1053:
1054: swaps(&pCCP->majorVersion, n);
1055: swaps(&pCCP->minorVersion, n);
1056: swaps(&pCCP->nbytesAuthProto, n);
1057: swaps(&pCCP->nbytesAuthString, n);
1058: }
1059:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.