next up previous contents
Next: The cyclic log descriptor Up: Design Notes Previous: Design Notes   Contents

The cyclic log header

The header is exactly 100 bytes long and contains a string that identifies the file to be a cyclic log, followed by a string that indicates the version number. The version number is present in case the structure of a cyclic log ever changes and the cyclic package needs to maintain backward compatibility.

After this follows the start and end offset, including the size of the header. These are also held as strings so that the cyclic log is machine-independent. This means that a cyclic log created on a source machine may be transferred to a target machine that is a different machine architecture or running a different operating system and it will still be interpreted correctly by the cyclic package on the target machine.

The header also contains an ``isEmpty'' flag, as a string, which is set to ``1'' to indicate an empty log.

typedef struct logfileHeader
{
  /**
   * Identifies the file to be a cyclic logfile
   */
    char id[15];

    /// The version number of the file, as a string.
    char versionStr[15];

  /**
   * The start offset, including the size of the header
   */
    char startPtr[11];

  /**
   * The end offset, including the size of the header
   */
    char endPtr[11];

  /**
   * True ("1") if the file is empty.
   */
    char isEmpty[11];

  /**
   * Padding bytes to bring the header to 100 bytes.
   */
    char forFutureExpansion[37];
} CYC_LogfileHeader;



Andrew Marlow 2004-01-01