Updated: October 28, 2024 |
Get the configuration for an instance
#include <mmstream/mmstream.h>
ssize_t mmstream_get_configuration(mmstream_instance_t instance, char *config, const size_t size)
This function writes the configuration for the specified instance as null-terminated JSON text into the buffer pointed to by config. The number of bytes written is at most size, including the null-terminator.
If you need to know how many bytes are needed to store the full configuration data, call this function with config set to NULL and size set to 0. You can use the return value to allocate sufficient memory and then call this function again, passing in the pointer to the new buffer and the previously returned size.
On success, the size (in bytes) of the full configuration data, excluding the null-terminator. Thus, if this number is at least the value of size, the output was truncated. On failure, a negative value.