#include <stdio.h>
#include "misc.h"
#include "assert.h"
#include "lbx.h"
#include "swap.h"
void
SwapLongs(list, count)
register CARD32 *list;
register unsigned long count;
{
register char n;
while (count >= 8) {
swapl(list + 0, n);
swapl(list + 1, n);
swapl(list + 2, n);
swapl(list + 3, n);
swapl(list + 4, n);
swapl(list + 5, n);
swapl(list + 6, n);
swapl(list + 7, n);
list += 8;
count -= 8;
}
if (count != 0) {
do {
swapl(list, n);
list++;
} while (--count != 0);
}
}
void
SwapShorts(list, count)
register short *list;
register unsigned long count;
{
register char n;
while (count >= 16) {
swaps(list + 0, n);
swaps(list + 1, n);
swaps(list + 2, n);
swaps(list + 3, n);
swaps(list + 4, n);
swaps(list + 5, n);
swaps(list + 6, n);
swaps(list + 7, n);
swaps(list + 8, n);
swaps(list + 9, n);
swaps(list + 10, n);
swaps(list + 11, n);
swaps(list + 12, n);
swaps(list + 13, n);
swaps(list + 14, n);
swaps(list + 15, n);
list += 16;
count -= 16;
}
if (count != 0) {
do {
swaps(list, n);
list++;
} while (--count != 0);
}
}
void
SwapConnClientPrefix(pCCP)
xConnClientPrefix *pCCP;
{
register char n;
swaps(&pCCP->majorVersion, n);
swaps(&pCCP->minorVersion, n);
swaps(&pCCP->nbytesAuthProto, n);
swaps(&pCCP->nbytesAuthString, n);
}
void
SwapNewClient(r)
xLbxNewClientReq *r;
{
char n;
swapl(&r->client, n);
}
void
SwapCloseClient(r)
xLbxCloseClientReq *r;
{
char n;
swapl(&r->client, n);
}
void
SwapModifySequence(r)
xLbxModifySequenceReq *r;
{
char n;
swapl(&r->adjust, n);
}
void
SwapIncrementPixel(r)
xLbxIncrementPixelReq *r;
{
char n;
swapl(&r->cmap, n);
swapl(&r->pixel, n);
}
void
SwapGetModifierMapping(r)
xLbxGetModifierMappingReq *r;
{
}
void
SwapGetKeyboardMapping(r)
xLbxGetKeyboardMappingReq *r;
{
}
void
SwapQueryFont(r)
xLbxQueryFontReq *r;
{
char n;
swapl(&r->fid, n);
}
void
SwapChangeProperty(r)
xLbxChangePropertyReq *r;
{
char n;
swapl(&r->window, n);
swapl(&r->property, n);
swapl(&r->type, n);
swapl(&r->nUnits, n);
}
void
SwapGetProperty(r)
xLbxGetPropertyReq *r;
{
char n;
swapl(&r->window, n);
swapl(&r->property, n);
swapl(&r->type, n);
swapl(&r->longOffset, n);
swapl(&r->longLength, n);
}
void
SwapGetImage (r)
xLbxGetImageReq *r;
{
char n;
swapl(&r->drawable, n);
swaps(&r->x, n);
swaps(&r->y, n);
swaps(&r->width, n);
swaps(&r->height, n);
swapl(&r->planeMask, n);
}
void
SwapInternAtoms(r)
xLbxInternAtomsReq *r;
{
char n;
char *ptr;
char lenbuf[2];
CARD16 len;
int i;
ptr = (char *) r + sz_xLbxInternAtomsReq;
for (i = 0; i < r->num; i++)
{
lenbuf[0] = ptr[0];
lenbuf[1] = ptr[1];
len = *((CARD16 *) lenbuf);
swaps (ptr, n);
ptr += (len + 2);
}
swaps(&r->num, n);
}
void
SwapInvalidateTag(r)
xLbxInvalidateTagReq *r;
{
char n;
swapl(&r->tag, n);
}
void
SwapTagData(r)
xLbxTagDataReq *r;
{
char n;
swapl(&r->real_length, n);
swapl(&r->tag, n);
}
void
SwapQueryExtension(r)
xLbxQueryExtensionReq *r;
{
char n;
swapl(&r->nbytes, n);
}
void
SwapLbxConnSetupPrefix(csp)
xLbxConnSetupPrefix *csp;
{
char n;
swaps(&csp->majorVersion, n);
swaps(&csp->minorVersion, n);
swapl(&csp->tag, n);
}
void
SwapAllocColor(r)
xLbxAllocColorReq *r;
{
char n;
swapl(&r->cmap, n);
swapl(&r->pixel, n);
swaps(&r->red, n);
swaps(&r->green, n);
swaps(&r->blue, n);
}
void
SwapGrabCmap(r)
xLbxGrabCmapReq *r;
{
char n;
swapl(&r->cmap, n);
}
void
SwapReleaseCmap(r)
xLbxReleaseCmapReq *r;
{
char n;
swapl(&r->cmap, n);
}