The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) Facebook, Inc.
    3  * All rights reserved.
    4  *
    5  * This source code is licensed under both the BSD-style license (found in the
    6  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
    7  * in the COPYING file in the root directory of this source tree).
    8  * You may select, at your option, one of the above-listed licenses.
    9  */
   10 
   11 #include <stddef.h>   /* size_t */
   12 
   13 /******* EXPOSED TYPES ********************************************************/
   14 /*
   15 * Contains the parsed contents of a dictionary
   16 * This includes Huffman and FSE tables used for decoding and data on offsets
   17 */
   18 typedef struct dictionary_s dictionary_t;
   19 /******* END EXPOSED TYPES ****************************************************/
   20 
   21 /******* DECOMPRESSION FUNCTIONS **********************************************/
   22 /// Zstandard decompression functions.
   23 /// `dst` must point to a space at least as large as the reconstructed output.
   24 size_t ZSTD_decompress(void *const dst, const size_t dst_len,
   25                     const void *const src, const size_t src_len);
   26 
   27 /// If `dict != NULL` and `dict_len >= 8`, does the same thing as
   28 /// `ZSTD_decompress` but uses the provided dict
   29 size_t ZSTD_decompress_with_dict(void *const dst, const size_t dst_len,
   30                               const void *const src, const size_t src_len,
   31                               dictionary_t* parsed_dict);
   32 
   33 /// Get the decompressed size of an input stream so memory can be allocated in
   34 /// advance
   35 /// Returns -1 if the size can't be determined
   36 /// Assumes decompression of a single frame
   37 size_t ZSTD_get_decompressed_size(const void *const src, const size_t src_len);
   38 /******* END DECOMPRESSION FUNCTIONS ******************************************/
   39 
   40 /******* DICTIONARY MANAGEMENT ***********************************************/
   41 /*
   42  * Return a valid dictionary_t pointer for use with dictionary initialization
   43  * or decompression
   44  */
   45 dictionary_t* create_dictionary(void);
   46 
   47 /*
   48  * Parse a provided dictionary blob for use in decompression
   49  * `src` -- must point to memory space representing the dictionary
   50  * `src_len` -- must provide the dictionary size
   51  * `dict` -- will contain the parsed contents of the dictionary and
   52  *        can be used for decompression
   53  */
   54 void parse_dictionary(dictionary_t *const dict, const void *src,
   55                              size_t src_len);
   56 
   57 /*
   58  * Free internal Huffman tables, FSE tables, and dictionary content
   59  */
   60 void free_dictionary(dictionary_t *const dict);
   61 /******* END DICTIONARY MANAGEMENT *******************************************/

Cache object: 2d017ffc944935b22465e3f16d10c3c5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.