diff options
Diffstat (limited to 'difs/swaprep.c')
-rw-r--r-- | difs/swaprep.c | 215 |
1 files changed, 125 insertions, 90 deletions
diff --git a/difs/swaprep.c b/difs/swaprep.c index b5ed328..07981aa 100644 --- a/difs/swaprep.c +++ b/difs/swaprep.c @@ -46,18 +46,21 @@ in this Software without prior written authorization from The Open Group. * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF * THIS SOFTWARE. */ +/* $XFree86: xc/programs/xfs/difs/swaprep.c,v 1.5 2001/12/14 20:01:35 dawes Exp $ */ + +#include <swaprep.h> +#include <swapreq.h> #include "FSproto.h" #include "clientstr.h" -#include "misc.h" -static void SwapConnSetupAccept(); +static void SwapConnSetupAccept(fsConnSetupAccept *pConnSetup, fsConnSetupAccept *pConnSetupT); void -Swap32Write(client, size, pbuf) - ClientPtr client; - int size; - long *pbuf; +Swap32Write( + ClientPtr client, + int size, + long *pbuf) { int n, i; @@ -70,10 +73,10 @@ Swap32Write(client, size, pbuf) } void -Swap16Write(client, size, pbuf) - ClientPtr client; - int size; - short *pbuf; +Swap16Write( + ClientPtr client, + int size, + short *pbuf) { int n, i; @@ -85,10 +88,11 @@ Swap16Write(client, size, pbuf) (void) WriteToClient(client, size << 1, (char *) pbuf); } -CopySwap32Write(client, size, pbuf) - ClientPtr client; - int size; - long *pbuf; +void +CopySwap32Write( + ClientPtr client, + int size, + long *pbuf) { int bufsize = size; long *pbufT; @@ -134,10 +138,10 @@ CopySwap32Write(client, size, pbuf) } void -CopySwap16Write(client, size, pbuf) - ClientPtr client; - int size; - short *pbuf; +CopySwap16Write( + ClientPtr client, + int size, + short *pbuf) { int bufsize = size; short *pbufT; @@ -184,33 +188,44 @@ CopySwap16Write(client, size, pbuf) DEALLOCATE_LOCAL((char *) pbufT); } + +#undef pRep +#define pRep ((fsGenericReply *)data) + void -SGenericReply(client, size, pRep) - ClientPtr client; - int size; - fsGenericReply *pRep; +SGenericReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); (void) WriteToClient(client, size, (char *) pRep); } + +#undef pRep +#define pRep ((fsListExtensionsReply *)data) + void -SListExtensionsReply(client, size, pRep) - ClientPtr client; - int size; - fsListExtensionsReply *pRep; +SListExtensionsReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsQueryExtensionReply *)data) + void -SQueryExtensionReply(client, size, pRep) - ClientPtr client; - int size; - fsQueryExtensionReply *pRep; +SQueryExtensionReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -219,11 +234,14 @@ SQueryExtensionReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsListCataloguesReply *)data) + void -SListCataloguesReply(client, size, pRep) - ClientPtr client; - int size; - fsListCataloguesReply *pRep; +SListCataloguesReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -232,11 +250,14 @@ SListCataloguesReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsCreateACReply *)data) + void -SCreateACReply(client, size, pRep) - ClientPtr client; - int size; - fsCreateACReply *pRep; +SCreateACReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -244,11 +265,14 @@ SCreateACReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsGetEventMaskReply *)data) + void -SGetEventMaskReply(client, size, pRep) - ClientPtr client; - int size; - fsGetEventMaskReply *pRep; +SGetEventMaskReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -256,22 +280,28 @@ SGetEventMaskReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsGetResolutionReply *)data) + void -SGetResolutionReply(client, size, pRep) - ClientPtr client; - int size; - fsGetResolutionReply *pRep; +SGetResolutionReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsListFontsReply *)data) + void -SListFontsReply(client, size, pRep) - ClientPtr client; - int size; - fsListFontsReply *pRep; +SListFontsReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -300,11 +330,14 @@ SListFontsReply(client, size, pRep) reply->font_header_font_ascent = lswaps(reply->font_header_font_ascent); \ reply->font_header_font_descent = lswaps(reply->font_header_font_descent) +#undef pRep +#define pRep ((fsListFontsWithXInfoReply *)data) + void -SListFontsWithXInfoReply(client, size, pRep) - ClientPtr client; - int size; - fsListFontsWithXInfoReply *pRep; +SListFontsWithXInfoReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -315,11 +348,14 @@ SListFontsWithXInfoReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsOpenBitmapFontReply *)data) + void -SOpenBitmapFontReply(client, size, pRep) - ClientPtr client; - int size; - fsOpenBitmapFontReply *pRep; +SOpenBitmapFontReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -328,11 +364,14 @@ SOpenBitmapFontReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsQueryXInfoReply *)data) + void -SQueryXInfoReply(client, size, pRep) - ClientPtr client; - int size; - fsQueryXInfoReply *pRep; +SQueryXInfoReply( + ClientPtr client, + int size, + void * data) { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -340,11 +379,14 @@ SQueryXInfoReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsQueryXExtents8Reply *)data) + void -SQueryXExtentsReply(client, size, pRep) - ClientPtr client; - int size; - fsQueryXExtents8Reply *pRep; /* QueryXExtents16Reply is the same */ +SQueryXExtentsReply( + ClientPtr client, + int size, + void * data) /* QueryXExtents16Reply is the same */ { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -352,11 +394,14 @@ SQueryXExtentsReply(client, size, pRep) (void) WriteToClient(client, size, (char *) pRep); } +#undef pRep +#define pRep ((fsQueryXBitmaps8Reply *)data) + void -SQueryXBitmapsReply(client, size, pRep) - ClientPtr client; - int size; - fsQueryXBitmaps8Reply *pRep; /* QueryXBitmaps16Reply is the same */ +SQueryXBitmapsReply( + ClientPtr client, + int size, + void * data) /* QueryXBitmaps16Reply is the same */ { pRep->sequenceNumber = lswaps(pRep->sequenceNumber); pRep->length = lswapl(pRep->length); @@ -367,9 +412,7 @@ SQueryXBitmapsReply(client, size, pRep) } void -SErrorEvent(error, perror) - fsError *error, - *perror; +SErrorEvent(fsError *error, fsError *perror) { *perror = *error; perror->sequenceNumber = lswaps(perror->sequenceNumber); @@ -378,10 +421,10 @@ SErrorEvent(error, perror) } void -WriteSConnectionInfo(client, size, pInfo) - ClientPtr client; - unsigned long size; - char *pInfo; +WriteSConnectionInfo( + ClientPtr client, + unsigned long size, + char *pInfo) { char *pInfoT, *pInfoTBase; @@ -405,9 +448,7 @@ WriteSConnectionInfo(client, size, pInfo) } static void -SwapConnSetupAccept(pConnSetup, pConnSetupT) - fsConnSetupAccept *pConnSetup, - *pConnSetupT; +SwapConnSetupAccept(fsConnSetupAccept *pConnSetup, fsConnSetupAccept *pConnSetupT) { pConnSetupT->length = lswapl(pConnSetup->length); pConnSetupT->max_request_len = lswaps(pConnSetup->max_request_len); @@ -416,9 +457,7 @@ SwapConnSetupAccept(pConnSetup, pConnSetupT) } void -WriteSConnSetup(client, pcsp) - ClientPtr client; - fsConnSetup *pcsp; +WriteSConnSetup(ClientPtr client, fsConnSetup *pcsp) { fsConnSetup cspT; @@ -433,8 +472,7 @@ WriteSConnSetup(client, pcsp) } static void -SwapPropOffset(po) - char *po; +SwapPropOffset(char *po) { int i, n; @@ -446,8 +484,7 @@ SwapPropOffset(po) } void -SwapPropInfo(pi) - fsPropInfo *pi; +SwapPropInfo(fsPropInfo *pi) { int i; char *po; @@ -464,9 +501,7 @@ SwapPropInfo(pi) } void -SwapExtents(extents, num) - fsXCharInfo *extents; - int num; +SwapExtents(fsXCharInfo *extents, int num) { SwapShorts((short *)extents, num * (SIZEOF(fsXCharInfo) / 2)); } |