Requesting Information

Format Statistics Table

lgo_FormatStatisticsTable()

Print a statistics table to a user supplied buffer.

Syntax
#include "laygo.h"

LResult lgo_FormatStatisticsTable
    (
        LStatisticsTable    table,
        LProtocol           protocol,
        LMessage            newline,
        LMessageBuffer      buffer,
        LBufferSize         size
    );
tablestatistics table to format
protocolstatistics protocol
newlinenewline string
bufferoutput for formatted table
sizesize of buffer in bytes
Description

lgo_FormatStatisticsTable() prints a statistics table to a user supplied buffer.

Return Values

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:

See Also

lgo_FormatStatusReport()
lgo_PrintStatisticsTable()
lgo_PrintStatusReport()

Example
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;
}