NCBI C++ ToolKit
Classes | Macros
bytes.h File Reference

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

union  TDS_BYTE_CONVERT2
 
union  TDS_BYTE_CONVERT4
 

Macros

#define TDS_GET_A1LE(ptr)   (((uint8_t *)(ptr))[0])
 
#define TDS_GET_A1BE(ptr)   TDS_GET_A1LE(ptr)
 
#define TDS_GET_UA1LE(ptr)   TDS_GET_A1LE(ptr)
 
#define TDS_GET_UA1BE(ptr)   TDS_GET_A1LE(ptr)
 
#define TDS_PUT_A1LE(ptr, val)   do { ((uint8_t *)(ptr))[0] = (val); } while(0)
 
#define TDS_PUT_A1BE(ptr, val)   TDS_PUT_A1LE(ptr,val)
 
#define TDS_PUT_UA1LE(ptr, val)   TDS_PUT_A1LE(ptr,val)
 
#define TDS_PUT_UA1BE(ptr, val)   TDS_PUT_A1LE(ptr,val)
 
#define TDS_GET_UA2LE(ptr)   (((uint8_t *)(ptr))[1] * 0x100u + ((uint8_t *)(ptr))[0])
 
#define TDS_GET_UA2BE(ptr)   (((uint8_t *)(ptr))[0] * 0x100u + ((uint8_t *)(ptr))[1])
 
#define TDS_GET_A2LE(ptr)   TDS_GET_UA2LE(ptr)
 
#define TDS_GET_A2BE(ptr)   TDS_GET_UA2BE(ptr)
 
#define TDS_PUT_UA2LE(ptr, val)
 
#define TDS_PUT_UA2BE(ptr, val)
 
#define TDS_PUT_A2LE(ptr, val)   TDS_PUT_UA2LE(ptr,val)
 
#define TDS_PUT_A2BE(ptr, val)   TDS_PUT_UA2BE(ptr,val)
 
#define TDS_GET_UA4LE(ptr)
 
#define TDS_GET_UA4BE(ptr)
 
#define TDS_GET_A4LE(ptr)   TDS_GET_UA4LE(ptr)
 
#define TDS_GET_A4BE(ptr)   TDS_GET_UA4BE(ptr)
 
#define TDS_PUT_UA4LE(ptr, val)
 
#define TDS_PUT_UA4BE(ptr, val)
 
#define TDS_PUT_A4LE(ptr, val)   TDS_PUT_UA4LE(ptr,val)
 
#define TDS_PUT_A4BE(ptr, val)   TDS_PUT_UA4BE(ptr,val)
 
#define TDS_MAY_ALIAS
 
#define TDS_GET_A1(ptr)   TDS_GET_A1LE(ptr)
 
#define TDS_GET_UA1(ptr)   TDS_GET_UA1LE(ptr)
 
#define TDS_GET_A2(ptr)   TDS_GET_A2LE(ptr)
 
#define TDS_GET_UA2(ptr)   TDS_GET_UA2LE(ptr)
 
#define TDS_GET_A4(ptr)   TDS_GET_A4LE(ptr)
 
#define TDS_GET_UA4(ptr)   TDS_GET_UA4LE(ptr)
 
#define TDS_GET_A2LE(ptr)   (((TDS_BYTE_CONVERT2*)(ptr))->usi)
 
#define TDS_GET_A4LE(ptr)   (((TDS_BYTE_CONVERT4*)(ptr))->ui)
 
#define TDS_PUT_A1(ptr, val)   TDS_PUT_A1LE(ptr,val)
 
#define TDS_PUT_UA1(ptr, val)   TDS_PUT_UA1LE(ptr,val)
 
#define TDS_PUT_A2(ptr, val)   TDS_PUT_A2LE(ptr,val)
 
#define TDS_PUT_UA2(ptr, val)   TDS_PUT_UA2LE(ptr,val)
 
#define TDS_PUT_A4(ptr, val)   TDS_PUT_A4LE(ptr,val)
 
#define TDS_PUT_UA4(ptr, val)   TDS_PUT_UA4LE(ptr,val)
 
#define TDS_PUT_A2LE(ptr, val)   (((TDS_BYTE_CONVERT2*)(ptr))->usi = (val))
 
#define TDS_PUT_A4LE(ptr, val)   (((TDS_BYTE_CONVERT4*)(ptr))->ui = (val))
 
#define TDS_HOST2LE(val)   (val)
 
#define TDS_HOST4LE(val)   (val)
 
#define TDS_HOST2BE(val)   TDS_BYTE_SWAP16(val)
 
#define TDS_HOST4BE(val)   TDS_BYTE_SWAP32(val)
 

Macro Definition Documentation

◆ TDS_GET_A1

#define TDS_GET_A1 (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 126 of file bytes.h.

◆ TDS_GET_A1BE

#define TDS_GET_A1BE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 40 of file bytes.h.

◆ TDS_GET_A1LE

#define TDS_GET_A1LE (   ptr)    (((uint8_t *)(ptr))[0])

Definition at line 39 of file bytes.h.

◆ TDS_GET_A2

#define TDS_GET_A2 (   ptr)    TDS_GET_A2LE(ptr)

Definition at line 128 of file bytes.h.

◆ TDS_GET_A2BE

#define TDS_GET_A2BE (   ptr)    TDS_GET_UA2BE(ptr)

Definition at line 53 of file bytes.h.

◆ TDS_GET_A2LE [1/2]

#define TDS_GET_A2LE (   ptr)    TDS_GET_UA2LE(ptr)

Definition at line 134 of file bytes.h.

◆ TDS_GET_A2LE [2/2]

#define TDS_GET_A2LE (   ptr)    (((TDS_BYTE_CONVERT2*)(ptr))->usi)

Definition at line 134 of file bytes.h.

◆ TDS_GET_A4

#define TDS_GET_A4 (   ptr)    TDS_GET_A4LE(ptr)

Definition at line 130 of file bytes.h.

◆ TDS_GET_A4BE

#define TDS_GET_A4BE (   ptr)    TDS_GET_UA4BE(ptr)

Definition at line 70 of file bytes.h.

◆ TDS_GET_A4LE [1/2]

#define TDS_GET_A4LE (   ptr)    TDS_GET_UA4LE(ptr)

Definition at line 135 of file bytes.h.

◆ TDS_GET_A4LE [2/2]

#define TDS_GET_A4LE (   ptr)    (((TDS_BYTE_CONVERT4*)(ptr))->ui)

Definition at line 135 of file bytes.h.

◆ TDS_GET_UA1

#define TDS_GET_UA1 (   ptr)    TDS_GET_UA1LE(ptr)

Definition at line 127 of file bytes.h.

◆ TDS_GET_UA1BE

#define TDS_GET_UA1BE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 42 of file bytes.h.

◆ TDS_GET_UA1LE

#define TDS_GET_UA1LE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 41 of file bytes.h.

◆ TDS_GET_UA2

#define TDS_GET_UA2 (   ptr)    TDS_GET_UA2LE(ptr)

Definition at line 129 of file bytes.h.

◆ TDS_GET_UA2BE

#define TDS_GET_UA2BE (   ptr)    (((uint8_t *)(ptr))[0] * 0x100u + ((uint8_t *)(ptr))[1])

Definition at line 51 of file bytes.h.

◆ TDS_GET_UA2LE

#define TDS_GET_UA2LE (   ptr)    (((uint8_t *)(ptr))[1] * 0x100u + ((uint8_t *)(ptr))[0])

Definition at line 50 of file bytes.h.

◆ TDS_GET_UA4

#define TDS_GET_UA4 (   ptr)    TDS_GET_UA4LE(ptr)

Definition at line 131 of file bytes.h.

◆ TDS_GET_UA4BE

#define TDS_GET_UA4BE (   ptr)
Value:
(((uint8_t *)(ptr))[0] * 0x1000000u + ((uint8_t *)(ptr))[1] * 0x10000u +\
((uint8_t *)(ptr))[2] * 0x100u + ((uint8_t *)(ptr))[3])
unsigned char uint8_t

Definition at line 66 of file bytes.h.

◆ TDS_GET_UA4LE

#define TDS_GET_UA4LE (   ptr)
Value:
(((uint8_t *)(ptr))[3] * 0x1000000u + ((uint8_t *)(ptr))[2] * 0x10000u +\
((uint8_t *)(ptr))[1] * 0x100u + ((uint8_t *)(ptr))[0])

Definition at line 63 of file bytes.h.

◆ TDS_HOST2BE

#define TDS_HOST2BE (   val)    TDS_BYTE_SWAP16(val)

Definition at line 149 of file bytes.h.

◆ TDS_HOST2LE

#define TDS_HOST2LE (   val)    (val)

Definition at line 147 of file bytes.h.

◆ TDS_HOST4BE

#define TDS_HOST4BE (   val)    TDS_BYTE_SWAP32(val)

Definition at line 150 of file bytes.h.

◆ TDS_HOST4LE

#define TDS_HOST4LE (   val)    (val)

Definition at line 148 of file bytes.h.

◆ TDS_MAY_ALIAS

#define TDS_MAY_ALIAS

Definition at line 84 of file bytes.h.

◆ TDS_PUT_A1

#define TDS_PUT_A1 (   ptr,
  val 
)    TDS_PUT_A1LE(ptr,val)

Definition at line 137 of file bytes.h.

◆ TDS_PUT_A1BE

#define TDS_PUT_A1BE (   ptr,
  val 
)    TDS_PUT_A1LE(ptr,val)

Definition at line 45 of file bytes.h.

◆ TDS_PUT_A1LE

#define TDS_PUT_A1LE (   ptr,
  val 
)    do { ((uint8_t *)(ptr))[0] = (val); } while(0)

Definition at line 44 of file bytes.h.

◆ TDS_PUT_A2

#define TDS_PUT_A2 (   ptr,
  val 
)    TDS_PUT_A2LE(ptr,val)

Definition at line 139 of file bytes.h.

◆ TDS_PUT_A2BE

#define TDS_PUT_A2BE (   ptr,
  val 
)    TDS_PUT_UA2BE(ptr,val)

Definition at line 60 of file bytes.h.

◆ TDS_PUT_A2LE [1/2]

#define TDS_PUT_A2LE (   ptr,
  val 
)    TDS_PUT_UA2LE(ptr,val)

Definition at line 145 of file bytes.h.

◆ TDS_PUT_A2LE [2/2]

#define TDS_PUT_A2LE (   ptr,
  val 
)    (((TDS_BYTE_CONVERT2*)(ptr))->usi = (val))

Definition at line 145 of file bytes.h.

◆ TDS_PUT_A4

#define TDS_PUT_A4 (   ptr,
  val 
)    TDS_PUT_A4LE(ptr,val)

Definition at line 141 of file bytes.h.

◆ TDS_PUT_A4BE

#define TDS_PUT_A4BE (   ptr,
  val 
)    TDS_PUT_UA4BE(ptr,val)

Definition at line 79 of file bytes.h.

◆ TDS_PUT_A4LE [1/2]

#define TDS_PUT_A4LE (   ptr,
  val 
)    TDS_PUT_UA4LE(ptr,val)

Definition at line 146 of file bytes.h.

◆ TDS_PUT_A4LE [2/2]

#define TDS_PUT_A4LE (   ptr,
  val 
)    (((TDS_BYTE_CONVERT4*)(ptr))->ui = (val))

Definition at line 146 of file bytes.h.

◆ TDS_PUT_UA1

#define TDS_PUT_UA1 (   ptr,
  val 
)    TDS_PUT_UA1LE(ptr,val)

Definition at line 138 of file bytes.h.

◆ TDS_PUT_UA1BE

#define TDS_PUT_UA1BE (   ptr,
  val 
)    TDS_PUT_A1LE(ptr,val)

Definition at line 47 of file bytes.h.

◆ TDS_PUT_UA1LE

#define TDS_PUT_UA1LE (   ptr,
  val 
)    TDS_PUT_A1LE(ptr,val)

Definition at line 46 of file bytes.h.

◆ TDS_PUT_UA2

#define TDS_PUT_UA2 (   ptr,
  val 
)    TDS_PUT_UA2LE(ptr,val)

Definition at line 140 of file bytes.h.

◆ TDS_PUT_UA2BE

#define TDS_PUT_UA2BE (   ptr,
  val 
)
Value:
do {\
((uint8_t *)(ptr))[0] = (uint8_t)((val)>>8); ((uint8_t *)(ptr))[1] = (uint8_t)(val); } while(0)

Definition at line 57 of file bytes.h.

◆ TDS_PUT_UA2LE

#define TDS_PUT_UA2LE (   ptr,
  val 
)
Value:
do {\
((uint8_t *)(ptr))[1] = (uint8_t)((val)>>8); ((uint8_t *)(ptr))[0] = (uint8_t)(val); } while(0)

Definition at line 55 of file bytes.h.

◆ TDS_PUT_UA4

#define TDS_PUT_UA4 (   ptr,
  val 
)    TDS_PUT_UA4LE(ptr,val)

Definition at line 142 of file bytes.h.

◆ TDS_PUT_UA4BE

#define TDS_PUT_UA4BE (   ptr,
  val 
)
Value:
do {\
((uint8_t *)(ptr))[0] = (uint8_t)((val)>>24); ((uint8_t *)(ptr))[1] = (uint8_t)((val)>>16);\
((uint8_t *)(ptr))[2] = (uint8_t)((val)>>8); ((uint8_t *)(ptr))[3] = (uint8_t)(val); } while(0)

Definition at line 75 of file bytes.h.

◆ TDS_PUT_UA4LE

#define TDS_PUT_UA4LE (   ptr,
  val 
)
Value:
do {\
((uint8_t *)(ptr))[3] = (uint8_t)((val)>>24); ((uint8_t *)(ptr))[2] = (uint8_t)((val)>>16);\
((uint8_t *)(ptr))[1] = (uint8_t)((val)>>8); ((uint8_t *)(ptr))[0] = (uint8_t)(val); } while(0)

Definition at line 72 of file bytes.h.

Modified on Fri Sep 20 14:57:48 2024 by modify_doxy.py rev. 669887