diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-06 15:14:30 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-06 15:14:30 +0300 |
commit | 0a31ed9d5e3cde4feb094b66f3a8b2c074605d84 (patch) | |
tree | 571b741cc155767f3c5e0ee0a0a686995568b16a /src/liblzma/common/stream_decoder.c | |
parent | Added support for raw encoding and decoding to the command (diff) | |
download | xz-0a31ed9d5e3cde4feb094b66f3a8b2c074605d84.tar.xz |
Some API cleanups
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/common/stream_decoder.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c index cf7af7ac..7d1df9cc 100644 --- a/src/liblzma/common/stream_decoder.c +++ b/src/liblzma/common/stream_decoder.c @@ -55,14 +55,14 @@ struct lzma_coder_s { /// If true, LZMA_NO_CHECK is returned if the Stream has /// no integrity check. - bool warn_no_check; + bool tell_no_check; /// If true, LZMA_UNSUPPORTED_CHECK is returned if the Stream has /// an integrity check that isn't supported by this liblzma build. - bool warn_unsupported_check; + bool tell_unsupported_check; - /// If true, LZMA_SEE_CHECK is returned after decoding Stream Header. - bool tell_check; + /// If true, LZMA_GET_CHECK is returned after decoding Stream Header. + bool tell_any_check; /// If true, we will decode concatenated Streams that possibly have /// Stream Padding between or after them. LZMA_STREAM_END is returned @@ -141,17 +141,17 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator, // Detect if there's no integrity check or if it is // unsupported if those were requested by the application. - if (coder->warn_no_check && coder->stream_flags.check + if (coder->tell_no_check && coder->stream_flags.check == LZMA_CHECK_NONE) return LZMA_NO_CHECK; - if (coder->warn_unsupported_check + if (coder->tell_unsupported_check && !lzma_check_is_supported( coder->stream_flags.check)) return LZMA_UNSUPPORTED_CHECK; - if (coder->tell_check) - return LZMA_SEE_CHECK; + if (coder->tell_any_check) + return LZMA_GET_CHECK; } // Fall through @@ -366,7 +366,7 @@ stream_decoder_end(lzma_coder *coder, lzma_allocator *allocator) static lzma_check -stream_decoder_see_check(const lzma_coder *coder) +stream_decoder_get_check(const lzma_coder *coder) { return coder->stream_flags.check; } @@ -388,19 +388,18 @@ lzma_stream_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, next->code = &stream_decode; next->end = &stream_decoder_end; - next->see_check = &stream_decoder_see_check; + next->get_check = &stream_decoder_get_check; next->coder->block_decoder = LZMA_NEXT_CODER_INIT; next->coder->index_hash = NULL; } next->coder->memlimit = memlimit; - next->coder->warn_no_check = (flags & LZMA_WARN_NO_CHECK) != 0; - next->coder->warn_unsupported_check - = (flags & LZMA_WARN_UNSUPPORTED_CHECK) != 0; - next->coder->tell_check = (flags & LZMA_TELL_CHECK) != 0; - next->coder->concatenated - = (flags & LZMA_CONCATENATED) != 0; + next->coder->tell_no_check = (flags & LZMA_TELL_NO_CHECK) != 0; + next->coder->tell_unsupported_check + = (flags & LZMA_TELL_UNSUPPORTED_CHECK) != 0; + next->coder->tell_any_check = (flags & LZMA_TELL_ANY_CHECK) != 0; + next->coder->concatenated = (flags & LZMA_CONCATENATED) != 0; return stream_decoder_reset(next->coder, allocator); } |