X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=db.h;h=1670d6bc304c1e327f3bf2463dfbb5ae953cf0ac;hb=44ce04acb27d8e0551e3e1b0783ef44c384c4b28;hp=ca8b3ea74ae513a16a6bb9ed42a4eccdd9ea40a0;hpb=d5f6c3c0a4419f48ac62beca86e28c9e6aea2412;p=plocate diff --git a/db.h b/db.h index ca8b3ea..1670d6b 100644 --- a/db.h +++ b/db.h @@ -5,12 +5,28 @@ struct Header { char magic[8]; // "\0plocate"; - uint32_t version; // 0. + uint32_t version; // 1. uint32_t hashtable_size; uint32_t extra_ht_slots; uint32_t num_docids; uint64_t hash_table_offset_bytes; uint64_t filename_index_offset_bytes; + + // Version 1 and up only. + uint32_t max_version; // Nominally 1 or 2, but can be increased if more features are added in a backward-compatible way. + uint32_t zstd_dictionary_length_bytes; + uint64_t zstd_dictionary_offset_bytes; + + // Only if max_version >= 2, and only relevant for updatedb. + uint64_t directory_data_length_bytes; + uint64_t directory_data_offset_bytes; + uint64_t next_zstd_dictionary_length_bytes; + uint64_t next_zstd_dictionary_offset_bytes; + uint64_t conf_block_length_bytes; + uint64_t conf_block_offset_bytes; + + // Only if max_version >= 2. + bool check_visibility; }; struct Trigram {