Seekable compression demo

This commit is contained in:
Sean Purcell
2017-04-11 13:53:09 -07:00
parent 1f72b07cc0
commit c3ba15e48f
11 changed files with 1174 additions and 1 deletions
+2
View File
@@ -38,6 +38,8 @@ const char* ERR_getErrorString(ERR_enum code)
case PREFIX(dictionary_corrupted): return "Dictionary is corrupted";
case PREFIX(dictionary_wrong): return "Dictionary mismatch";
case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples";
case PREFIX(chunkIndex_tooLarge): return "Chunk index is too large";
case PREFIX(needSeek): return "Wrong file position, a seek is required to continue";
case PREFIX(maxCode):
default: return notErrorCode;
}
+23
View File
@@ -0,0 +1,23 @@
#ifndef SEEKABLE_H
#define SEEKABLE_H
#if defined (__cplusplus)
extern "C" {
#endif
#include "zstd_internal.h"
static const unsigned ZSTD_seekTableFooterSize = 9;
#define ZSTD_SEEKABLE_MAGICNUMBER 0x8F92EAB1
#define ZSTD_SEEKABLE_MAXCHUNKS 0x8000000U
/* 0xFE03F607 is the largest number x such that ZSTD_compressBound(x) fits in a 32-bit integer */
#define ZSTD_SEEKABLE_MAX_CHUNK_DECOMPRESSED_SIZE 0xFE03F607
#if defined (__cplusplus)
}
#endif
#endif
+2
View File
@@ -58,6 +58,8 @@ typedef enum {
ZSTD_error_dictionary_corrupted,
ZSTD_error_dictionary_wrong,
ZSTD_error_dictionaryCreation_failed,
ZSTD_error_chunkIndex_tooLarge,
ZSTD_error_needSeek,
ZSTD_error_maxCode
} ZSTD_ErrorCode;