From: gabrielstedman Date: Mon, 22 Apr 2019 08:56:51 +0000 (+0100) Subject: Merge https://github.com/lz4/lz4 into dev X-Git-Tag: upstream/1.9.3~3^2~1^2^2~6^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d0960c354c9018957856334b1901bd693efe995;p=platform%2Fupstream%2Flz4.git Merge https://github.com/lz4/lz4 into dev --- 9d0960c354c9018957856334b1901bd693efe995 diff --cc programs/lz4cli.c index 9a74286,82f2fac..3315773 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@@ -703,18 -714,13 +716,12 @@@ int main(int argc, const char** argv LZ4IO_setNotificationLevel((int)displayLevel); if (ifnIdx == 0) multiple_inputs = 0; if (mode == om_decompress) { - if (multiple_inputs) - operationResult = LZ4IO_decompressMultipleFilenames(prefs, inFileNames, ifnIdx, !strcmp(output_filename,stdoutmark) ? stdoutmark : LZ4_EXTENSION); - else + if (multiple_inputs) { + assert(ifnIdx <= INT_MAX); + operationResult = LZ4IO_decompressMultipleFilenames(prefs, inFileNames, (int)ifnIdx, !strcmp(output_filename,stdoutmark) ? stdoutmark : LZ4_EXTENSION); + } else { operationResult = DEFAULT_DECOMPRESSOR(prefs, input_filename, output_filename); - } else if (mode == om_list){ - if(!multiple_inputs){ - inFileNames[ifnIdx++] = input_filename; -- } - operationResult = LZ4IO_displayCompressedFilesInfo(inFileNames, ifnIdx); - inFileNames=NULL; - } else { - /* compression is default action */ - } else { /* compression is default action */ ++ if (legacy_format) { DISPLAYLEVEL(3, "! Generating LZ4 Legacy format (deprecated) ! \n"); LZ4IO_compressFilename_Legacy(prefs, input_filename, output_filename, cLevel); diff --cc programs/lz4io.h index 3d37bd0,54d49be..fcda5f1 --- a/programs/lz4io.h +++ b/programs/lz4io.h @@@ -52,16 -52,8 +52,16 @@@ static const char nulmark[] = "/dev/nul /* ****************** Type Definitions ************** */ /* ************************************************** */ - typedef struct LZ4IO_prefs_s LZ4IO_prefs_t; - +typedef struct { + LZ4F_frameInfo_t frameInfo; + const char* fileName; + stat_t fileStat; +} LZ4F_compFileInfo_t; + +#define LZ4F_INIT_FILEINFO { (LZ4F_frameInfo_t) LZ4F_INIT_FRAMEINFO, NULL, stat_t() } + + typedef struct LZ4IO_prefs_s LZ4IO_prefs_t; + LZ4IO_prefs_t* LZ4IO_defaultPreferences(void); void LZ4IO_freePreferences(LZ4IO_prefs_t* const prefs);