Updated: April 19, 2023 |
Get the status of an instance
#include <mmstream/mmstream.h>
ssize_t mmstream_get_status_information(mmstream_instance_t instance, char *status, const size_t size)
This function writes the status information for the specified instance as null-terminated JSON text into the buffer pointed to by status. 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 status information, call this function with status 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 status information, excluding the null-terminator. Thus, if this number is at least the value of size, the output was truncated. On failure, a negative value.