string buf;
buf.resize(buf_size);
size_t ret = ZDICT_trainFromBuffer(&buf[0], buf_size, dictionary_buf.data(), lengths.data(), lengths.size());
- if (ret == size_t(-1)) {
+ if (ZDICT_isError(ret)) {
return "";
}
dprintf("Sampled %zu bytes in %zu blocks, built a dictionary of size %zu\n", dictionary_buf.size(), lengths.size(), ret);
return ht;
}
-DatabaseBuilder::DatabaseBuilder(const char *outfile, gid_t owner, int block_size, string dictionary)
+DatabaseBuilder::DatabaseBuilder(const char *outfile, gid_t owner, int block_size, string dictionary, bool check_visibility)
: outfile(outfile), block_size(block_size)
{
umask(0027);
hdr.max_version = 2;
hdr.filename_index_offset_bytes = -1;
hdr.zstd_dictionary_length_bytes = -1;
+ hdr.check_visibility = check_visibility;
fwrite(&hdr, sizeof(hdr), 1, outfp);
if (dictionary.empty()) {