#include "xdas_base.h"
#include <stddef.h>
Go to the source code of this file.
Defines | |
Buffer extraction and insertion macros.  | |
These macros safely extract 16, 24, and 32-bit values from and insert them into raw wire buffers, regardless of machine endian-ness, or hardware alignment strictness. 
The do so by reading and writing a byte at a time which defeats alignment issues, and building the value by bit-shifting, which doesn't care about endian-ness. Buffer values are assumed to be in network byte order (big-endian) format.   | |
| #define | AS_UINT16(p) | 
| Extract an unsigned 16-bit quantity from a wire buffer.   | |
| #define | AS_UINT24(p) | 
| Extract an unsigned 24-bit quantity from a wire buffer.   | |
| #define | AS_UINT32(p) | 
| Extract an unsigned 32-bit quantity from a wire buffer.   | |
| #define | TO_UINT16(p, v) | 
| Insert an unsigned 16-bit quantity into a wire buffer.   | |
| #define | TO_UINT24(p, v) | 
| Insert an unsigned 24-bit quantity into a wire buffer.   | |
| #define | TO_UINT32(p, v) | 
| Insert an unsigned 32-bit quantity into a wire buffer.   | |
Functions | |
| uint16_t | xdas_get_uint16 (char **cpp) | 
| Extract a 16-bit big-endian buffer value into a native 16-bit word.   | |
| uint32_t | xdas_get_uint24 (char **cpp) | 
| Extract a 24-bit big-endian buffer value into a native 32-bit word.   | |
| uint32_t | xdas_get_uint32 (char **cpp) | 
| Extract a 32-bit big-endian buffer value into a native 32-bit word.   | |
| void | xdas_put_uint16 (char **cpp, size_t val) | 
| Insert a 16-bit native word into a buffer in big-endian format.   | |
| void | xdas_put_uint24 (char **cpp, size_t val) | 
| Insert a 24-bit native word into a buffer in big-endian format.   | |
| void | xdas_put_uint32 (char **cpp, size_t val) | 
| Insert a 32-bit native word into a buffer in big-endian format.   | |
Includes structures, constants and functions that used to handle memory allocation for xdasd event message buffers.
Definition in file xdas_wire.h.
 1.5.6