lgo_SaveConfiguration()
Save a protocol configuration to file.
#include "laygo.h" LResult lgo_SaveConfiguration ( LFileName fileName, LProtocol protocol, LCtlBuffer buffer, LBufferSize size );
fileName | name of file to write the configuration to |
protocol | protocol of the configuration |
buffer | buffer containing the configuration |
size | size of buffer in bytes |
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().
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:
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);