#ifndef SERVERMD_H
#define SERVERMD_H 1
#ifdef __avr32__
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#endif
#ifdef __arm32__
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#define GLYPHPADBYTES 4
#endif
#if defined __hppa__
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#endif
#if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#endif
#if defined(__sh__)
#if defined(__BIG_ENDIAN__)
# define IMAGE_BYTE_ORDER MSBFirst
# define BITMAP_BIT_ORDER MSBFirst
# define GLYPHPADBYTES 4
#else
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#endif
#endif
#if defined(__m32r__)
#if defined(__BIG_ENDIAN__)
# define IMAGE_BYTE_ORDER MSBFirst
# define BITMAP_BIT_ORDER MSBFirst
# define GLYPHPADBYTES 4
#else
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#endif
#endif
#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \
(defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
defined(__sparc__) || defined(__mc68000__)
#if defined(__sparc) || defined(__sparc__)
# if !defined(sparc)
# define sparc 1
# endif
#endif
#if defined(sun386) || defined(sun5)
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
#else
# define IMAGE_BYTE_ORDER MSBFirst
# define BITMAP_BIT_ORDER MSBFirst
#endif
#define GLYPHPADBYTES 4
#endif
#if defined(ibm032) || defined (ibm)
#ifdef __i386__
# define IMAGE_BYTE_ORDER LSBFirst
#else
# define IMAGE_BYTE_ORDER MSBFirst
#endif
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 1
#ifdef __i386__
#define BITMAP_SCANLINE_UNIT 8
#endif
#endif
#if (defined(mips) || defined(__mips))
#if defined(MIPSEL) || defined(__MIPSEL__)
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#else
# define IMAGE_BYTE_ORDER MSBFirst
# define BITMAP_BIT_ORDER MSBFirst
# define GLYPHPADBYTES 4
#endif
#endif
#if defined(__alpha) || defined(__alpha__)
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#endif
#if defined (linux) && defined (__s390__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#define BITMAP_SCANLINE_UNIT 8
#define FAST_UNALIGNED_READ
#endif
#if defined (linux) && defined (__s390x__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#define BITMAP_SCANLINE_UNIT 8
#define FAST_UNALIGNED_READ
#endif
#if defined(__ia64__) || defined(ia64)
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#endif
#if defined(__amd64__) || defined(amd64) || defined(__amd64)
# define IMAGE_BYTE_ORDER LSBFirst
# define BITMAP_BIT_ORDER LSBFirst
# define GLYPHPADBYTES 4
#endif
#if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \
defined(__alpha__) || defined(__alpha) || \
defined(__i386__) || \
defined(__s390x__) || defined(__s390__)
#ifndef IMAGE_BYTE_ORDER
#define IMAGE_BYTE_ORDER LSBFirst
#endif
#ifndef BITMAP_BIT_ORDER
# define BITMAP_BIT_ORDER LSBFirst
#endif
#ifndef GLYPHPADBYTES
#define GLYPHPADBYTES 4
#endif
#endif
#if defined (linux) && defined (__mc68000__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#endif
#if defined(linux) && defined(__arm__)
#define IMAGE_BYTE_ORDER LSBFirst
#define BITMAP_BIT_ORDER LSBFirst
#define GLYPHPADBYTES 4
#endif
#if defined (linux) && defined (__s390__)
#define IMAGE_BYTE_ORDER MSBFirst
#define BITMAP_BIT_ORDER MSBFirst
#define GLYPHPADBYTES 4
#endif
#ifndef IMAGE_BUFSIZE
#define IMAGE_BUFSIZE (64*1024)
#endif
#ifndef BITMAP_SCANLINE_UNIT
#define BITMAP_SCANLINE_UNIT 32
#endif
#ifndef BITMAP_SCANLINE_PAD
#define BITMAP_SCANLINE_PAD 32
#define LOG2_BITMAP_PAD 5
#define LOG2_BYTES_PER_SCANLINE_PAD 2
#endif
typedef struct _PaddingInfo {
int padRoundUp;
int padPixelsLog2;
int padBytesLog2;
int notPower2;
int bytesPerPixel;
int bitsPerPixel;
} PaddingInfo;
extern PaddingInfo PixmapWidthPaddingInfo[];
#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
#define PixmapWidthInPadUnits(w, d) \
(PixmapWidthPaddingInfo[d].notPower2 ? \
(((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
PixmapWidthPaddingInfo[d].padBytesLog2) : \
((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
PixmapWidthPaddingInfo[d].padPixelsLog2))
#define PixmapBytePad(w, d) \
(PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
#define BitmapBytePad(w) \
(((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
#define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
#define BitmapBytePadProto(w) BitmapBytePad(w)
#endif