Managing Protocol Services

Save Configuration

lgo_SaveConfiguration()

Save a protocol configuration to file.

Syntax
#include "laygo.h"

LResult lgo_SaveConfiguration
    (
        LFileName      fileName,
        LProtocol      protocol,
        LCtlBuffer     buffer,
        LBufferSize    size
    );
fileNamename of file to write the configuration to
protocolprotocol of the configuration
bufferbuffer containing the configuration
sizesize of buffer in bytes
Description

lgo_SaveConfiguration() writes a protocol configuration to a file. If the file exists, the configuration is placed in the file. If the file does not exist, it is created. The extension ".cfg" is automatically added to the file name. The configuration can be read from the file using lgo_ConfigureStack() or lgo_LoadConfiguration().

Return Values

If successful, lgo_SaveConfiguration() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_ConfigureStack()
lgo_LoadConfiguration()

Example
char        buffer[128];
LResult     result;

result = lgo_GetConfiguration(cid,
                    buffer,
                    (LBufferSize) sizeof(buffer));

if (result > 0)
{
    result = lgo_SaveConfiguration(fileName,
                    lgo_Protocol(cid),
                    buffer,
                    (LBufferSize) result));
}

return (result);