mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
clean: remove zstd related code which is unused since the migration to
libzim
This commit is contained in:
parent
d6a64bea7e
commit
a5be5134c8
|
@ -40,7 +40,6 @@ pkg_check_modules(PKGCONFIG_DEPS IMPORTED_TARGET
|
|||
vorbis # .ogg
|
||||
vorbisfile
|
||||
liblzma
|
||||
libzstd
|
||||
)
|
||||
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE
|
||||
|
|
|
@ -552,7 +552,7 @@ SOURCES += src/common/wildcard.cc
|
|||
|
||||
CONFIG( zim_support ) {
|
||||
DEFINES += MAKE_ZIM_SUPPORT
|
||||
LIBS += -llzma -lzstd -lzim
|
||||
LIBS += -llzma -lzim
|
||||
|
||||
win32{
|
||||
Debug: LIBS+= -L$$PWD/winlibs/lib/dbg/
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#ifdef MAKE_ZIM_SUPPORT
|
||||
#include "lzma.h"
|
||||
#include "zstd.h"
|
||||
#endif
|
||||
|
||||
#define CHUNK_SIZE 2048
|
||||
|
@ -132,46 +131,4 @@ char buf[CHUNK_SIZE];
|
|||
return str;
|
||||
}
|
||||
|
||||
string decompressZstd( const char *bufptr, unsigned length )
|
||||
{
|
||||
string str;
|
||||
char buf[CHUNK_SIZE];
|
||||
size_t res;
|
||||
// string err;
|
||||
ZSTD_DStream *zds;
|
||||
ZSTD_inBuffer in_buf = { bufptr, length, 0 };
|
||||
ZSTD_outBuffer out_buf = { buf, CHUNK_SIZE, 0 };
|
||||
|
||||
zds = ZSTD_createDStream();
|
||||
if( !zds )
|
||||
return str;
|
||||
|
||||
res = ZSTD_initDStream( zds );
|
||||
if( ZSTD_isError( res ) )
|
||||
{
|
||||
// err = string( ZSTD_getErrorName( res ) );
|
||||
ZSTD_freeDStream( zds );
|
||||
return str;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
out_buf.pos = 0;
|
||||
res = ZSTD_decompressStream( zds, &out_buf, &in_buf );
|
||||
if( ZSTD_isError( res ) )
|
||||
{
|
||||
// err = string( ZSTD_getErrorName( res ) );
|
||||
ZSTD_freeDStream( zds );
|
||||
return string();
|
||||
}
|
||||
|
||||
str.append( buf, out_buf.pos );
|
||||
}
|
||||
while( out_buf.pos >= out_buf.size );
|
||||
|
||||
ZSTD_freeDStream( zds );
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,8 +17,6 @@ string decompressBzip2( const char * bufptr, unsigned length );
|
|||
string decompressLzma2( const char * bufptr, unsigned length,
|
||||
bool raw_decoder = false );
|
||||
|
||||
string decompressZstd( const char * bufptr, unsigned length );
|
||||
|
||||
#endif
|
||||
|
||||
#endif // DECOMPRESS_HH
|
||||
|
|
|
@ -29,11 +29,11 @@ In other words, those libraries
|
|||
* x11 (linux only)
|
||||
|
||||
And a few compression libraries:
|
||||
|
||||
* xz (lzma)
|
||||
* bzip2
|
||||
* lzo2
|
||||
* zlib
|
||||
* zstd
|
||||
|
||||
## CMake Build
|
||||
|
||||
|
|
Loading…
Reference in a new issue