003 File Manager
Current Path:
/usr/src/contrib/xz/src/liblzma/common
usr
/
src
/
contrib
/
xz
/
src
/
liblzma
/
common
/
📁
..
📄
alone_decoder.c
(5.53 KB)
📄
alone_decoder.h
(601 B)
📄
alone_encoder.c
(3.66 KB)
📄
auto_decoder.c
(4.79 KB)
📄
block_buffer_decoder.c
(2.31 KB)
📄
block_buffer_encoder.c
(9.89 KB)
📄
block_buffer_encoder.h
(763 B)
📄
block_decoder.c
(6.82 KB)
📄
block_decoder.h
(576 B)
📄
block_encoder.c
(5.63 KB)
📄
block_encoder.h
(1.85 KB)
📄
block_header_decoder.c
(3.62 KB)
📄
block_header_encoder.c
(3.27 KB)
📄
block_util.c
(2.58 KB)
📄
common.c
(10.4 KB)
📄
common.h
(10.22 KB)
📄
easy_buffer_encoder.c
(840 B)
📄
easy_decoder_memusage.c
(668 B)
📄
easy_encoder.c
(678 B)
📄
easy_encoder_memusage.c
(654 B)
📄
easy_preset.c
(727 B)
📄
easy_preset.h
(921 B)
📄
filter_buffer_decoder.c
(2.45 KB)
📄
filter_buffer_encoder.c
(1.5 KB)
📄
filter_common.c
(8.5 KB)
📄
filter_common.h
(1.23 KB)
📄
filter_decoder.c
(4.32 KB)
📄
filter_decoder.h
(617 B)
📄
filter_encoder.c
(7.17 KB)
📄
filter_encoder.h
(732 B)
📄
filter_flags_decoder.c
(1.16 KB)
📄
filter_flags_encoder.c
(1.37 KB)
📄
hardware_cputhreads.c
(526 B)
📄
hardware_physmem.c
(683 B)
📄
index.c
(34.61 KB)
📄
index.h
(1.93 KB)
📄
index_decoder.c
(8.4 KB)
📄
index_encoder.c
(5.72 KB)
📄
index_encoder.h
(584 B)
📄
index_hash.c
(8.77 KB)
📄
memcmplen.h
(4.71 KB)
📄
outqueue.c
(4.48 KB)
📄
outqueue.h
(4.88 KB)
📄
stream_buffer_decoder.c
(2.72 KB)
📄
stream_buffer_encoder.c
(3.96 KB)
📄
stream_decoder.c
(12.7 KB)
📄
stream_decoder.h
(599 B)
📄
stream_encoder.c
(9.63 KB)
📄
stream_encoder_mt.c
(29.64 KB)
📄
stream_flags_common.c
(1.29 KB)
📄
stream_flags_common.h
(883 B)
📄
stream_flags_decoder.c
(2.23 KB)
📄
stream_flags_encoder.c
(2.01 KB)
📄
vli_decoder.c
(2.5 KB)
📄
vli_encoder.c
(1.89 KB)
📄
vli_size.c
(630 B)
Editing: filter_decoder.c
/////////////////////////////////////////////////////////////////////////////// // /// \file filter_decoder.c /// \brief Filter ID mapping to filter-specific functions // // Author: Lasse Collin // // This file has been put into the public domain. // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// #include "filter_decoder.h" #include "filter_common.h" #include "lzma_decoder.h" #include "lzma2_decoder.h" #include "simple_decoder.h" #include "delta_decoder.h" typedef struct { /// Filter ID lzma_vli id; /// Initializes the filter encoder and calls lzma_next_filter_init() /// for filters + 1. lzma_init_function init; /// Calculates memory usage of the encoder. If the options are /// invalid, UINT64_MAX is returned. uint64_t (*memusage)(const void *options); /// Decodes Filter Properties. /// /// \return - LZMA_OK: Properties decoded successfully. /// - LZMA_OPTIONS_ERROR: Unsupported properties /// - LZMA_MEM_ERROR: Memory allocation failed. lzma_ret (*props_decode)( void **options, const lzma_allocator *allocator, const uint8_t *props, size_t props_size); } lzma_filter_decoder; static const lzma_filter_decoder decoders[] = { #ifdef HAVE_DECODER_LZMA1 { .id = LZMA_FILTER_LZMA1, .init = &lzma_lzma_decoder_init, .memusage = &lzma_lzma_decoder_memusage, .props_decode = &lzma_lzma_props_decode, }, #endif #ifdef HAVE_DECODER_LZMA2 { .id = LZMA_FILTER_LZMA2, .init = &lzma_lzma2_decoder_init, .memusage = &lzma_lzma2_decoder_memusage, .props_decode = &lzma_lzma2_props_decode, }, #endif #ifdef HAVE_DECODER_X86 { .id = LZMA_FILTER_X86, .init = &lzma_simple_x86_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_POWERPC { .id = LZMA_FILTER_POWERPC, .init = &lzma_simple_powerpc_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_IA64 { .id = LZMA_FILTER_IA64, .init = &lzma_simple_ia64_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_ARM { .id = LZMA_FILTER_ARM, .init = &lzma_simple_arm_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_ARMTHUMB { .id = LZMA_FILTER_ARMTHUMB, .init = &lzma_simple_armthumb_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_SPARC { .id = LZMA_FILTER_SPARC, .init = &lzma_simple_sparc_decoder_init, .memusage = NULL, .props_decode = &lzma_simple_props_decode, }, #endif #ifdef HAVE_DECODER_DELTA { .id = LZMA_FILTER_DELTA, .init = &lzma_delta_decoder_init, .memusage = &lzma_delta_coder_memusage, .props_decode = &lzma_delta_props_decode, }, #endif }; static const lzma_filter_decoder * decoder_find(lzma_vli id) { for (size_t i = 0; i < ARRAY_SIZE(decoders); ++i) if (decoders[i].id == id) return decoders + i; return NULL; } extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id) { return decoder_find(id) != NULL; } extern lzma_ret lzma_raw_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *options) { return lzma_raw_coder_init(next, allocator, options, (lzma_filter_find)(&decoder_find), false); } extern LZMA_API(lzma_ret) lzma_raw_decoder(lzma_stream *strm, const lzma_filter *options) { lzma_next_strm_init(lzma_raw_decoder_init, strm, options); strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_FINISH] = true; return LZMA_OK; } extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters) { return lzma_raw_coder_memusage( (lzma_filter_find)(&decoder_find), filters); } extern LZMA_API(lzma_ret) lzma_properties_decode(lzma_filter *filter, const lzma_allocator *allocator, const uint8_t *props, size_t props_size) { // Make it always NULL so that the caller can always safely free() it. filter->options = NULL; const lzma_filter_decoder *const fd = decoder_find(filter->id); if (fd == NULL) return LZMA_OPTIONS_ERROR; if (fd->props_decode == NULL) return props_size == 0 ? LZMA_OK : LZMA_OPTIONS_ERROR; return fd->props_decode( &filter->options, allocator, props, props_size); }
Upload File
Create Folder