![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
#include <stdint.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include "zstd_decompress.h"Data Structures | |
| struct | ostream_t |
| struct | istream_t |
| struct | HUF_dtable |
| Structure containing all tables necessary for efficient Huffman decoding. More... | |
| struct | FSE_dtable |
| The tables needed to decode FSE encoded streams. More... | |
| struct | frame_header_t |
| struct | frame_context_t |
| The context needed to decode blocks in a frame. More... | |
| struct | dictionary_s |
| struct | sequence_command_t |
| struct | sequence_states_t |
| The combination of FSE states needed to decode sequences. More... | |
Macros | |
| #define | ZSTD_MAGIC_NUMBER 0xFD2FB528U |
| #define | ZSTD_BLOCK_SIZE_MAX ((size_t)128 * 1024) |
| #define | MAX_LITERALS_SIZE ZSTD_BLOCK_SIZE_MAX |
| #define | MAX(a, b) |
| #define | MIN(a, b) |
| #define | MESSAGE(...) |
| #define | ERROR(s) |
| #define | INP_SIZE() |
| #define | OUT_SIZE() |
| #define | CORRUPTION() |
| #define | BAD_ALLOC() |
| #define | IMPOSSIBLE() |
| #define | HUF_MAX_BITS (16) |
| #define | HUF_MAX_SYMBS (256) |
| #define | FSE_MAX_ACCURACY_LOG (15) |
| #define | FSE_MAX_SYMBS (256) |
| #define | DICT_SIZE_ERROR() |
| #define | NULL_SRC() |
Enumerations | |
| enum | seq_part_t { seq_literal_length = 0 , seq_offset = 1 , seq_match_length = 2 } |
| Different modes to signal to decode_seq_tables what to do. More... | |
| enum | seq_mode_t { seq_predefined = 0 , seq_rle = 1 , seq_fse = 2 , seq_repeat = 3 } |
Functions | |
| size_t | ZSTD_decompress (void *const dst, const size_t dst_len, const void *const src, const size_t src_len) |
| size_t | ZSTD_decompress_with_dict (void *const dst, const size_t dst_len, const void *const src, const size_t src_len, dictionary_t *parsed_dict) |
| size_t | ZSTD_get_decompressed_size (const void *src, const size_t src_len) |
| dictionary_t * | create_dictionary () |
| void | free_dictionary (dictionary_t *const dict) |
| Free an allocated dictionary. | |
| void | parse_dictionary (dictionary_t *const dict, const void *src, size_t src_len) |
| #define BAD_ALLOC | ( | ) |
| #define CORRUPTION | ( | ) |
| #define DICT_SIZE_ERROR | ( | ) |
| #define ERROR | ( | s | ) |
This decoder calls exit(1) when it encounters an error, however a production library should propagate error codes
| #define FSE_MAX_ACCURACY_LOG (15) |
For more description of FSE see https://github.com/Cyan4973/FiniteStateEntropy/
| #define FSE_MAX_SYMBS (256) |
| #define HUF_MAX_BITS (16) |
| #define HUF_MAX_SYMBS (256) |
| #define IMPOSSIBLE | ( | ) |
| #define INP_SIZE | ( | ) |
| #define MAX_LITERALS_SIZE ZSTD_BLOCK_SIZE_MAX |
| #define MESSAGE | ( | ... | ) |
| #define NULL_SRC | ( | ) |
| #define OUT_SIZE | ( | ) |
| #define ZSTD_BLOCK_SIZE_MAX ((size_t)128 * 1024) |
| #define ZSTD_MAGIC_NUMBER 0xFD2FB528U |
Zstandard educational decoder implementation See https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md
| enum seq_mode_t |
| enum seq_part_t |
| dictionary_t * create_dictionary | ( | void | ) |
| void free_dictionary | ( | dictionary_t *const | dict | ) |
Free an allocated dictionary.
| void parse_dictionary | ( | dictionary_t *const | dict, |
| const void * | src, | ||
| size_t | src_len ) |
| size_t ZSTD_decompress | ( | void *const | dst, |
| const size_t | dst_len, | ||
| const void *const | src, | ||
| const size_t | src_len ) |
Zstandard decompression functions. dst must point to a space at least as large as the reconstructed output.
For the case where the decompression library hasn't been included we add a dummy function to fake the process and stop the buffers being optimised out.
| size_t ZSTD_decompress_with_dict | ( | void *const | dst, |
| const size_t | dst_len, | ||
| const void *const | src, | ||
| const size_t | src_len, | ||
| dictionary_t * | parsed_dict ) |
If dict != NULL and dict_len >= 8, does the same thing as ZSTD_decompress but uses the provided dict