home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / extensions / server / PEX / include / SwapConv.ci < prev    next >
Encoding:
Text File  |  1991-02-15  |  3.8 KB  |  112 lines

  1. /* $XConsortium: SwapConv.ci,v 5.2 91/02/16 09:57:46 rws Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
  5.  
  6.                         All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the names of Sun Microsystems,
  13. the X Consortium, and MIT not be used in advertising or publicity 
  14. pertaining to distribution of the software without specific, written 
  15. prior permission.  
  16.  
  17. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
  18. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  19. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  20. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. /* 
  28.  * SwapConv.ci - defines macros used by ByteSwappingUnpackRoutines.
  29.  * 
  30.  * Copyright 1988-1991
  31.  * Center for Information Technology Integration (CITI)
  32.  * Information Technology Division
  33.  * University of Michigan
  34.  * Ann Arbor, Michigan
  35.  *
  36.  *                         All Rights Reserved
  37.  * 
  38.  * Permission to use, copy, modify, and distribute this software and
  39.  * its documentation for any purpose and without fee is hereby
  40.  * granted, provided that the above copyright notice appear in all
  41.  * copies and that both that copyright notice and this permission
  42.  * notice appear in supporting documentation, and that the names of
  43.  * CITI or THE UNIVERSITY OF MICHIGAN not be used in advertising or
  44.  * publicity pertaining to distribution of the software without
  45.  * specific, written prior permission.
  46.  * 
  47.  * THE SOFTWARE IS PROVIDED "AS IS." CITI AND THE UNIVERSITY OF
  48.  * MICHIGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  49.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  50.  * NO EVENT SHALL CITI OR THE UNIVERSITY OF MICHIGAN BE LIABLE FOR ANY
  51.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  52.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  53.  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  54.  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  55.  * SOFTWARE.
  56.  */
  57.  
  58. /*
  59.  * Here we want to float convert AND byte swap
  60.  * the packet.  Operators are defined accordingly.
  61.  */
  62.  
  63. #ifdef SWAP_FUNC_PREFIX
  64. #undef SWAP_FUNC_PREFIX    
  65. #undef SWAP_FUNC_PEX_PFX    
  66. #undef NO_FLOATS    
  67. #undef NO_CONVERSIONS     
  68. #undef NO_SWAP
  69. #undef SWAPINT_C
  70. #undef SWAPSHORT_C
  71. #undef SWAPFLOAT_C
  72.  
  73. #undef pSWAPINT_C
  74. #undef pSWAPSHORT_C
  75. #undef pSWAPFLOAT_C
  76.  
  77. #undef SWAPFLOAT
  78. #undef SWAPSHORT
  79. #undef SWAPINT
  80.  
  81. #undef pSWAPFLOAT
  82. #undef pSWAPSHORT
  83. #undef pSWAPINT
  84. #endif
  85.  
  86. #if defined (__STDC__)
  87. #define SWAP_FUNC_PREFIX(nm)    sf##nm
  88. #define SWAP_FUNC_PEX_PFX(nm)    sfPEX##nm
  89. #else
  90. #define SWAP_FUNC_PREFIX(nm)    sf/**/nm
  91. #define SWAP_FUNC_PEX_PFX(nm)    sfPEX/**/nm
  92. #endif
  93.  
  94. #define NO_CONVERSIONS     0
  95. #define NO_FLOATS     0
  96. #define NO_SWAP        0
  97. #define SWAPINT_C(x,y)     swaplongc(x,y)
  98. #define SWAPSHORT_C(x,y) swapshortc(x,y)
  99. #define SWAPFLOAT_C(x,y) swapConvFloatc(x,y)
  100.  
  101. #define SWAPFLOAT(x,n)    swapConvFloat(x,n)
  102. #define SWAPSHORT(x,n)    swapshort(x,n)
  103. #define SWAPINT(x,n)    swaplong(x,n)
  104.  
  105. #define pSWAPINT_C(x,y)      pswaplongc(x,y)
  106. #define pSWAPSHORT_C(x,y) pswapshortc(x,y)
  107. #define pSWAPFLOAT_C(x,y) pswapConvFloatc(x,y)
  108.  
  109. #define pSWAPFLOAT(x,n)    pswapConvFloat(x,n)
  110. #define pSWAPSHORT(x,n)    pswapshort(x,n)
  111. #define pSWAPINT(x,n)    pswaplong(x,n)
  112.