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)   (((TDS_UCHAR*)(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 { ((TDS_UCHAR*)(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)   (((TDS_UCHAR*)(ptr))[1] * 0x100u + ((TDS_UCHAR*)(ptr))[0])
 
#define TDS_GET_UA2BE(ptr)   (((TDS_UCHAR*)(ptr))[0] * 0x100u + ((TDS_UCHAR*)(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 132 of file bytes.h.

◆ TDS_GET_A1BE

#define TDS_GET_A1BE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 46 of file bytes.h.

◆ TDS_GET_A1LE

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

Definition at line 45 of file bytes.h.

◆ TDS_GET_A2

#define TDS_GET_A2 (   ptr)    TDS_GET_A2LE(ptr)

Definition at line 134 of file bytes.h.

◆ TDS_GET_A2BE

#define TDS_GET_A2BE (   ptr)    TDS_GET_UA2BE(ptr)

Definition at line 59 of file bytes.h.

◆ TDS_GET_A2LE [1/2]

#define TDS_GET_A2LE (   ptr)    TDS_GET_UA2LE(ptr)

Definition at line 140 of file bytes.h.

◆ TDS_GET_A2LE [2/2]

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

Definition at line 140 of file bytes.h.

◆ TDS_GET_A4

#define TDS_GET_A4 (   ptr)    TDS_GET_A4LE(ptr)

Definition at line 136 of file bytes.h.

◆ TDS_GET_A4BE

#define TDS_GET_A4BE (   ptr)    TDS_GET_UA4BE(ptr)

Definition at line 76 of file bytes.h.

◆ TDS_GET_A4LE [1/2]

#define TDS_GET_A4LE (   ptr)    TDS_GET_UA4LE(ptr)

Definition at line 141 of file bytes.h.

◆ TDS_GET_A4LE [2/2]

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

Definition at line 141 of file bytes.h.

◆ TDS_GET_UA1

#define TDS_GET_UA1 (   ptr)    TDS_GET_UA1LE(ptr)

Definition at line 133 of file bytes.h.

◆ TDS_GET_UA1BE

#define TDS_GET_UA1BE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 48 of file bytes.h.

◆ TDS_GET_UA1LE

#define TDS_GET_UA1LE (   ptr)    TDS_GET_A1LE(ptr)

Definition at line 47 of file bytes.h.

◆ TDS_GET_UA2

#define TDS_GET_UA2 (   ptr)    TDS_GET_UA2LE(ptr)

Definition at line 135 of file bytes.h.

◆ TDS_GET_UA2BE

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

Definition at line 57 of file bytes.h.

◆ TDS_GET_UA2LE

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

Definition at line 56 of file bytes.h.

◆ TDS_GET_UA4

#define TDS_GET_UA4 (   ptr)    TDS_GET_UA4LE(ptr)

Definition at line 137 of file bytes.h.

◆ TDS_GET_UA4BE

#define TDS_GET_UA4BE (   ptr)
Value:
(((TDS_UCHAR*)(ptr))[0] * 0x1000000u + ((TDS_UCHAR*)(ptr))[1] * 0x10000u +\
((TDS_UCHAR*)(ptr))[2] * 0x100u + ((TDS_UCHAR*)(ptr))[3])
unsigned char TDS_UCHAR
Definition: tds.h:145

Definition at line 72 of file bytes.h.

◆ TDS_GET_UA4LE

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

Definition at line 69 of file bytes.h.

◆ TDS_HOST2BE

#define TDS_HOST2BE (   val)    TDS_BYTE_SWAP16(val)

Definition at line 155 of file bytes.h.

◆ TDS_HOST2LE

#define TDS_HOST2LE (   val)    (val)

Definition at line 153 of file bytes.h.

◆ TDS_HOST4BE

#define TDS_HOST4BE (   val)    TDS_BYTE_SWAP32(val)

Definition at line 156 of file bytes.h.

◆ TDS_HOST4LE

#define TDS_HOST4LE (   val)    (val)

Definition at line 154 of file bytes.h.

◆ TDS_MAY_ALIAS

#define TDS_MAY_ALIAS

Definition at line 90 of file bytes.h.

◆ TDS_PUT_A1

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

Definition at line 143 of file bytes.h.

◆ TDS_PUT_A1BE

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

Definition at line 51 of file bytes.h.

◆ TDS_PUT_A1LE

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

Definition at line 50 of file bytes.h.

◆ TDS_PUT_A2

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

Definition at line 145 of file bytes.h.

◆ TDS_PUT_A2BE

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

Definition at line 66 of file bytes.h.

◆ TDS_PUT_A2LE [1/2]

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

Definition at line 151 of file bytes.h.

◆ TDS_PUT_A2LE [2/2]

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

Definition at line 151 of file bytes.h.

◆ TDS_PUT_A4

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

Definition at line 147 of file bytes.h.

◆ TDS_PUT_A4BE

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

Definition at line 85 of file bytes.h.

◆ TDS_PUT_A4LE [1/2]

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

Definition at line 152 of file bytes.h.

◆ TDS_PUT_A4LE [2/2]

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

Definition at line 152 of file bytes.h.

◆ TDS_PUT_UA1

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

Definition at line 144 of file bytes.h.

◆ TDS_PUT_UA1BE

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

Definition at line 53 of file bytes.h.

◆ TDS_PUT_UA1LE

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

Definition at line 52 of file bytes.h.

◆ TDS_PUT_UA2

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

Definition at line 146 of file bytes.h.

◆ TDS_PUT_UA2BE

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

Definition at line 63 of file bytes.h.

◆ TDS_PUT_UA2LE

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

Definition at line 61 of file bytes.h.

◆ TDS_PUT_UA4

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

Definition at line 148 of file bytes.h.

◆ TDS_PUT_UA4BE

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

Definition at line 81 of file bytes.h.

◆ TDS_PUT_UA4LE

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

Definition at line 78 of file bytes.h.

Modified on Tue May 21 11:00:34 2024 by modify_doxy.py rev. 669887