Functions
Conversion
kvaMemoLibXML

## Functions
KvaXmlStatus | kvaXmlToBuffer (const char *xmlbuf, unsigned int xmllen, char *outbuf, unsigned int *outlen, long *version)
KvaXmlStatus | kvaXmlToFile (const char *infile, const char *outfile)
KvaXmlStatus | kvaFileToXml (const char *parfile, const char *xmlfile)
KvaXmlStatus | kvaXmlDebugOutput (int on)
KvaXmlStatus | kvaBufferToXml (const char *inbuf, unsigned int inlen, char *xmlbuf, unsigned int *xmllen, long *version, const char *scriptpath)
KvaXmlStatus | kvaXmlGetErrorText (KvaXmlStatus status, char *buf, unsigned int len)

## Detailed Description

## Function Documentation

## ◆ kvaBufferToXml()

KvaXmlStatus kvaBufferToXml | ( | const char * | inbuf,
|  | unsigned int | inlen,
|  | char * | xmlbuf,
|  | unsigned int * | xmllen,
|  | long * | version,
|  | const char * | scriptpath
| ) |  |

Convert a buffer containing param.lif with size inlen to a new XML settings buffer xmlbuf with length xmllen. The version of the XML settings is returned in version (Upper 16 bits: major, lower 16 bits: minor). Scripts from the param.lif will be written to the directory specified in scriptpath.

Parameters

  [in] | inbuf | Buffer containing the param.lif settings.
  [in] | inlen | Size of param.lif buffer in bytes.
  [out] | xmlbuf | Buffer to receive the XML settings.
  [out] | xmllen | Size of the XML buffer in bytes.
  [out] | version | XML version.
  [in] | scriptpath | Path to destination of scripts.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.

## ◆ kvaFileToXml()

KvaXmlStatus kvaFileToXml | ( | const char * | parfile,
|  | const char * | xmlfile
| ) |  |

Convert the binary settings from parfile and write the XML settings to xmlfile.

Parameters

  [in] | parfile | Path and name of the file containing the param.lif settings.
  [out] | xmlfile | Path and name of the file to receive the XML settings.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.

## ◆ kvaXmlDebugOutput()

KvaXmlStatus kvaXmlDebugOutput | ( | int | on | ) |

Enable detailed information about the XML conversion on standard out. This can be very useful when the error that causes the failure is masked by subsequent errors.

Parameters

  [in] | on | Enable debug output if non-zero.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.

## ◆ kvaXmlGetErrorText()

KvaXmlStatus kvaXmlGetErrorText | ( | KvaXmlStatus | status,
|  | char * | buf,
|  | unsigned int | len
| ) |  |

Get a human readable description of error with supplied error code.

Parameters

  [in] | status | KvaXmlStatus error code.
  [out] | buf | Buffer to receive error message.
  [in] | len | Buffer size in bytes.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.

## ◆ kvaXmlToBuffer()

KvaXmlStatus kvaXmlToBuffer | ( | const char * | xmlbuf,
|  | unsigned int | xmllen,
|  | char * | outbuf,
|  | unsigned int * | outlen,
|  | long * | version
| ) |  |

Convert the XML settings from buffer xmlbuf with length xmllen. The resulting param.lif is written to the buffer outbuf and has length outlen. Use the macro PARAMLIF_SIZE to allocate the ouput buffer to ensure that it is sufficiently large. The version of the XML settings is returned in version (Upper 16 bits: major, lower 16 bits: minor).

Parameters

  [in] | xmlbuf | Buffer containing the XML settings.
  [in] | xmllen | Size of the XML buffer in bytes.
  [out] | outbuf | Buffer to receive the param.lif settings.
  [out] | outlen | Size of the param.lif buffer in bytes.
  [out] | version | XML version.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.

## ◆ kvaXmlToFile()

KvaXmlStatus kvaXmlToFile | ( | const char * | infile,
|  | const char * | outfile
| ) |  |

Convert the XML settings from infile and write the binary settings to outfile.

Parameters

  [in] | infile | Path and name of the file containing the XML settings.
  [out] | outfile | Path and name of the file to receive the param.lif settings.

Returns
  KvaXmlStatusOK (zero) if success.
  KvaXmlStatusERR_XXX (negative) if failure.