Drop all duplicate newlines. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
};
-
static void blake2b_set_lastnode( blake2b_state *S )
{
S->f[1] = (uint64_t)-1;
return 0;
}
-
-
int blake2b_init( blake2b_state *S, size_t outlen )
{
blake2b_param P[1];
return blake2b_init_param( S, P );
}
-
int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
{
blake2b_param P[1];
/*--- Compression stuff ---*/
/*---------------------------------------------------*/
-
/*---------------------------------------------------*/
#ifndef BZ_NO_STDIO
void BZ2_bz__AssertH__fail ( int errcode )
}
#endif
-
/*---------------------------------------------------*/
static
int bz_config_ok ( void )
return 1;
}
-
/*---------------------------------------------------*/
static
void* default_bzalloc ( void* opaque, Int32 items, Int32 size )
s->blockNo++;
}
-
/*---------------------------------------------------*/
static
void init_RL ( EState* s )
s->state_in_len = 0;
}
-
static
Bool isempty_RL ( EState* s )
{
return BZ_OK;
}
-
/*---------------------------------------------------*/
static
void add_pair_to_block ( EState* s )
}
}
-
/*---------------------------------------------------*/
static
void flush_RL ( EState* s )
init_RL ( s );
}
-
/*---------------------------------------------------*/
#define ADD_CHAR_TO_BLOCK(zs,zchh0) \
{ \
} \
}
-
/*---------------------------------------------------*/
static
Bool copy_input_until_stop ( EState* s )
return progress_in;
}
-
/*---------------------------------------------------*/
static
Bool copy_output_until_stop ( EState* s )
return progress_out;
}
-
/*---------------------------------------------------*/
static
Bool handle_compress ( bz_stream* strm )
return progress_in || progress_out;
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
{
return BZ_OK; /*--not reached--*/
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
{
return BZ_OK;
}
-
/*---------------------------------------------------*/
static
void unRLE_obuf_to_output_FAST ( DState* s )
/* can a new run be started? */
if (s->nblock_used == s->save_nblock+1) return;
-
s->state_out_len = 1;
s->state_out_ch = s->k0;
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
}
}
-
/*---------------------------------------------------*/
__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
{
return nb;
}
-
/*---------------------------------------------------*/
static
void unRLE_obuf_to_output_SMALL ( DState* s )
/* can a new run be started? */
if (s->nblock_used == s->save_nblock+1) return;
-
s->state_out_len = 1;
s->state_out_ch = s->k0;
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
}
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
{
return 0; /*NOTREACHED*/
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
{
return BZ_OK;
}
-
#ifndef BZ_NO_STDIO
/*---------------------------------------------------*/
/*--- File I/O stuff ---*/
}
bzFile;
-
/*---------------------------------------------*/
static Bool myfeof ( FILE* f )
{
return False;
}
-
/*---------------------------------------------------*/
BZFILE* BZ_API(BZ2_bzWriteOpen)
( int* bzerror,
return bzf;
}
-
/*---------------------------------------------------*/
void BZ_API(BZ2_bzWrite)
( int* bzerror,
}
}
-
/*---------------------------------------------------*/
void BZ_API(BZ2_bzWriteClose)
( int* bzerror,
nbytes_in, NULL, nbytes_out, NULL );
}
-
void BZ_API(BZ2_bzWriteClose64)
( int* bzerror,
BZFILE* b,
free ( bzf );
}
-
/*---------------------------------------------------*/
BZFILE* BZ_API(BZ2_bzReadOpen)
( int* bzerror,
return bzf;
}
-
/*---------------------------------------------------*/
void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
{
free ( bzf );
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzRead)
( int* bzerror,
return 0; /*not reached*/
}
-
/*---------------------------------------------------*/
void BZ_API(BZ2_bzReadGetUnused)
( int* bzerror,
}
#endif
-
/*---------------------------------------------------*/
/*--- Misc convenience stuff ---*/
/*---------------------------------------------------*/
return ret;
}
-
/*---------------------------------------------------*/
/*--
Code contributed by Yoshioka Tsuneo
return BZ_VERSION;
}
-
#ifndef BZ_NO_STDIO
/*---------------------------------------------------*/
return bzfp;
}
-
/*---------------------------------------------------*/
/*--
open file for read or write.
return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);
}
-
/*---------------------------------------------------*/
BZFILE * BZ_API(BZ2_bzdopen)
( int fd,
return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )
{
}
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )
{
}
}
-
/*---------------------------------------------------*/
int BZ_API(BZ2_bzflush) (BZFILE *b)
{
return 0;
}
-
/*---------------------------------------------------*/
void BZ_API(BZ2_bzclose) (BZFILE* b)
{
}
}
-
/*---------------------------------------------------*/
/*--
return last error code
,"???" /* for future */
};
-
const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
{
int err = ((bzFile *)b)->lastErr;
}
}
-
/*---------------------------------------------*/
#define fswap(zz1, zz2) \
{ Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
} \
}
-
#define fmin(a,b) ((a) < (b)) ? (a) : (b)
#define fpush(lz,hz) { stackLo[sp] = lz; \
#define FALLBACK_QSORT_SMALL_THRESH 10
#define FALLBACK_QSORT_STACK_SIZE 100
-
static
void fallbackQSort3 ( UInt32* fmap,
UInt32* eclass,
#undef FALLBACK_QSORT_SMALL_THRESH
#undef FALLBACK_QSORT_STACK_SIZE
-
/*---------------------------------------------*/
/* Pre:
nblock > 0
#undef WORD_BH
#undef UNALIGNED_BH
-
/*---------------------------------------------*/
/*--- The main, O(N^2 log(N)) sorting ---*/
/*--- algorithm. Faster for "normal" ---*/
return False;
}
-
/*---------------------------------------------*/
/*--
Knuth's increments seem to work better
}
}
-
/*---------------------------------------------*/
/*--
The following is an implementation of
hz = stackHi[sp]; \
dz = stackD [sp]; }
-
#define mnextsize(az) (nextHi[az]-nextLo[az])
#define mnextswap(az,bz) \
tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \
tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; }
-
#define MAIN_QSORT_SMALL_THRESH 20
#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT)
#define MAIN_QSORT_STACK_SIZE 100
#undef MAIN_QSORT_DEPTH_THRESH
#undef MAIN_QSORT_STACK_SIZE
-
/*---------------------------------------------*/
/* Pre:
nblock > N_OVERSHOOT
#undef SETMASK
#undef CLEARMASK
-
/*---------------------------------------------*/
/* Pre:
nblock > 0
AssertH( s->origPtr != -1, 1003 );
}
-
/*-------------------------------------------------------------*/
/*--- end blocksort.c ---*/
/*-------------------------------------------------------------*/
s->bsBuff = 0;
}
-
/*---------------------------------------------------*/
static
void bsFinishWrite ( EState* s )
}
}
-
/*---------------------------------------------------*/
#define bsNEEDW(nz) \
{ \
} \
}
-
/*---------------------------------------------------*/
static
__inline__
s->bsLive += n;
}
-
/*---------------------------------------------------*/
static
void bsPutUInt32 ( EState* s, UInt32 u )
bsW ( s, 8, u & 0xffL );
}
-
/*---------------------------------------------------*/
static
void bsPutUChar ( EState* s, UChar c )
bsW( s, 8, (UInt32)c );
}
-
/*---------------------------------------------------*/
/*--- The back end proper ---*/
/*---------------------------------------------------*/
}
}
-
/*---------------------------------------------------*/
static
void generateMTFValues ( EState* s )
s->nMTF = wr;
}
-
/*---------------------------------------------------*/
#define BZ_LESSER_ICOST 0
#define BZ_GREATER_ICOST 15
Made global to keep stack frame size small.
--*/
-
UInt16 cost[BZ_N_GROUPS];
Int32 fave[BZ_N_GROUPS];
alphaSize, 17 /*20*/ );
}
-
AssertH( nGroups < 8, 3002 );
AssertH( nSelectors < 32768 &&
nSelectors <= (2 + (900000 / BZ_G_SIZE)),
3003 );
-
/*--- Compute MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;
}
}
-
gs = ge+1;
selCtr++;
}
VPrintf1( "codes %d\n", s->numZ-nBytes );
}
-
/*---------------------------------------------------*/
void BZ2_compressBlock ( EState* s, Bool is_last_block )
{
sendMTFValues ( s );
}
-
/*-- If this is the last block, add the stream trailer. --*/
if (is_last_block) {
}
}
-
/*-------------------------------------------------------------*/
/*--- end compress.c ---*/
/*-------------------------------------------------------------*/
For more information on these sources, see the manual.
--*/
-
#include "bzlib_private.h"
/*--
0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L
};
-
/*-------------------------------------------------------------*/
/*--- end crctable.c ---*/
/*-------------------------------------------------------------*/
For more information on these sources, see the manual.
--*/
-
#include "bzlib_private.h"
-
/*---------------------------------------------------*/
static
void makeMaps_d ( DState* s )
}
}
-
/*---------------------------------------------------*/
#define RETURN(rrr) \
{ retVal = rrr; goto save_state_and_return; };
lval = gPerm[zvec - gBase[zn]]; \
}
-
/*---------------------------------------------------*/
Int32 BZ2_decompress ( DState* s )
{
RETURN(BZ_OK);
-
endhdr_2:
GET_UCHAR(BZ_X_ENDHDR_2, uc);
return retVal;
}
-
/*-------------------------------------------------------------*/
/*--- end decompress.c ---*/
/*-------------------------------------------------------------*/
For more information on these sources, see the manual.
--*/
-
#include "bzlib_private.h"
/*---------------------------------------------------*/
heap[zz] = tmp; \
}
-
/*---------------------------------------------------*/
void BZ2_hbMakeCodeLengths ( UChar *len,
Int32 *freq,
}
}
-
/*---------------------------------------------------*/
void BZ2_hbAssignCodes ( Int32 *code,
UChar *length,
}
}
-
/*---------------------------------------------------*/
void BZ2_hbCreateDecodeTables ( Int32 *limit,
Int32 *base,
base[i] = ((limit[i-1] + 1) << 1) - base[i];
}
-
/*-------------------------------------------------------------*/
/*--- end huffman.c ---*/
/*-------------------------------------------------------------*/
For more information on these sources, see the manual.
--*/
-
#ifndef _BZLIB_PRIVATE_H
#define _BZLIB_PRIVATE_H
#include <string.h>
#endif
-
/*-- General stuff. --*/
#define BZ_VERSION "1.0.2, 30-Dec-2001"
#define VPrintf5(zf,za1,za2,za3,za4,za5) /* */
#endif
-
#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)
#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp))
-
/*-- Header bytes. --*/
#define BZ_HDR_B 0x42 /* 'B' */
#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))
-
/*-- Stuff for randomising repetitive blocks. --*/
extern Int32 BZ2_rNums[512];
} \
s->rNToGo--;
-
/*-- Stuff for doing CRCs. --*/
extern UInt32 BZ2_crc32Table[256];
((UChar)cha)]; \
}
-
/*-- States and modes for compression. --*/
#define BZ_M_IDLE 1
#define BZ_N_SHELL 18
#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)
-
/*-- Structure holding all the compression-side stuff. --*/
typedef
}
EState;
-
/*-- externs for compression. --*/
extern void
extern void
BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
-
/*-- states for decompression. --*/
#define BZ_X_IDLE 1
#define BZ_X_CCRC_3 49
#define BZ_X_CCRC_4 50
-
/*-- Constants for the fast MTF decoder. --*/
#define MTFA_SIZE 4096
#define MTFL_SIZE 16
-
/*-- Structure holding all the decompression-side stuff. --*/
typedef
}
DState;
-
/*-- Macros for decompression. --*/
#define BZ_GET_FAST(cccc) \
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
s->tPos = GET_LL(s->tPos);
-
/*-- externs for decompression. --*/
extern Int32
BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
Int32, Int32, Int32 );
-
#endif
-
/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
#ifdef BZ_NO_STDIO
#endif
#endif
-
/*-------------------------------------------------------------*/
/*--- end bzlib_private.h ---*/
/*-------------------------------------------------------------*/
For more information on these sources, see the manual.
--*/
-
#include "bzlib_private.h"
-
/*---------------------------------------------*/
Int32 BZ2_rNums[512] = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
936, 638
};
-
/*-------------------------------------------------------------*/
/*--- end randtable.c ---*/
/*-------------------------------------------------------------*/
#include <circbuf.h>
-
int buf_init (circbuf_t * buf, unsigned int size)
{
assert (buf != NULL);
#include <linux/types.h>
#include <linux/crc7.h>
-
/* Table for CRC-7 (polynomial x^7 + x^3 + 1) */
const u8 crc7_syndrome_table[256] = {
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f,
static_assert (sizeof (struct sha256_buffer) <= ALG_SPECIFIC_SIZE,
"ALG_SPECIFIC_SIZE is too small for SHA256");
-
/* Use this instead of including errno.h */
static int errno;
static_assert (sizeof (struct sha512_buffer) <= ALG_SPECIFIC_SIZE,
"ALG_SPECIFIC_SIZE is too small for SHA512");
-
/* Use this instead of including errno.h */
static int errno;
***************************************************************************
*/
-
/* Compiler and system dependent definitions: */
#ifndef TIME
} variant;
} Rec_Type, *Rec_Pointer;
-
/*
* dhry() - run dhrystone for a given number of iterations
*
void Proc_4 (void);
void Proc_5 (void);
-
extern Boolean Func_2(Str_30, Str_30);
extern void Proc_6(Enumeration, Enumeration *);
extern void Proc_7(One_Fifty, One_Fifty, One_Fifty *);
#endif /* SELF_TIMED */
}
-
void Proc_1 (REG Rec_Pointer Ptr_Val_Par)
/* executed once */
{
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
} /* Proc_1 */
-
void Proc_2 (One_Fifty *Int_Par_Ref)
/* executed once */
/* *Int_Par_Ref == 1, becomes 4 */
while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
-
void Proc_3 (Rec_Pointer *Ptr_Ref_Par)
/* executed once */
/* Ptr_Ref_Par becomes Ptr_Glob */
Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
} /* Proc_3 */
-
void Proc_4 (void) /* without parameters */
/* executed once */
{
Bool_Glob = false;
} /* Proc_5 */
-
/* Procedure for the assignment of structures, */
/* if the C compiler doesn't support this feature */
#ifdef NOSTRUCTASSIGN
*Int_Par_Ref = Int_2_Par_Val + Int_Loc;
} /* Proc_7 */
-
void Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
/*********************************************************************/
/* executed once */
Int_Glob = 5;
} /* Proc_8 */
-
Enumeration Func_1 (Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val)
/*************************************************/
/* executed three times */
}
} /* Func_1 */
-
-
Boolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
/*************************************************/
/* executed once */
} /* if Ch_Loc */
} /* Func_2 */
-
Boolean Func_3 (Enum_Par_Val)
/***************************/
/* executed once */
return EFI_INVALID_PARAMETER;
}
-
/* Obtain the update_index from the platform */
status = fwu_plat_get_update_index(&update_index);
if (status < 0) {
return EFI_EXIT(ret);
}
-
/**
* efi_cin_reset() - drain the input buffer
*
log_debug("Message digest doesn't match\n");
}
-
/* last resort try the image sha256 hash in db */
if (!ret && efi_signature_lookup_digest(regs, db, false))
ret = true;
}
#endif /* CONFIG_EFI_SECURE_BOOT */
-
/**
* efi_check_pe() - check if a memory buffer contains a PE-COFF image
*
log_err("Invalid EFI variable seed\n");
}
-
return efi_init_secure_state();
}
return EFI_ST_FAILURE;
}
-
return EFI_ST_SUCCESS;
}
return EFI_ST_SUCCESS;
}
-
EFI_UNIT_TEST(ecpt) = {
.name = "conformance profile table",
.phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
return EFI_SUCCESS;
}
-
/*
* load_file2() - LoadFile() service of a EFI_LOAD_FILE2_PROTOCOL
*
if (!gzip && !lzo)
return -EBADMSG;
-
if (CONFIG_IS_ENABLED(MULTI_DTB_FIT_DYN_ALLOC)) {
dst = malloc(sz_out);
if (!dst) {
if (!err)
goto ret_mdata;
-
/* else read, verify and, if needed, fix mdata */
for (int i = 0; i < 2; i++) {
parts_ok[i] = false;
struct env_entry entry;
};
-
static void _hdelete(const char *key, struct hsearch_data *htab,
struct env_entry *ep, int idx);
return 1;
}
-
/*
* hdestroy()
*/
return 0;
}
-
/*
* hdelete()
*/
}
#endif
-
/*
* himport()
*/
/* Block size in bytes of a SHA-256 digest. */
#define AVB_SHA256_BLOCK_SIZE 64
-
/* Block size in bytes of a SHA-512 digest. */
#define AVB_SHA512_BLOCK_SIZE 128
do { LZ4_copy8(d,s); d+=8; s+=8; } while (d<e);
}
-
/**************************************
* Common Constants
**************************************/
#define TREE_DECODE_CHECK(probs, limit, i) \
{ i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
-
#define kNumPosBitsMax 4
#define kNumPosStatesMax (1 << kNumPosBitsMax)
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
-
#define kNumStates 12
#define kNumLitStates 7
return res;
}
-
static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
{
p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
#define CLzmaProb UInt16
#endif
-
/* ---------- LZMA Properties ---------- */
#define LZMA_PROPS_SIZE 5
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
-
/* ---------- LZMA Decoder state ---------- */
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
/* ELzmaStatus is used only as output value for function call */
-
/* ---------- Interfaces ---------- */
/* There are 3 levels of interfaces:
You can select any of these interfaces, but don't mix functions from different
groups for same object. */
-
/* There are two variants to allocate state for Dictionary Interface:
1) LzmaDec_Allocate / LzmaDec_Free
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
-
/* ---------- Buffer Interface ---------- */
/* It's zlib-like interface.
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
-
/* ---------- One Call Interface ---------- */
/* LzmaDecode
#define True 1
#define False 0
-
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#endif
-
/* The following interfaces use first parameter as pointer to structure */
typedef struct
#define HEADER_HAS_FILTER 0x00000800L
-
bool lzop_is_valid_header(const unsigned char *src)
{
int i;
MD5Final(output, &context);
}
-
/*
* Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
* 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
#include <linux/ctype.h>
#include <malloc.h>
-
/**
* strncasecmp - Case insensitive, length-limited string comparison
* @s1: One string
*/
#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
-
/* ===========================================================================
* Insert string str in the dictionary and set match_head to the previous head
* of the hash chain (the most recent string with same hash key). Return
deflate_state *ds;
deflate_state *ss;
-
if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
return Z_STREAM_ERROR;
}
#define FINISH_STATE 666
/* Stream status */
-
/* Data structure describing a single value and its code string. */
typedef struct ct_data_s {
union {
*/
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1.
}
#endif /* DEBUG */
-
/* the arguments must not have side effects */
/* ===========================================================================
#define SMALLEST 1
/* Index within the heap array of least frequent node in the Huffman tree */
-
/* ===========================================================================
* Remove the smallest element from the heap and recreate the heap with
* one less element. Updates heap and heap_len.
# define Tracecv(c,x)
#endif
-
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr, unsigned size));
#include "debug.h" /* assert(), DEBUGLOG(), RAWLOG() */
#include "error_private.h" /* error codes and messages */
-
/*=========================================
* Target specific
=========================================*/
#define STREAM_ACCUMULATOR_MIN_64 57
#define STREAM_ACCUMULATOR_MIN ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
-
/*-******************************************
* bitStream encoding API (write forward)
********************************************/
* If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable)
*/
-
/*-********************************************
* bitStream decoding API (read backward)
**********************************************/
MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
-
/* Start by invoking BIT_initDStream().
* A chunk of the bitStream is then stored into a local register.
* Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).
* Checking if DStream has reached its end can be performed with BIT_endOfDStream().
*/
-
/*-****************************************
* unsafe API
******************************************/
MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);
/* faster, but works only if nbBits >= 1 */
-
-
/*-**************************************************************
* Internal functions
****************************************************************/
return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
-
/*-********************************************************
* bitStream decoding
**********************************************************/
return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
-
#endif /* BITSTREAM_H_MODULE */
/* force no inlining */
#define FORCE_NOINLINE static __attribute__((__noinline__))
-
/* target attribute */
#define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
/*Like DYNAMIC_BMI2 but for compile time determination of BMI2 support*/
-
/* compile time determination of SIMD support */
/* C-language Attributes are added in C23. */
* Sanitizer
*****************************************************************/
-
-
#endif /* ZSTD_COMPILER_H */
#include "mem.h"
-
typedef struct {
U32 f1c;
U32 f1d;
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
/*
* This module only hosts one global variable
* which can be used to dynamically influence the verbosity of traces,
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
/*
* The purpose of this header is to enable debug functions.
* They regroup assert(), DEBUGLOG() and RAWLOG() for run-time,
#ifndef DEBUG_H_12987983217
#define DEBUG_H_12987983217
-
-
/* static assert is triggered at compile time, leaving no runtime artefact.
* static assert only works with compile-time constants.
* Also, this variant can only be used inside a function. */
#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
-
/* DEBUGLEVEL is expected to be defined externally,
* typically through compiler command line.
* Value must be a number. */
# define DEBUGLEVEL 0
#endif
-
/* recommended values for DEBUGLEVEL :
* 0 : release mode, no debug, all run-time checks disabled
* 1 : enables assert() only, no display
# define DEBUGLOG(l, ...) {} /* disabled */
#endif
-
-
#endif /* DEBUG_H_12987983217 */
#define HUF_STATIC_LINKING_ONLY /* HUF_TABLELOG_ABSOLUTEMAX */
#include "huf.h"
-
/*=== Version ===*/
unsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; }
-
/*=== Error Management ===*/
unsigned FSE_isError(size_t code) { return ERR_isError(code); }
const char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }
unsigned HUF_isError(size_t code) { return ERR_isError(code); }
const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }
-
/*-**************************************************************
* FSE NCount encoding-decoding
****************************************************************/
return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
}
-
/*! HUF_readStats() :
Read compact Huffman tree, saved by HUF_writeCTable().
`huffWeight` is destination buffer.
#ifndef ERROR_H_MODULE
#define ERROR_H_MODULE
-
-
/* ****************************************
* Dependencies
******************************************/
#include "debug.h"
#include "zstd_deps.h" /* size_t */
-
/* ****************************************
* Compiler-specific
******************************************/
#define ERR_STATIC static __attribute__((unused))
-
/*-****************************************
* Customization (error_public.h)
******************************************/
typedef ZSTD_ErrorCode ERR_enum;
#define PREFIX(name) ZSTD_error_##name
-
/*-****************************************
* Error codes handling
******************************************/
#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return e
#define CHECK_F(f) { CHECK_V_F(_var_err__, f); }
-
/*-****************************************
* Error Strings
******************************************/
} \
} while(0);
-
#endif /* ERROR_H_MODULE */
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
#ifndef FSE_H
#define FSE_H
-
/*-*****************************************
* Dependencies
******************************************/
#include "zstd_deps.h" /* size_t, ptrdiff_t */
-
/*-*****************************************
* FSE_PUBLIC_API : control library symbols visibility
******************************************/
#define FSE_VERSION_NUMBER (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)
FSE_PUBLIC_API unsigned FSE_versionNumber(void); /*< library version number; to be used when checking dll version */
-
/*-****************************************
* FSE simple functions
******************************************/
FSE_PUBLIC_API size_t FSE_decompress(void* dst, size_t dstCapacity,
const void* cSrc, size_t cSrcSize);
-
/*-*****************************************
* Tool functions
******************************************/
FSE_PUBLIC_API unsigned FSE_isError(size_t code); /* tells if a return value is an error code */
FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */
-
/*-*****************************************
* FSE advanced functions
******************************************/
*/
FSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
-
/*-*****************************************
* FSE detailed API
******************************************/
If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
*/
-
/* *** DECOMPRESSION *** */
/*! FSE_readNCount():
/* *** Dependency *** */
#include "bitstream.h"
-
/* *****************************************
* Static allocation
*******************************************/
#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))
#define FSE_DTABLE_SIZE(maxTableLog) (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
-
/* *****************************************
* FSE advanced API
***************************************** */
BIT_CStream_t bitStream; // bitStream tracking structure
FSE_CState_t state; // State tracking structure (can have several)
-
The first thing to do is to init bitStream and state.
size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);
FSE_initCState(&state, ct);
size_t size = BIT_closeCStream(&bitStream);
*/
-
/* *****************************************
* FSE symbol decompression API
*******************************************/
const void* table; /* precise table may vary, depending on U16 */
} FSE_DState_t;
-
static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);
static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
FSE_endOfDState(&DState);
*/
-
/* *****************************************
* FSE unsafe API
*******************************************/
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */
-
/* *****************************************
* Implementation of inlined functions
*******************************************/
statePtr->stateLog = tableLog;
}
-
/*! FSE_initCState2() :
* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)
* uses the smallest state value possible, saving the cost of this symbol */
BIT_flushBits(bitC);
}
-
/* FSE_getMaxNbBits() :
* Approximate maximum cost of a symbol, in bits.
* Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)
}
}
-
/* ====== Decompression ====== */
typedef struct {
return DStatePtr->state == 0;
}
-
-
#ifndef FSE_COMMONDEFS_ONLY
/* **************************************************************
#define FSE_FUNCTION_EXTENSION
#define FSE_DECODE_TYPE FSE_decode_t
-
#endif /* !FSE_COMMONDEFS_ONLY */
-
/* ***************************************************************
* Constants
*****************************************************************/
#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
-
#endif /* FSE_STATIC_LINKING_ONLY */
-
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
/* **************************************************************
* Includes
****************************************************************/
#define ZSTD_DEPS_NEED_MALLOC
#include "zstd_deps.h"
-
/* **************************************************************
* Error Management
****************************************************************/
#define FSE_isError ERR_isError
#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */
-
/* **************************************************************
* Templates
****************************************************************/
#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y)
#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y)
-
/* Function templates */
FSE_DTable* FSE_createDTable (unsigned tableLog)
{
return FSE_buildDTable_internal(dt, normalizedCounter, maxSymbolValue, tableLog, workSpace, wkspSize);
}
-
#ifndef FSE_COMMONDEFS_ONLY
/*-*******************************************************
return 0;
}
-
size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits)
{
void* ptr = dt;
return op-ostart;
}
-
size_t FSE_decompress_usingDTable(void* dst, size_t originalSize,
const void* cSrc, size_t cSrcSize,
const FSE_DTable* dt)
return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
}
-
size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)
{
return FSE_decompress_wksp_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, /* bmi2 */ 0);
FSE_DTable dtable[1]; /* Dynamically sized */
} FSE_DecompressWksp;
-
FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body(
void* dst, size_t dstCapacity,
const void* cSrc, size_t cSrcSize,
return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);
}
-
typedef FSE_DTable DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)];
-
-
#endif /* FSE_COMMONDEFS_ONLY */
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
-
#ifndef HUF_H_298734234
#define HUF_H_298734234
/* *** Dependencies *** */
#include "zstd_deps.h" /* size_t */
-
/* *** library symbols visibility *** */
/* Note : when linking with -fvisibility=hidden on gcc, or by default on Visual,
* HUF symbols remain "private" (internal symbols for library only).
# define HUF_PUBLIC_API
#endif
-
/* ========================== */
/* *** simple functions *** */
/* ========================== */
HUF_PUBLIC_API size_t HUF_decompress(void* dst, size_t originalSize,
const void* cSrc, size_t cSrcSize);
-
/* *** Tool functions *** */
#define HUF_BLOCKSIZE_MAX (128 * 1024) /*< maximum input size for a single block compressed with HUF_compress */
HUF_PUBLIC_API size_t HUF_compressBound(size_t size); /*< maximum compressed size (worst case) */
HUF_PUBLIC_API unsigned HUF_isError(size_t code); /*< tells if a return value is an error code */
HUF_PUBLIC_API const char* HUF_getErrorName(size_t code); /*< provides error code string (useful for debugging) */
-
/* *** Advanced function *** */
/* HUF_compress2() :
#define FSE_STATIC_LINKING_ONLY
#include "fse.h"
-
/* *** Constants *** */
#define HUF_TABLELOG_MAX 12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
#define HUF_TABLELOG_DEFAULT 11 /* default tableLog value when none specified */
# error "HUF_TABLELOG_MAX is too large !"
#endif
-
/* ****************************************
* Static allocation
******************************************/
#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \
HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }
-
/* ****************************************
* Advanced decompression functions
******************************************/
size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< double-symbols decoder */
#endif
-
/* ****************************************
* HUF detailed API
* ****************************************/
size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
#endif
-
/* ====================== */
/* single stream variants */
/* ====================== */
*
*/
-
/* compat. with non-clang compilers */
#ifndef __has_attribute
#define __has_attribute(x) 0
* You may select, at your option, one of the above-listed licenses.
*/
-
-
/*-*************************************
* Dependencies
***************************************/
#include "error_private.h"
#include "zstd_internal.h"
-
/*-****************************************
* Version
******************************************/
const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
-
/*-****************************************
* ZSTD Error Management
******************************************/
* provides error code string from enum */
const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
-
-
/*=**************************************************************
* Custom allocator
****************************************************************/
#include <linux/xxhash.h> /* XXH_reset, update, digest */
#define ZSTD_TRACE 0
-
/* ---- static assert (debug) --- */
#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
#define ZSTD_isError ERR_isError /* for inlining */
#define FSE_isError ERR_isError
#define HUF_isError ERR_isError
-
/*-*************************************
* shared macros
***************************************/
#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
-
/*-*************************************
* Common constants
***************************************/
#define OF_DEFAULTNORMLOG 5 /* for static allocation */
static UNUSED_ATTR const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG;
-
/*-*******************************************
* Shared functions to include for inlining
*********************************************/
ZSTD_bm_stable = 1 /* ZSTD_inBuffer/ZSTD_outBuffer is stable */
} ZSTD_bufferMode_e;
-
/*-*******************************************
* Private declarations
*********************************************/
void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem);
void ZSTD_customFree(void* ptr, ZSTD_customMem customMem);
-
MEM_STATIC U32 ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus */
{
assert(val != 0);
}
}
-
/* ZSTD_invalidateRepCodes() :
* ensures next compression will not use repcodes from previous block.
* Note : only works with regular variant;
* do not use with extDict variant ! */
void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx); /* zstdmt, adaptive_compression (shouldn't get this definition from here) */
-
typedef struct {
blockType_e blockType;
U32 lastBlock;
return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
}
-
#endif /* ZSTD_CCOMMON_H_MODULE */
****************************************************************/
#define HUF_isError ERR_isError
-
/* **************************************************************
* Byte alignment for workSpace management
****************************************************************/
#define HUF_ALIGN(x, a) HUF_ALIGN_MASK((x), (a) - 1)
#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
-
/* **************************************************************
* BMI2 Variant Wrappers
****************************************************************/
#endif
-
/*-***************************/
/* generic DTableDesc */
/*-***************************/
}
#endif
-
#ifndef HUF_FORCE_DECOMPRESS_X2
/*-***************************/
BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1];
} HUF_ReadDTableX1_Workspace;
-
size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize)
{
return HUF_readDTableX1_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0);
iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), bmi2);
if (HUF_isError(iSize)) return iSize;
-
/* Table header */
{ DTableDesc dtd = HUF_getDTableDesc(DTable);
U32 const maxTableLog = dtd.maxTableLog + 1;
#endif
}
-
size_t HUF_decompress1X1_usingDTable(
void* dst, size_t dstSize,
const void* cSrc, size_t cSrcSize,
return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0);
}
-
size_t HUF_decompress4X1_usingDTable(
void* dst, size_t dstSize,
const void* cSrc, size_t cSrcSize,
return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0);
}
-
#endif /* HUF_FORCE_DECOMPRESS_X2 */
-
#ifndef HUF_FORCE_DECOMPRESS_X1
/* *************************/
return iSize;
}
-
FORCE_INLINE_TEMPLATE U32
HUF_decodeSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)
{
return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0);
}
-
size_t HUF_decompress4X2_usingDTable(
void* dst, size_t dstSize,
const void* cSrc, size_t cSrcSize,
return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, /* bmi2 */ 0);
}
-
#endif /* HUF_FORCE_DECOMPRESS_X1 */
-
/* ***********************************/
/* Universal decompression selectors */
/* ***********************************/
#endif
}
-
#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)
typedef struct { U32 tableTime; U32 decode256Time; } algo_time_t;
static const algo_time_t algoTime[16 /* Quantization */][2 /* single, double */] =
#endif
}
-
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst,
size_t dstSize, const void* cSrc,
size_t cSrcSize, void* workSpace,
}
}
-
size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2)
{
DTableDesc const dtd = HUF_getDTableDesc(DTable);
#include "zstd_decompress_internal.h"
#include "zstd_ddict.h"
-
-
-
/*-*******************************************************
* Types
*********************************************************/
}
}
-
static size_t
ZSTD_loadEntropy_intoDDict(ZSTD_DDict* ddict,
ZSTD_dictContentType_e dictContentType)
return 0;
}
-
static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict,
const void* dict, size_t dictSize,
ZSTD_dictLoadMethod_e dictLoadMethod,
return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, allocator);
}
-
const ZSTD_DDict* ZSTD_initStaticDDict(
void* sBuffer, size_t sBufferSize,
const void* dict, size_t dictSize,
return ddict;
}
-
size_t ZSTD_freeDDict(ZSTD_DDict* ddict)
{
if (ddict==NULL) return 0; /* support free on NULL */
* You may select, at your option, one of the above-listed licenses.
*/
-
#ifndef ZSTD_DDICT_H
#define ZSTD_DDICT_H
#include "../common/zstd_deps.h" /* size_t */
#include <linux/zstd.h> /* ZSTD_DDict, and several public functions */
-
/*-*******************************************************
* Interface
*********************************************************/
void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
-
-
#endif /* ZSTD_DDICT_H */
* You may select, at your option, one of the above-listed licenses.
*/
-
/* ***************************************************************
* Tuning parameters
*****************************************************************/
# define ZSTD_NO_FORWARD_PROGRESS_MAX 16
#endif
-
/*-*******************************************************
* Dependencies
*********************************************************/
#include "zstd_ddict.h" /* ZSTD_DDictDictContent */
#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */
-
-
-
/* ***********************************
* Multiple DDicts Hashset internals *
*************************************/
size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }
-
static size_t ZSTD_startingInputLength(ZSTD_format_e format)
{
size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);
}
}
-
/*-*************************************************************
* Frame header decoding
***************************************************************/
return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1);
}
-
/* ZSTD_getFrameHeader_advanced() :
* decode Frame Header, or require larger `srcSize`.
* note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless
return (ret >= ZSTD_CONTENTSIZE_ERROR) ? 0 : ret;
}
-
/* ZSTD_decodeFrameHeader() :
* `headerSize` must be the size provided by ZSTD_frameHeaderSize().
* If multiple DDict references are enabled, also will choose the correct DDict to use.
ZSTD_frameSizeInfo frameSizeInfo;
ZSTD_memset(&frameSizeInfo, 0, sizeof(ZSTD_frameSizeInfo));
-
if ((srcSize >= ZSTD_SKIPPABLEHEADERSIZE)
&& (MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
frameSizeInfo.compressedSize = readSkippableFrameSize(src, srcSize);
return bound;
}
-
/*-*************************************************************
* Frame decoding
***************************************************************/
return blockSize;
}
-
static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity,
const void* src, size_t srcSize)
{
(void)streaming;
}
-
/*! ZSTD_decompressFrame() :
* @dctx must be properly initialized
* will update *srcPtr and *srcSizePtr,
while (srcSize >= ZSTD_startingInputLength(dctx->format)) {
-
{ U32 const magicNumber = MEM_readLE32(src);
DEBUGLOG(4, "reading magic number %08X (expecting %08X)",
(unsigned)magicNumber, ZSTD_MAGICNUMBER);
return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, NULL);
}
-
static ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx)
{
switch (dctx->dictUses) {
return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));
}
-
size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
#if defined(ZSTD_HEAPMODE) && (ZSTD_HEAPMODE>=1)
#endif
}
-
/*-**************************************
* Advanced Streaming Decompression API
* Bufferless and synchronous
}
}
-
static size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
dctx->dictEnd = dctx->previousDstEnd;
return 0;
}
-
/* ====== ZSTD_DDict ====== */
size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)
return zfp.dictID;
}
-
/*! ZSTD_decompress_usingDDict() :
* Decompression using a pre-digested Dictionary
* Use dictionary without significant overhead. */
ddict);
}
-
/*=====================================
* Streaming decompression
*====================================*/
return ZSTD_freeDCtx(zds);
}
-
/* *** Initialization *** */
size_t ZSTD_DStreamInSize(void) { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; }
return ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, ZSTD_dct_rawContent);
}
-
/* ZSTD_initDStream_usingDict() :
* return : expected size, aka ZSTD_startingInputLength().
* this function cannot fail */
return ZSTD_startingInputLength(dctx->format);
}
-
size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)
{
RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, "");
return 0;
}
-
size_t ZSTD_sizeof_DStream(const ZSTD_DStream* dctx)
{
return ZSTD_sizeof_DCtx(dctx);
return ZSTD_estimateDStreamSize((size_t)zfh.windowSize);
}
-
/* ***** Decompression ***** */
static int ZSTD_DCtx_isOverflow(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)
#error "Cannot force the use of the short and the long ZSTD_decompressSequences variants!"
#endif
-
/*_*******************************************************
* Memory operations
**********************************************************/
static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
-
/*-*************************************************************
* Block decoding
***************************************************************/
{ 0, 25, 5,33554429}, { 0, 24, 5,16777213},
}; /* OF_defaultDTable */
-
/* Default FSE distribution table for Match Lengths */
static const ZSTD_seqSymbol ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = {
{ 1, 1, 1, ML_DEFAULTNORMLOG}, /* header : fastMode, tableLog */
{ 0, 11, 6, 2051}, { 0, 10, 6, 1027},
}; /* ML_defaultDTable */
-
static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U8 nbAddBits)
{
void* ptr = dt;
cell->baseValue = baseValue;
}
-
/* ZSTD_buildFSETable() :
* generate FSE decoding table for one symbol (ll, ml or off)
* cannot fail if input is valid =>
BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
U32 highThreshold = tableSize - 1;
-
/* Sanity Checks */
assert(maxSymbolValue <= MaxSeq);
assert(tableLog <= MaxFSELog);
baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
}
-
/*! ZSTD_buildSeqTable() :
* @return : nb bytes read from src,
* or an error code if it fails */
return ip-istart;
}
-
typedef struct {
size_t litLength;
size_t matchLength;
const BYTE* const iLitEnd = *litPtr + sequence.litLength;
const BYTE* match = oLitEnd - sequence.offset;
-
/* bounds checks : careful of address space overflow in 32-bit mode */
RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
return sequenceLength;
}
-
static void
ZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt)
{
#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
-
FORCE_INLINE_TEMPLATE size_t
DONT_VECTORIZE
ZSTD_decompressSequences_bodySplitLitBuffer( ZSTD_DCtx* dctx,
}
#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */
-
-
#if DYNAMIC_BMI2
#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
}
#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */
-
#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
/* ZSTD_decompressSequencesLong() :
* decompression function triggered when a minimum share of offsets is considered "long",
}
#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */
-
-
#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
!defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
/* ZSTD_getLongOffsetsShare() :
}
}
-
void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize)
{
if (dst != dctx->previousDstEnd && dstSize > 0) { /* not contiguous */
}
}
-
size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,
void* dst, size_t dstCapacity,
const void* src, size_t srcSize)
* You may select, at your option, one of the above-listed licenses.
*/
-
#ifndef ZSTD_DEC_BLOCK_H
#define ZSTD_DEC_BLOCK_H
#include "../common/zstd_internal.h" /* blockProperties_t, and some public functions */
#include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */
-
/* === Prototypes === */
/* note: prototypes already published within `zstd.h` :
* ZSTD_decodeSeqHeaders()
*/
-
/* Streaming state is used to inform allocation of the literal buffer */
typedef enum {
not_streaming = 0,
unsigned tableLog, void* wksp, size_t wkspSize,
int bmi2);
-
#endif /* ZSTD_DEC_BLOCK_H */
* You may select, at your option, one of the above-listed licenses.
*/
-
/* zstd_decompress_internal:
* objects and definitions shared within lib/decompress modules */
#ifndef ZSTD_DECOMPRESS_INTERNAL_H
#define ZSTD_DECOMPRESS_INTERNAL_H
-
/*-*******************************************************
* Dependencies
*********************************************************/
#include "../common/mem.h" /* BYTE, U16, U32 */
#include "../common/zstd_internal.h" /* constants : MaxLL, MaxML, MaxOff, LLFSELog, etc. */
-
-
/*-*******************************************************
* Constants
*********************************************************/
67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
-
/*-*******************************************************
* Decompression types
*********************************************************/
* This function cannot fail. */
void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize);
-
#endif /* ZSTD_DECOMPRESS_INTERNAL_H */