base: rename history_retain_length

It was renamed to dst_history_retain_length.

It also was removed from image_decoders and token_decoders. It only
applies to io_transformers, as retaining history applies to the
destination (not source) IO buffer.

Also adjust example/bzcat and example/zcat to apply the history retain
length to the dst (not src) buffer.
This commit is contained in:
Nigel Tao committed 2023-12-17 12:26:08 +11:00
1 parent b4e09690a7
commit eed1af7bee
34 files changed
+179 -640

No files matched your search

+5 -11
View File
@@ -340,7 +340,7 @@ redirect:
fourcc = 0;
break;
}
std::string error_message = input.CopyIn(&io_buf, 0);
std::string error_message = input.CopyIn(&io_buf);
if (!error_message.empty()) {
return DecodeImageResult(std::move(error_message));
}
@@ -436,9 +436,7 @@ redirect:
} else if (io_buf.meta.closed) {
return DecodeImageResult(DecodeImage_UnexpectedEndOfFile);
} else {
std::string error_message = input.CopyIn(
&io_buf,
image_decoder->history_retain_length().value_or(UINT64_MAX));
std::string error_message = input.CopyIn(&io_buf);
if (!error_message.empty()) {
return DecodeImageResult(std::move(error_message));
}
@@ -520,8 +518,7 @@ redirect:
} else if (io_buf.meta.closed) {
return DecodeImageResult(DecodeImage_UnexpectedEndOfFile);
} else {
std::string error_message = input.CopyIn(
&io_buf, image_decoder->history_retain_length().value_or(UINT64_MAX));
std::string error_message = input.CopyIn(&io_buf);
if (!error_message.empty()) {
return DecodeImageResult(std::move(error_message));
}
@@ -550,8 +547,7 @@ redirect:
message = DecodeImage_UnexpectedEndOfFile;
break;
} else {
std::string error_message = input.CopyIn(
&io_buf, image_decoder->history_retain_length().value_or(UINT64_MAX));
std::string error_message = input.CopyIn(&io_buf);
if (!error_message.empty()) {
message = std::move(error_message);
break;
@@ -579,9 +575,7 @@ redirect:
} else if (io_buf.meta.closed) {
return DecodeImageResult(DecodeImage_UnexpectedEndOfFile);
} else {
std::string error_message = input.CopyIn(
&io_buf,
image_decoder->history_retain_length().value_or(UINT64_MAX));
std::string error_message = input.CopyIn(&io_buf);
if (!error_message.empty()) {
return DecodeImageResult(std::move(error_message));
}