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/lib/deprecated/zbuff_decompress.c

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) Yann Collet, 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 
   12 
   13 /* *************************************
   14 *  Dependencies
   15 ***************************************/
   16 #define ZBUFF_STATIC_LINKING_ONLY
   17 #include "zbuff.h"
   18 
   19 
   20 ZBUFF_DCtx* ZBUFF_createDCtx(void)
   21 {
   22     return ZSTD_createDStream();
   23 }
   24 
   25 ZBUFF_DCtx* ZBUFF_createDCtx_advanced(ZSTD_customMem customMem)
   26 {
   27     return ZSTD_createDStream_advanced(customMem);
   28 }
   29 
   30 size_t ZBUFF_freeDCtx(ZBUFF_DCtx* zbd)
   31 {
   32     return ZSTD_freeDStream(zbd);
   33 }
   34 
   35 
   36 /* *** Initialization *** */
   37 
   38 size_t ZBUFF_decompressInitDictionary(ZBUFF_DCtx* zbd, const void* dict, size_t dictSize)
   39 {
   40     return ZSTD_initDStream_usingDict(zbd, dict, dictSize);
   41 }
   42 
   43 size_t ZBUFF_decompressInit(ZBUFF_DCtx* zbd)
   44 {
   45     return ZSTD_initDStream(zbd);
   46 }
   47 
   48 
   49 /* *** Decompression *** */
   50 
   51 size_t ZBUFF_decompressContinue(ZBUFF_DCtx* zbd,
   52                                 void* dst, size_t* dstCapacityPtr,
   53                           const void* src, size_t* srcSizePtr)
   54 {
   55     ZSTD_outBuffer outBuff;
   56     ZSTD_inBuffer inBuff;
   57     size_t result;
   58     outBuff.dst  = dst;
   59     outBuff.pos  = 0;
   60     outBuff.size = *dstCapacityPtr;
   61     inBuff.src  = src;
   62     inBuff.pos  = 0;
   63     inBuff.size = *srcSizePtr;
   64     result = ZSTD_decompressStream(zbd, &outBuff, &inBuff);
   65     *dstCapacityPtr = outBuff.pos;
   66     *srcSizePtr = inBuff.pos;
   67     return result;
   68 }
   69 
   70 
   71 /* *************************************
   72 *  Tool functions
   73 ***************************************/
   74 size_t ZBUFF_recommendedDInSize(void)  { return ZSTD_DStreamInSize(); }
   75 size_t ZBUFF_recommendedDOutSize(void) { return ZSTD_DStreamOutSize(); }

Cache object: 5c3e590e35f77a21643ebdbf1948f4fd


[ 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.