MIDAS
System Macros

Macros

#define WORD_SWAP(x)
 
#define DWORD_SWAP(x)
 
#define QWORD_SWAP(x)
 
#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define ABS(a)   (((a) < 0) ? -(a) : (a))
 
#define TELL(fh)   lseek(fh, 0, SEEK_CUR)
 
#define TRUNCATE(fh)   ftruncate(fh, TELL(fh))
 

Detailed Description

dox dox


dox


Macro Definition Documentation

◆ ABS

#define ABS (   a)    (((a) < 0) ? -(a) : (a))

Definition at line 239 of file msystem.h.

◆ DWORD_SWAP

#define DWORD_SWAP (   x)
Value:
{ BYTE _tmp; \
_tmp= *((BYTE *)(x)); \
*((BYTE *)(x)) = *(((BYTE *)(x))+3); \
*(((BYTE *)(x))+3) = _tmp; \
_tmp= *(((BYTE *)(x))+1); \
*(((BYTE *)(x))+1) = *(((BYTE *)(x))+2); \
*(((BYTE *)(x))+2) = _tmp; }
unsigned char BYTE
Definition: mcstd.h:48

SWAP DWORD macro

Definition at line 74 of file msystem.h.

◆ MAX

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

Definition at line 231 of file msystem.h.

◆ MIN

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

Definition at line 235 of file msystem.h.

◆ QWORD_SWAP

#define QWORD_SWAP (   x)
Value:
{ BYTE _tmp; \
_tmp= *((BYTE *)(x)); \
*((BYTE *)(x)) = *(((BYTE *)(x))+7); \
*(((BYTE *)(x))+7) = _tmp; \
_tmp= *(((BYTE *)(x))+1); \
*(((BYTE *)(x))+1) = *(((BYTE *)(x))+6); \
*(((BYTE *)(x))+6) = _tmp; \
_tmp= *(((BYTE *)(x))+2); \
*(((BYTE *)(x))+2) = *(((BYTE *)(x))+5); \
*(((BYTE *)(x))+5) = _tmp; \
_tmp= *(((BYTE *)(x))+3); \
*(((BYTE *)(x))+3) = *(((BYTE *)(x))+4); \
*(((BYTE *)(x))+4) = _tmp; }

SWAP QWORD macro

Definition at line 86 of file msystem.h.

◆ TELL

#define TELL (   fh)    lseek(fh, 0, SEEK_CUR)

Definition at line 243 of file msystem.h.

◆ TRUNCATE

#define TRUNCATE (   fh)    ftruncate(fh, TELL(fh))

Definition at line 249 of file msystem.h.

◆ WORD_SWAP

#define WORD_SWAP (   x)
Value:
{ BYTE _tmp; \
_tmp= *((BYTE *)(x)); \
*((BYTE *)(x)) = *(((BYTE *)(x))+1); \
*(((BYTE *)(x))+1) = _tmp; }

SWAP WORD macro

Definition at line 65 of file msystem.h.