ReactOS 0.4.15-dev-7934-g1dc8d80
tools.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  _FOUR_BYTE
 

Macros

#define AcquireXLock(gLock, oldValue, newValue)
 
#define MOV_DD_SWP(a, b)
 
#define MOV_DW_SWP(a, b)
 
#define REVERSE_DD(a)
 
#define REVERSE_DW(a)
 
#define MOV_DW2DD_SWP(a, b)
 
#define MOV_MSF(a, b)
 
#define MOV_MSF_SWP(a, b)
 
#define XCHG_DD(a, b)
 
#define CONV_TO_LL(a)   a.Byte0 | a.Byte1 << 8 | a.Byte2 << 16 | a.Byte3 << 8
 
#define MSF_TO_LBA(Minutes, Seconds, Frames)    (ULONG)((60 * 75 * (Minutes)) + (75 * (Seconds)) + ((Frames) - 150))
 
#define PacketFixed2Variable(x, ps)   ( ( ( (x) / (ps) ) * (ps+7) ) + ( (x) & (ps-1) ) )
 
#define PacketVariable2Fixed(x, ps)   ( ( ( (x) / (ps+7) ) * (ps) ) + ( (((x) % (ps+7)) < (ps)) ? ((x) % (ps+7)) : (ps-1) ) )
 
#define WAIT_FOR_XXX_EMU_DELAY   1000LL
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define min(a, b)   (((a) < (b)) ? (a) : (b))
 
#define offsetof(type, field)   (ULONG)&(((type *)0)->field)
 

Typedefs

typedef struct _FOUR_BYTE FOUR_BYTE
 
typedef struct _FOUR_BYTEPFOUR_BYTE
 

Macro Definition Documentation

◆ AcquireXLock

#define AcquireXLock (   gLock,
  oldValue,
  newValue 
)
Value:
{ \
oldValue = gLock; \
gLock = newValue; \
}

Definition at line 185 of file tools.h.

◆ CONV_TO_LL

#define CONV_TO_LL (   a)    a.Byte0 | a.Byte1 << 8 | a.Byte2 << 16 | a.Byte3 << 8

Definition at line 268 of file tools.h.

◆ max

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

Definition at line 277 of file tools.h.

◆ min

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

Definition at line 278 of file tools.h.

◆ MOV_DD_SWP

#define MOV_DD_SWP (   a,
  b 
)
Value:
{ \
PFOUR_BYTE _from_, _to_; \
_from_ = ((PFOUR_BYTE)&(b)); \
_to_ = ((PFOUR_BYTE)&(a)); \
_to_->Byte0 = _from_->Byte3; \
_to_->Byte1 = _from_->Byte2; \
_to_->Byte2 = _from_->Byte1; \
_to_->Byte3 = _from_->Byte0; \
}
struct _FOUR_BYTE * PFOUR_BYTE
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
UCHAR Byte0
Definition: tools.h:16
UCHAR Byte1
Definition: tools.h:17
UCHAR Byte2
Definition: tools.h:18
UCHAR Byte3
Definition: tools.h:19

Definition at line 191 of file tools.h.

◆ MOV_DW2DD_SWP

#define MOV_DW2DD_SWP (   a,
  b 
)
Value:
{ \
PFOUR_BYTE _from_, _to_; \
_from_ = ((PFOUR_BYTE)&(b)); \
_to_ = ((PFOUR_BYTE)&(a)); \
*((PUSHORT)_to_) = 0; \
_to_->Byte2 = _from_->Byte1; \
_to_->Byte3 = _from_->Byte0; \
}
uint16_t * PUSHORT
Definition: typedefs.h:56

Definition at line 223 of file tools.h.

◆ MOV_DW_SWP

#define MOV_DW_SWP (   a,
  b 
)
Value:
{ \
PFOUR_BYTE _from_, _to_; \
_from_ = ((PFOUR_BYTE)&(b)); \
_to_ = ((PFOUR_BYTE)&(a)); \
_to_->Byte0 = _from_->Byte1; \
_to_->Byte1 = _from_->Byte0; \
}

Definition at line 202 of file tools.h.

◆ MOV_MSF

#define MOV_MSF (   a,
  b 
)
Value:
{ \
PFOUR_BYTE _from_, _to_; \
_from_ = ((PFOUR_BYTE)&(b)); \
_to_ = ((PFOUR_BYTE)&(a)); \
_to_->Byte0 = _from_->Byte0; \
_to_->Byte1 = _from_->Byte1; \
_to_->Byte2 = _from_->Byte2; \
}

Definition at line 233 of file tools.h.

◆ MOV_MSF_SWP

#define MOV_MSF_SWP (   a,
  b 
)
Value:
{ \
PFOUR_BYTE _from_, _to_; \
_from_ = ((PFOUR_BYTE)&(b)); \
_to_ = ((PFOUR_BYTE)&(a)); \
_to_->Byte0 = _from_->Byte2; \
_to_->Byte1 = _from_->Byte1; \
_to_->Byte2 = _from_->Byte0; \
}

Definition at line 243 of file tools.h.

◆ MSF_TO_LBA

#define MSF_TO_LBA (   Minutes,
  Seconds,
  Frames 
)     (ULONG)((60 * 75 * (Minutes)) + (75 * (Seconds)) + ((Frames) - 150))

Definition at line 269 of file tools.h.

◆ offsetof

#define offsetof (   type,
  field 
)    (ULONG)&(((type *)0)->field)

Definition at line 281 of file tools.h.

◆ PacketFixed2Variable

#define PacketFixed2Variable (   x,
  ps 
)    ( ( ( (x) / (ps) ) * (ps+7) ) + ( (x) & (ps-1) ) )

Definition at line 272 of file tools.h.

◆ PacketVariable2Fixed

#define PacketVariable2Fixed (   x,
  ps 
)    ( ( ( (x) / (ps+7) ) * (ps) ) + ( (((x) % (ps+7)) < (ps)) ? ((x) % (ps+7)) : (ps-1) ) )

Definition at line 273 of file tools.h.

◆ REVERSE_DD

#define REVERSE_DD (   a)
Value:
{ \
ULONG _i_; \
MOV_DD_SWP(_i_,(a)); \
*((PULONG)&(a)) = _i_; \
}
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59

Definition at line 211 of file tools.h.

◆ REVERSE_DW

#define REVERSE_DW (   a)
Value:
{ \
USHORT _i_; \
MOV_DW_SWP(_i_,(a)); \
*((PUSHORT)&(a)) = _i_; \
}
unsigned short USHORT
Definition: pedump.c:61

Definition at line 217 of file tools.h.

◆ WAIT_FOR_XXX_EMU_DELAY

#define WAIT_FOR_XXX_EMU_DELAY   1000LL

Definition at line 275 of file tools.h.

◆ XCHG_DD

#define XCHG_DD (   a,
  b 
)
Value:
{ \
ULONG _temp_; \
PULONG _from_, _to_; \
_from_ = ((PULONG)&(b)); \
_to_ = ((PULONG)&(a)); \
_temp_ = *_from_; \
*_from_ = *_to_; \
*_to_ = _temp_; \
}

Definition at line 253 of file tools.h.

Typedef Documentation

◆ FOUR_BYTE

◆ PFOUR_BYTE