The 64-bit versions of these functions can be found under 64-bit Support
Here's an example usage that serializes a struct into a big-endian buffer:
struct mystruct { posh_u16_t u16; posh_i32_t i32; }; 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_WriteI32ToBig( p, &s->i32 ); }
Functions | |
| posh_u16_t * | POSH_WriteU16ToLittle (void *dst, posh_u16_t value) |
| Writes an unsigned 16-bit value to a little endian buffer. | |
| posh_i16_t * | POSH_WriteI16ToLittle (void *dst, posh_i16_t value) |
| Writes a signed 16-bit value to a little endian buffer. | |
| posh_u32_t * | POSH_WriteU32ToLittle (void *dst, posh_u32_t value) |
| Writes an unsigned 32-bit value to a little endian buffer. | |
| posh_i32_t * | POSH_WriteI32ToLittle (void *dst, posh_i32_t value) |
| Writes a signed 32-bit value to a little endian buffer. | |
| posh_u16_t * | POSH_WriteU16ToBig (void *dst, posh_u16_t value) |
| Writes an unsigned 16-bit value to a big endian buffer. | |
| posh_i16_t * | POSH_WriteI16ToBig (void *dst, posh_i16_t value) |
| Writes a signed 16-bit value to a big endian buffer. | |
| posh_u32_t * | POSH_WriteU32ToBig (void *dst, posh_u32_t value) |
| Writes an unsigned 32-bit value to a big endian buffer. | |
| posh_i32_t * | POSH_WriteI32ToBig (void *dst, posh_i32_t value) |
| Writes a signed 32-bit value to a big endian buffer. | |
| posh_u16_t | POSH_ReadU16FromLittle (const void *src) |
| Reads an unsigned 16-bit value from a little-endian buffer. | |
| posh_i16_t | POSH_ReadI16FromLittle (const void *src) |
| Reads a signed 16-bit value from a little-endian buffer. | |
| posh_u32_t | POSH_ReadU32FromLittle (const void *src) |
| Reads an unsigned 32-bit value from a little-endian buffer. | |
| posh_i32_t | POSH_ReadI32FromLittle (const void *src) |
| Reads a signed 32-bit value from a little-endian buffer. | |
| posh_u16_t | POSH_ReadU16FromBig (const void *src) |
| Reads an unsigned 16-bit value from a big-endian buffer. | |
| posh_i16_t | POSH_ReadI16FromBig (const void *src) |
| Reads a signed 16-bit value from a big-endian buffer. | |
| posh_u32_t | POSH_ReadU32FromBig (const void *src) |
| Reads an unsigned 32-bit value from a big-endian buffer. | |
| posh_i32_t | POSH_ReadI32FromBig (const void *src) |
| Reads a signed 32-bit value from a big-endian buffer. | |
|
|
Reads a signed 16-bit value from a big-endian buffer.
Definition at line 722 of file posh.c. References posh_i16_t, and POSH_ReadU16FromBig(). |
|
|
Reads a signed 16-bit value from a little-endian buffer.
Definition at line 659 of file posh.c. References posh_i16_t, and POSH_ReadU16FromLittle(). |
|
|
Reads a signed 32-bit value from a big-endian buffer.
Definition at line 754 of file posh.c. References POSH_BigI32, and posh_i32_t. |
|
|
Reads a signed 32-bit value from a little-endian buffer.
Definition at line 691 of file posh.c. References posh_i32_t, and POSH_ReadU32FromLittle(). |
|
|
Reads an unsigned 16-bit value from a big-endian buffer.
Definition at line 704 of file posh.c. References posh_byte_t, and posh_u16_t. Referenced by POSH_ReadI16FromBig(). |
|
|
Reads an unsigned 16-bit value from a little-endian buffer.
Definition at line 641 of file posh.c. References posh_byte_t, and posh_u16_t. Referenced by POSH_ReadI16FromLittle(). |
|
|
Reads an unsigned 32-bit value from a big-endian buffer.
Definition at line 734 of file posh.c. References posh_byte_t, and posh_u32_t. |
|
|
Reads an unsigned 32-bit value from a little-endian buffer.
Definition at line 671 of file posh.c. References posh_byte_t, and posh_u32_t. Referenced by POSH_ReadI32FromLittle(). |
|
||||||||||||
|
Writes a signed 16-bit value to a big endian buffer.
Definition at line 505 of file posh.c. References posh_i16_t, posh_u16_t, and POSH_WriteU16ToBig(). |
|
||||||||||||
|
Writes a signed 16-bit value to a little endian buffer.
Definition at line 429 of file posh.c. References posh_i16_t, posh_u16_t, and POSH_WriteU16ToLittle(). |
|
||||||||||||
|
Writes a signed 32-bit value to a big endian buffer.
Definition at line 544 of file posh.c. References posh_i32_t, posh_u32_t, and POSH_WriteU32ToBig(). |
|
||||||||||||
|
Writes a signed 32-bit value to a little endian buffer.
Definition at line 468 of file posh.c. References posh_i32_t, posh_u32_t, and POSH_WriteU32ToLittle(). |
|
||||||||||||
|
Writes an unsigned 16-bit value to a big endian buffer.
Definition at line 483 of file posh.c. References posh_byte_t, and posh_u16_t. Referenced by POSH_WriteI16ToBig(). |
|
||||||||||||
|
Writes an unsigned 16-bit value to a little endian buffer.
Definition at line 407 of file posh.c. References posh_byte_t, and posh_u16_t. Referenced by POSH_WriteI16ToLittle(). |
|
||||||||||||
|
Writes an unsigned 32-bit value to a big endian buffer.
Definition at line 520 of file posh.c. References posh_byte_t, and posh_u32_t. Referenced by POSH_WriteI32ToBig(). |
|
||||||||||||
|
Writes an unsigned 32-bit value to a little endian buffer.
Definition at line 444 of file posh.c. References posh_byte_t, and posh_u32_t. Referenced by POSH_WriteI32ToLittle(). |
1.3.7