Merge https://github.com/lz4/lz4 into dev
authorgabrielstedman <gabriwinter@gmail.com>
Mon, 22 Apr 2019 08:56:51 +0000 (09:56 +0100)
committergabrielstedman <gabriwinter@gmail.com>
Mon, 22 Apr 2019 08:56:51 +0000 (09:56 +0100)
1  2 
programs/lz4.1.md
programs/lz4cli.c
programs/lz4io.h

Simple merge
@@@ -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);
@@@ -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);