byteorder.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAREFUL_ALIGNMENT   1
 
#define CVAL(buf, pos)   (((unsigned char *)(buf))[pos])
 
#define PVAL(buf, pos)   ((unsigned)CVAL(buf,pos))
 
#define SCVAL(buf, pos, val)   (CVAL(buf,pos) = (val))
 
#define SVAL(buf, pos)   (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
 
#define IVAL(buf, pos)   (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
 
#define SSVALX(buf, pos, val)   (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)
 
#define SIVALX(buf, pos, val)   (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
 
#define SVALS(buf, pos)   ((int16)SVAL(buf,pos))
 
#define IVALS(buf, pos)   ((int32)IVAL(buf,pos))
 
#define SSVAL(buf, pos, val)   SSVALX((buf),(pos),((uint16)(val)))
 
#define SIVAL(buf, pos, val)   SIVALX((buf),(pos),((uint32)(val)))
 
#define SSVALS(buf, pos, val)   SSVALX((buf),(pos),((int16)(val)))
 
#define SIVALS(buf, pos, val)   SIVALX((buf),(pos),((int32)(val)))
 
#define SREV(x)   ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
 
#define IREV(x)   ((SREV(x)<<16) | (SREV((x)>>16)))
 
#define RSVAL(buf, pos)   SREV(SVAL(buf,pos))
 
#define RIVAL(buf, pos)   IREV(IVAL(buf,pos))
 
#define RSSVAL(buf, pos, val)   SSVAL(buf,pos,SREV(val))
 
#define RSIVAL(buf, pos, val)   SIVAL(buf,pos,IREV(val))
 

Macro Definition Documentation

◆ CAREFUL_ALIGNMENT

#define CAREFUL_ALIGNMENT   1

Definition at line 46 of file byteorder.h.

◆ CVAL

◆ IREV

#define IREV (   x)    ((SREV(x)<<16) | (SREV((x)>>16)))

Definition at line 83 of file byteorder.h.

◆ IVAL

◆ IVALS

#define IVALS (   buf,
  pos 
)    ((int32)IVAL(buf,pos))

Definition at line 59 of file byteorder.h.

◆ PVAL

#define PVAL (   buf,
  pos 
)    ((unsigned)CVAL(buf,pos))

Definition at line 50 of file byteorder.h.

◆ RIVAL

#define RIVAL (   buf,
  pos 
)    IREV(IVAL(buf,pos))

Definition at line 86 of file byteorder.h.

◆ RSIVAL

#define RSIVAL (   buf,
  pos,
  val 
)    SIVAL(buf,pos,IREV(val))

Definition at line 88 of file byteorder.h.

◆ RSSVAL

#define RSSVAL (   buf,
  pos,
  val 
)    SSVAL(buf,pos,SREV(val))

Definition at line 87 of file byteorder.h.

◆ RSVAL

#define RSVAL (   buf,
  pos 
)    SREV(SVAL(buf,pos))

Definition at line 85 of file byteorder.h.

◆ SCVAL

#define SCVAL (   buf,
  pos,
  val 
)    (CVAL(buf,pos) = (val))

Definition at line 51 of file byteorder.h.

◆ SIVAL

◆ SIVALS

#define SIVALS (   buf,
  pos,
  val 
)    SIVALX((buf),(pos),((int32)(val)))

Definition at line 63 of file byteorder.h.

◆ SIVALX

#define SIVALX (   buf,
  pos,
  val 
)    (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))

Definition at line 57 of file byteorder.h.

◆ SREV

#define SREV (   x)    ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))

Definition at line 82 of file byteorder.h.

◆ SSVAL

◆ SSVALS

#define SSVALS (   buf,
  pos,
  val 
)    SSVALX((buf),(pos),((int16)(val)))

Definition at line 62 of file byteorder.h.

◆ SSVALX

#define SSVALX (   buf,
  pos,
  val 
)    (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)

Definition at line 56 of file byteorder.h.

◆ SVAL

◆ SVALS

#define SVALS (   buf,
  pos 
)    ((int16)SVAL(buf,pos))

Definition at line 58 of file byteorder.h.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors