mmstream_get_status_information()

Get the status of an instance

Synopsis:

#include <mmstream/mmstream.h>
ssize_t mmstream_get_status_information(mmstream_instance_t instance,
                                        char *status,
                                        const size_t size)

Arguments:

instance
A handle to the instance whose status is being retrieved
status
A pointer to a buffer for storing the status (can be NULL to request how many bytes are needed)
size
The maximum number of bytes to write into the buffer, including the null-terminator (can be 0 to request the buffer size needed)

Library:

libmmstream

Description:

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.

Returns:

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.