Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
Functions | |
posh_u16_t * | POSH_WriteU16ToLittle (void *dst, posh_u16_t value) |
posh_s16_t * | POSH_WriteS16ToLittle (void *dst, posh_s16_t value) |
posh_u32_t * | POSH_WriteU32ToLittle (void *dst, posh_u32_t value) |
posh_s32_t * | POSH_WriteS32ToLittle (void *dst, posh_s32_t value) |
posh_u16_t * | POSH_WriteU16ToBig (void *dst, posh_u16_t value) |
posh_s16_t * | POSH_WriteS16ToBig (void *dst, posh_s16_t value) |
posh_u32_t * | POSH_WriteU32ToBig (void *dst, posh_u32_t value) |
posh_s32_t * | POSH_WriteS32ToBig (void *dst, posh_s32_t value) |
posh_u16_t | POSH_ReadU16FromLittle (const void *src) |
posh_s16_t | POSH_ReadS16FromLittle (const void *src) |
posh_u32_t | POSH_ReadU32FromLittle (const void *src) |
posh_s32_t | POSH_ReadS32FromLittle (const void *src) |
posh_u16_t | POSH_ReadU16FromBig (const void *src) |
posh_s16_t | POSH_ReadS16FromBig (const void *src) |
posh_u32_t | POSH_ReadU32FromBig (const void *src) |
posh_s32_t | POSH_ReadS32FromBig (const void *src) |
These functions take host endian values and serialize them into explicit endianess buffers and vice versa. The 64-bit versions of these functions can be found under @ref SixtyFourBit
Here's an example usage that serializes a struct into a big-endian buffer:
* * struct mystruct * { * posh_u16_t u16; * posh_s32_t s32; * }; * * void WriteStruct( void *buffer, const struct mystruct *s ) * { * void *p = buffer; * * //The POSH_Write??? functions return a pointer to the next write address * p = POSH_WriteU16ToBig( p, &s->u16 ); * p = POSH_WriteS32ToBig( p, &s->s32 ); * } * *
posh_s16_t POSH_ReadS16FromBig | ( | const void * | src) |
Reads a signed 16-bit value from a big-endian buffer
src[in] | source buffer |
Definition at line 562 of file posh.cpp.
References POSH_BigS16.
posh_s16_t POSH_ReadS16FromLittle | ( | const void * | src) |
Reads a signed 16-bit value from a little-endian buffer
src[in] | source buffer |
Definition at line 522 of file posh.cpp.
References POSH_LittleS16.
posh_s32_t POSH_ReadS32FromBig | ( | const void * | src) |
Reads a signed 32-bit value from a big-endian buffer
src[in] | source buffer |
Definition at line 582 of file posh.cpp.
References POSH_BigS32.
Referenced by NetBuffer::getInt32().
posh_s32_t POSH_ReadS32FromLittle | ( | const void * | src) |
Reads a signed 32-bit value from a little-endian buffer
src[in] | source buffer |
Definition at line 542 of file posh.cpp.
References POSH_LittleS32.
posh_u16_t POSH_ReadU16FromBig | ( | const void * | src) |
Reads an unsigned 16-bit value from a big-endian buffer
src[in] | source buffer |
Definition at line 552 of file posh.cpp.
References POSH_BigU16.
Referenced by NetBuffer::getShort(), and s_testSerialization().
posh_u16_t POSH_ReadU16FromLittle | ( | const void * | src) |
Reads an unsigned 16-bit value from a little-endian buffer
src[in] | source buffer |
Definition at line 512 of file posh.cpp.
References POSH_LittleU16.
Referenced by s_testSerialization().
posh_u32_t POSH_ReadU32FromBig | ( | const void * | src) |
Reads an unsigned 32-bit value from a big-endian buffer
src[in] | source buffer |
Definition at line 572 of file posh.cpp.
References POSH_BigU32.
Referenced by NetBuffer::getUInt32(), and s_testSerialization().
posh_u32_t POSH_ReadU32FromLittle | ( | const void * | src) |
Reads an unsigned 32-bit value from a little-endian buffer
src[in] | source buffer |
Definition at line 532 of file posh.cpp.
References POSH_LittleU32.
Referenced by s_testSerialization().
posh_s16_t* POSH_WriteS16ToBig | ( | void * | dst, |
posh_s16_t | value | ||
) |
Writes a signed 16-bit value to a big endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 16-bit value |
Definition at line 398 of file posh.cpp.
References POSH_WriteU16ToBig().
posh_s16_t* POSH_WriteS16ToLittle | ( | void * | dst, |
posh_s16_t | value | ||
) |
Writes a signed 16-bit value to a little endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 16-bit value |
Definition at line 336 of file posh.cpp.
References POSH_WriteU16ToLittle().
posh_s32_t* POSH_WriteS32ToBig | ( | void * | dst, |
posh_s32_t | value | ||
) |
Writes a signed 32-bit value to a big endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
Definition at line 429 of file posh.cpp.
References POSH_WriteU32ToBig().
Referenced by NetBuffer::addInt32().
posh_s32_t* POSH_WriteS32ToLittle | ( | void * | dst, |
posh_s32_t | value | ||
) |
Writes a signed 32-bit value to a little endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
Definition at line 367 of file posh.cpp.
References POSH_WriteU32ToLittle().
posh_u16_t* POSH_WriteU16ToBig | ( | void * | dst, |
posh_u16_t | value | ||
) |
Writes an unsigned 16-bit value to a big endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 16-bit value |
Definition at line 380 of file posh.cpp.
References POSH_BigU16.
Referenced by NetBuffer::addShort(), POSH_WriteS16ToBig(), and s_testSerialization().
posh_u16_t* POSH_WriteU16ToLittle | ( | void * | dst, |
posh_u16_t | value | ||
) |
Writes an unsigned 16-bit value to a little endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 16-bit value |
Definition at line 318 of file posh.cpp.
References POSH_LittleU16.
Referenced by POSH_WriteS16ToLittle(), and s_testSerialization().
posh_u32_t* POSH_WriteU32ToBig | ( | void * | dst, |
posh_u32_t | value | ||
) |
Writes an unsigned 32-bit value to a big endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 32-bit value |
Definition at line 411 of file posh.cpp.
References POSH_BigU32.
Referenced by NetBuffer::addUInt32(), POSH_WriteS32ToBig(), and s_testSerialization().
posh_u32_t* POSH_WriteU32ToLittle | ( | void * | dst, |
posh_u32_t | value | ||
) |
Writes an unsigned 32-bit value to a little endian buffer
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
Definition at line 349 of file posh.cpp.
References POSH_LittleU32.
Referenced by POSH_WriteS32ToLittle(), and s_testSerialization().