|
version 1.3, 2014/01/29 14:16:54
|
version 1.3.6.1, 2014/02/10 22:47:06
|
|
Line 154 rpack_uint8(rpack_t * __restrict rp, uint8_t * __restr
|
Line 154 rpack_uint8(rpack_t * __restrict rp, uint8_t * __restr
|
| * |
* |
| * @rp = raw buffer |
* @rp = raw buffer |
| * @n = set value if !=NULL |
* @n = set value if !=NULL |
| |
* @be = extract in big-endian |
| * return: -1 error or get value |
* return: -1 error or get value |
| */ |
*/ |
| uint16_t |
uint16_t |
| rpack_uint16(rpack_t * __restrict rp, uint16_t * __restrict n) | rpack_uint16(rpack_t * __restrict rp, uint16_t * __restrict n, int be) |
| { |
{ |
| uint16_t u; |
uint16_t u; |
| uint8_t *next; |
uint8_t *next; |
|
Line 168 rpack_uint16(rpack_t * __restrict rp, uint16_t * __res
|
Line 169 rpack_uint16(rpack_t * __restrict rp, uint16_t * __res
|
| if (!(next = rpack_align_and_reserve(rp, sizeof(uint16_t)))) |
if (!(next = rpack_align_and_reserve(rp, sizeof(uint16_t)))) |
| return (uint16_t) -1; |
return (uint16_t) -1; |
| |
|
| u = EXTRACT_LE_16(next); | u = be ? EXTRACT_BE_16(next) : EXTRACT_LE_16(next); |
| if (n) |
if (n) |
| RPACK_SET_16(next, n); |
RPACK_SET_16(next, n); |
| |
|
|
Line 181 rpack_uint16(rpack_t * __restrict rp, uint16_t * __res
|
Line 182 rpack_uint16(rpack_t * __restrict rp, uint16_t * __res
|
| * |
* |
| * @rp = raw buffer |
* @rp = raw buffer |
| * @n = set value if !=NULL |
* @n = set value if !=NULL |
| |
* @be = extract in big-endian |
| * return: -1 error or get value |
* return: -1 error or get value |
| */ |
*/ |
| uint32_t |
uint32_t |
| rpack_uint24(rpack_t * __restrict rp, uint32_t * __restrict n) | rpack_uint24(rpack_t * __restrict rp, uint32_t * __restrict n, int be) |
| { |
{ |
| uint32_t u; |
uint32_t u; |
| uint8_t *next; |
uint8_t *next; |
|
Line 195 rpack_uint24(rpack_t * __restrict rp, uint32_t * __res
|
Line 197 rpack_uint24(rpack_t * __restrict rp, uint32_t * __res
|
| if (!(next = rpack_align_and_reserve(rp, sizeof(uint32_t)))) |
if (!(next = rpack_align_and_reserve(rp, sizeof(uint32_t)))) |
| return (uint32_t) -1; |
return (uint32_t) -1; |
| |
|
| u = EXTRACT_LE_24(next); | u = be ? EXTRACT_BE_24(next) : EXTRACT_LE_24(next); |
| if (n) |
if (n) |
| RPACK_SET_24(next, n); |
RPACK_SET_24(next, n); |
| |
|
|
Line 208 rpack_uint24(rpack_t * __restrict rp, uint32_t * __res
|
Line 210 rpack_uint24(rpack_t * __restrict rp, uint32_t * __res
|
| * |
* |
| * @rp = raw buffer |
* @rp = raw buffer |
| * @n = set value if !=NULL |
* @n = set value if !=NULL |
| |
* @be = extract in big-endian |
| * return: -1 error or get value |
* return: -1 error or get value |
| */ |
*/ |
| uint32_t |
uint32_t |
| rpack_uint32(rpack_t * __restrict rp, uint32_t * __restrict n) | rpack_uint32(rpack_t * __restrict rp, uint32_t * __restrict n, int be) |
| { |
{ |
| uint32_t u; |
uint32_t u; |
| uint8_t *next; |
uint8_t *next; |
|
Line 222 rpack_uint32(rpack_t * __restrict rp, uint32_t * __res
|
Line 225 rpack_uint32(rpack_t * __restrict rp, uint32_t * __res
|
| if (!(next = rpack_align_and_reserve(rp, sizeof(uint32_t)))) |
if (!(next = rpack_align_and_reserve(rp, sizeof(uint32_t)))) |
| return (uint32_t) -1; |
return (uint32_t) -1; |
| |
|
| u = EXTRACT_LE_32(next); | u = be ? EXTRACT_BE_32(next) : EXTRACT_LE_32(next); |
| if (n) |
if (n) |
| RPACK_SET_32(next, n); |
RPACK_SET_32(next, n); |
| |
|
|
Line 235 rpack_uint32(rpack_t * __restrict rp, uint32_t * __res
|
Line 238 rpack_uint32(rpack_t * __restrict rp, uint32_t * __res
|
| * |
* |
| * @rp = raw buffer |
* @rp = raw buffer |
| * @n = set value if !=NULL |
* @n = set value if !=NULL |
| |
* @be = extract in big-endian |
| * return: -1 error or get value |
* return: -1 error or get value |
| */ |
*/ |
| uint64_t |
uint64_t |
| rpack_uint64(rpack_t * __restrict rp, uint64_t * __restrict n) | rpack_uint64(rpack_t * __restrict rp, uint64_t * __restrict n, int be) |
| { |
{ |
| uint64_t u; |
uint64_t u; |
| uint8_t *next; |
uint8_t *next; |
|
Line 249 rpack_uint64(rpack_t * __restrict rp, uint64_t * __res
|
Line 253 rpack_uint64(rpack_t * __restrict rp, uint64_t * __res
|
| if (!(next = rpack_align_and_reserve(rp, sizeof(uint64_t)))) |
if (!(next = rpack_align_and_reserve(rp, sizeof(uint64_t)))) |
| return (uint64_t) -1; |
return (uint64_t) -1; |
| |
|
| u = EXTRACT_LE_64(next); | u = be ? EXTRACT_BE_64(next) : EXTRACT_LE_64(next); |
| if (n) |
if (n) |
| RPACK_SET_64(next, n); |
RPACK_SET_64(next, n); |
| |
|