Data stream input buffer.
More...
#include <stdbool.h>
#include <stddef.h>
#include "util.h"
Go to the source code of this file.
Data stream input buffer.
Definition in file input_buffer.h.
Expands the input buffer (if necessary) to accomadate the requested number of bytes.
The expansion happens in power of two increments up to the maxsize. The buffer never shrinks in size.
- Parameters
-
b | Input buffer |
len | The length of the data being added to the buffer |
- Returns
- lsb_err_value NULL on success error message on failure
Frees the memory internally allocated by the buffer and resets the state.
- Parameters
-
Initialize the provided input buffer.
- Parameters
-
b | Input buffer |
max_message_size | The maximum message size the buffer will handle before erroring (the internal buffer will contain extra space for the header) |
- Returns
- lsb_err_value NULL on success error message on failure