//..............................................................................
//
// IO Ninja log record file
//

namespace log {

//! \addtogroup api-log
//! @{

//..............................................................................

enum {
	RecordFileSignature = ':gol',
	RecordSignature     = ':cr\n',
};

// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

struct RecordFileHdr {
	uint32_t m_signature; // RecordFileSignature
	uint32_t m_version;
	uint64_t m_recordCount;
	uint64_t m_totalRecordSize;
	uint32_t m_lastRecordSize;
	uint32_t m_recordOffset        : 24;
	uint32_t m_auxRepresenterCount : 8;
	std.Guid m_representerGuid;

	// followed by std.Guid[m_auxRepresenterCount]
	// followed by aux headers (such as layered log metadata)
	// followed by log records at m_recordOffset
};

// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

// record code is 64-bit now -- no need to worry about collisions anymore

struct Record {
	uint32_t m_signature; // RecordSignature
	uint32_t m_dataSize;
	uint64_t m_code;
	uint64_t m_timestamp;

	// followed by record data (if any)
};

//..............................................................................

//! @}

} // namespace log
