Functions
File Operations
kvmlib

## Functions
kmeFileHandle | kvmKmeOpenFile (const char *filename, kvmStatus *status, int32 fileType)
kvmStatus | kvmKmeScanFileType (const char *filename, int32 *fileType)
kmeFileHandle | kvmKmeCreateFile (const char *filename, kvmStatus *status, int32 fileType)
kvmStatus | kvmKmeReadEvent (kmeFileHandle h, kvmLogEventEx *e)
kvmStatus | kvmKmeWriteEvent (kmeFileHandle h, kvmLogEventEx *e)
kvmStatus | kvmKmeCountEvents (kmeFileHandle h, uint32 *eventCount)
kvmStatus | kvmKmeCloseFile (kmeFileHandle h)

## Detailed Description

## Function Documentation

## ◆ kvmKmeCloseFile()

kvmStatus kvmKmeCloseFile | ( | kmeFileHandle | h | ) |

Close an open KME file opened with kvmKmeOpenFile() or created with kvmKmeCreateFile(). The handle becomes invalid.

Parameters

  [in] | h | An open handle to a KME file.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmKmeOpenFile(), kvmKmeCreateFile()

## ◆ kvmKmeCountEvents()

kvmStatus kvmKmeCountEvents | ( | kmeFileHandle | h,
|  | uint32 * | eventCount
| ) |  |

Count the number of events in a KME file.

Parameters

  [in] | h | An open handle to a KME file.
  [out] | eventCount | Approximate number of events in a KME file.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmKmeOpenFile(), kvmKmeCreateFile()

## ◆ kvmKmeCreateFile()

kmeFileHandle kvmKmeCreateFile | ( | const char * | filename,
|  | kvmStatus * | status,
|  | int32 | fileType
| ) |  |

Open a KME file for writing and obtain a handle for subsequent operations. Note that kvmKmeCreateFile() will overwrite any existing file and that kvmFILE_KME24 and kvmFILE_KME25 are deprecated formats. Please use kvmFILE_KME40.

Parameters

  [in] | filename | The full path and name of the KME file, e.g. C:\temp\myfile.kme
  [in] | fileType | kvmFILE_xxx
  [out] | status | kvmOK (zero) if success kvmERR_xxx (negative) if failure

Returns
  Returns an open handle to a KME file on success.

See also
  kvmKmeWriteEvent(), kvmKmeCountEvents(), kvmKmeCloseFile()

## ◆ kvmKmeOpenFile()

kmeFileHandle kvmKmeOpenFile | ( | const char * | filename,
|  | kvmStatus * | status,
|  | int32 | fileType
| ) |  |

Open a KME file for reading and obtain a handle for subsequent operations.

Parameters

  [in] | filename | The full path and name of the KME file, e.g. C:\temp\myfile.kme
  [in] | fileType | kvmFILE_xxx
  [out] | status | kvmOK (zero) if success kvmERR_xxx (negative) if failure

Returns
  Returns an open handle to a KME file on success.

See also
  kvmKmeReadEvent(), kvmKmeCountEvents(), kvmKmeCloseFile()

## ◆ kvmKmeReadEvent()

kvmStatus kvmKmeReadEvent | ( | kmeFileHandle | h,
|  | kvmLogEventEx * | e
| ) |  |

Read an event from a KME file opened with kvmKmeOpenFile().

Parameters

  [in] | h | An open handle to a KME file.
  [out] | e | Event from a KME file.

Returns
  kvmOK (zero) if success
  kvmERR_NOLOGMSG on EOF
  kvmERR_xxx (negative) if failure

See also
  kvmKmeOpenFile(), kvmKmeCountEvents(), kvmKmeCloseFile()

## ◆ kvmKmeScanFileType()

kvmStatus kvmKmeScanFileType | ( | const char * | filename,
|  | int32 * | fileType
| ) |  |

Open a KME file and obtain the file format type.

Parameters

  [in] | filename | The full path and name of the KME file, e.g. C:\temp\myfile.kme
  [out] | fileType | kvmFILE_xxx

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmKmeOpenFile()

## ◆ kvmKmeWriteEvent()

kvmStatus kvmKmeWriteEvent | ( | kmeFileHandle | h,
|  | kvmLogEventEx * | e
| ) |  |

Write an event to a KME file created with kvmKmeCreateFile().

Parameters

  [in] | h | An open handle to a KME file.
  [in] | e | Event to write.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmKmeCreateFile(), kvmKmeCountEvents(), kvmKmeCloseFile()