-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
#include "third_party/fmt/core.h"
CacheEntryReader::CacheEntryReader(FILE* stream,
- const uint8_t expected_magic[4],
+ const uint8_t* expected_magic,
uint8_t expected_version)
{
uint8_t header_bytes[15];
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
//
// Parameters:
// - stream: Stream to read header and payload from.
- // - expected_magic: Expected magic bytes (first four bytes of the file).
+ // - expected_magic: Expected file format magic (first four bytes of the
+ // file).
// - expected_version: Expected file format version.
CacheEntryReader(FILE* stream,
- const uint8_t expected_magic[4],
+ const uint8_t* expected_magic,
uint8_t expected_version);
// Dump header information in text format.
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
#include "CacheEntryWriter.hpp"
CacheEntryWriter::CacheEntryWriter(FILE* stream,
- const uint8_t magic[4],
+ const uint8_t* magic,
uint8_t version,
Compression::Type compression_type,
int8_t compression_level,
-// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2021 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
//
// Parameters:
// - stream: Stream to write header + payload to.
- // - magic: File format magic bytes.
+ // - magic: File format magic (first four bytes of the file).
// - version: File format version.
// - compression_type: Compression type to use.
// - compression_level: Compression level to use.
// - payload_size: Payload size.
CacheEntryWriter(FILE* stream,
- const uint8_t magic[4],
+ const uint8_t* magic,
uint8_t version,
Compression::Type compression_type,
int8_t compression_level,