Requesting Information
lgo_FormatStatisticsTable()
Print a statistics table to a user supplied buffer.
#include "laygo.h"
LResult lgo_FormatStatisticsTable
(
LStatisticsTable table,
LProtocol protocol,
LMessage newline,
LMessageBuffer buffer,
LBufferSize size
);
| table | statistics table to format |
| protocol | statistics protocol |
| newline | newline string |
| buffer | output for formatted table |
| size | size of buffer in bytes |
lgo_FormatStatisticsTable() prints a statistics table to a user supplied buffer.
If successful, lgo_FormatStatisticsTable() returns
the number of bytes written to buffer. The number of bytes written includes the
terminating NUL. Otherwise, it returns a negative value indicating the reason it failed.
Possible unsuccessful return values are:
LBufferSize size = lgo_STATISTICS_SPACE_TOTAL(statTable);
LMessageBuffer buffer;
LResult result;
if ((buffer = malloc(size)) != NULL)
{
if ((result = lgo_FormatStatisticsTable(statTable, protocol, NULL, buffer, size)) > 0)
{
fputs(buffer, stdout);
}
free(buffer);
}
else
{
result = lgo_ERROR_OUT_OF_MEMORY;
}