ocssw  1.0
Defines | Typedefs | Functions | Variables
/disk01/web/ocssw/build/src/l2gen/misc.h File Reference

(r8090/r2592)

#include <stdint.h>
#include "Xosdefs.h"
#include <stddef.h>
#include "Xfuncs.h"

Go to the source code of this file.

Defines

#define MAXSCREENS   3
#define MAXCLIENTS   128
#define MAXFORMATS   8
#define MAXVISUALS_PER_SCREEN   50
#define NullBox   ((BoxPtr)0)
#define MILLI_PER_MIN   (1000 * 60)
#define MILLI_PER_SECOND   (1000)
#define USE_BACKGROUND_PIXEL   3
#define USE_BORDER_PIXEL   3
#define lswapl(x)
#define lswaps(x)   ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
#define min(a, b)   (((a) < (b)) ? (a) : (b))
#define max(a, b)   (((a) > (b)) ? (a) : (b))
#define sign(x)   ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
#define modulus(a, b, d)   if (((d) = (a) % (b)) < 0) (d) += (b)
#define lowbit(x)   ((x) & (~(x) + 1))
#define MAXSHORT   32767
#define MINSHORT   -MAXSHORT
#define LengthRestB(stuff)   (((uint32_t)stuff->length << 2) - sizeof(*stuff))
#define LengthRestS(stuff)   (((uint32_t)stuff->length << 1) - (sizeof(*stuff) >> 1))
#define LengthRestL(stuff)   ((uint32_t)stuff->length - (sizeof(*stuff) >> 2))
#define SwapRestS(stuff)   SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
#define SwapRestL(stuff)   SwapLongs((int32_t *)(stuff + 1), LengthRestL(stuff))
#define swapl(x, n)
#define swaps(x, n)
#define cpswapl(src, dst)
#define cpswaps(src, dst)

Typedefs

typedef unsigned char * pointer
typedef int Bool
typedef uint32_t PIXEL
typedef uint32_t ATOM
typedef struct _DDXPoint * DDXPointPtr
typedef struct _Box * BoxPtr

Functions

void SwapLongs ()
void SwapShorts ()

Variables

uint32_t globalSerialNumber
uint32_t serverGeneration

Define Documentation

#define cpswapl (   src,
  dst 
)
Value:
((char *)&(dst))[0] = ((char *) &(src))[3];\
                 ((char *)&(dst))[1] = ((char *) &(src))[2];\
                 ((char *)&(dst))[2] = ((char *) &(src))[1];\
                 ((char *)&(dst))[3] = ((char *) &(src))[0];

Definition at line 142 of file misc.h.

#define cpswaps (   src,
  dst 
)
Value:
((char *) &(dst))[0] = ((char *) &(src))[1];\
         ((char *) &(dst))[1] = ((char *) &(src))[0];

Definition at line 149 of file misc.h.

#define LengthRestB (   stuff)    (((uint32_t)stuff->length << 2) - sizeof(*stuff))

Definition at line 113 of file misc.h.

#define LengthRestL (   stuff)    ((uint32_t)stuff->length - (sizeof(*stuff) >> 2))

Definition at line 119 of file misc.h.

#define LengthRestS (   stuff)    (((uint32_t)stuff->length << 1) - (sizeof(*stuff) >> 1))

Definition at line 116 of file misc.h.

#define lowbit (   x)    ((x) & (~(x) + 1))

Definition at line 105 of file misc.h.

#define lswapl (   x)
Value:
((((x) & 0xff) << 24) |\
           (((x) & 0xff00) << 8) |\
           (((x) & 0xff0000) >> 8) |\
           (((x) >> 24) & 0xff))

Definition at line 79 of file misc.h.

#define lswaps (   x)    ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))

Definition at line 85 of file misc.h.

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 88 of file misc.h.

#define MAXCLIENTS   128

Definition at line 50 of file misc.h.

#define MAXFORMATS   8

Definition at line 51 of file misc.h.

#define MAXSCREENS   3

Definition at line 49 of file misc.h.

#define MAXSHORT   32767

Definition at line 107 of file misc.h.

#define MAXVISUALS_PER_SCREEN   50

Definition at line 52 of file misc.h.

#define MILLI_PER_MIN   (1000 * 60)

Definition at line 67 of file misc.h.

#define MILLI_PER_SECOND   (1000)

Definition at line 68 of file misc.h.

#define min (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 87 of file misc.h.

#define MINSHORT   -MAXSHORT

Definition at line 108 of file misc.h.

#define modulus (   a,
  b,
 
)    if (((d) = (a) % (b)) < 0) (d) += (b)

Definition at line 97 of file misc.h.

#define NullBox   ((BoxPtr)0)

Definition at line 66 of file misc.h.

#define sign (   x)    ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))

Definition at line 95 of file misc.h.

#define swapl (   x,
 
)
Value:
n = ((char *) (x))[0];\
         ((char *) (x))[0] = ((char *) (x))[3];\
         ((char *) (x))[3] = n;\
         n = ((char *) (x))[1];\
         ((char *) (x))[1] = ((char *) (x))[2];\
         ((char *) (x))[2] = n;

Definition at line 129 of file misc.h.

#define SwapRestL (   stuff)    SwapLongs((int32_t *)(stuff + 1), LengthRestL(stuff))

Definition at line 125 of file misc.h.

#define SwapRestS (   stuff)    SwapShorts((short *)(stuff + 1), LengthRestS(stuff))

Definition at line 122 of file misc.h.

#define swaps (   x,
 
)
Value:
n = ((char *) (x))[0];\
         ((char *) (x))[0] = ((char *) (x))[1];\
         ((char *) (x))[1] = n

Definition at line 137 of file misc.h.

#define USE_BACKGROUND_PIXEL   3

Definition at line 74 of file misc.h.

#define USE_BORDER_PIXEL   3

Definition at line 75 of file misc.h.


Typedef Documentation

typedef uint32_t ATOM

Definition at line 57 of file misc.h.

typedef int Bool

Definition at line 55 of file misc.h.

typedef struct _Box* BoxPtr

Definition at line 157 of file misc.h.

typedef struct _DDXPoint* DDXPointPtr

Definition at line 156 of file misc.h.

typedef uint32_t PIXEL

Definition at line 56 of file misc.h.

typedef unsigned char* pointer

Definition at line 54 of file misc.h.


Function Documentation

void SwapLongs ( )
void SwapShorts ( )

Variable Documentation

uint32_t serverGeneration