forked from shosatojp/simplecache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.hpp
More file actions
35 lines (28 loc) · 748 Bytes
/
Copy pathstructs.hpp
File metadata and controls
35 lines (28 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <cstdint>
struct SimpleFileHeader {
SimpleFileHeader() = default;
uint64_t initial_magic_number;
uint32_t version;
uint32_t key_length;
uint32_t key_hash;
};
struct SimpleFileEOF {
enum Flags {
FLAG_HAS_CRC32 = (1U << 0),
FLAG_HAS_KEY_SHA256 = (1U << 1), // Preceding the record if present.
};
SimpleFileEOF() = default;
uint64_t final_magic_number;
uint32_t flags;
uint32_t data_crc32;
// |stream_size| is only used in the EOF record for stream 0.
uint32_t stream_size;
};
struct SimpleMeta {
uint32_t info_size;
uint32_t flags;
uint64_t request_time;
uint64_t response_time;
uint32_t header_size;
} __attribute__((__packed__));