Lines Matching full:if

18   with this program; if not, write to the Free Software Foundation, Inc.,
40 #if defined(__MINGW32__) && !defined(_POSIX_SOURCE)
94 #define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
97 #define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
98 if ( ((clock() - g_time) > refreshRate) \
102 if (g_displayLevel>=4) fflush(stderr); \
136 #define DEBUGOUTPUT(...) if (DEBUG) DISPLAY(__VA_ARGS__);
163 if (!ret) EXM_THROW(21, "Allocation error : not enough memory"); in LZ4IO_defaultPreferences()
222 if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return 0; in LZ4IO_setBlockSizeID()
233 if (blockSize < minBlockSize) blockSize = minBlockSize; in LZ4IO_setBlockSize()
234 if (blockSize > maxBlockSize) blockSize = maxBlockSize; in LZ4IO_setBlockSize()
240 if (bsid < 7) bsid = 7; in LZ4IO_setBlockSize()
311 * @result : FILE* to `dstFileName`, or NULL if it fails */
316 if (!strcmp (srcFileName, stdinmark)) { in LZ4IO_openSrcFile()
322 if ( f==NULL ) DISPLAYLEVEL(1, "%s: %s \n", srcFileName, strerror(errno)); in LZ4IO_openSrcFile()
331 * @result : FILE* to `dstFileName`, or NULL if it fails */
337 if (!strcmp (dstFileName, stdoutmark)) { in LZ4IO_openDstFile()
341 if (prefs->sparseFileSupport==1) { in LZ4IO_openDstFile()
346if (!prefs->overwrite && strcmp (dstFileName, nulmark)) { /* Check if destination file already ex… in LZ4IO_openDstFile()
348 if (testf != NULL) { /* dest exists, prompt for overwrite authorization */ in LZ4IO_openDstFile()
350 if (g_displayLevel <= 1) { /* No interaction possible */ in LZ4IO_openDstFile()
356 if ((ch!='Y') && (ch!='y')) { in LZ4IO_openDstFile()
363 if (f==NULL) DISPLAYLEVEL(1, "%s: %s\n", dstFileName, strerror(errno)); in LZ4IO_openDstFile()
368 if (f && sparseMode) { SET_SPARSE_FILE_MODE(f); } in LZ4IO_openDstFile()
415 if (finput == NULL) in LZ4IO_compressFilename_Legacy()
419 if (foutput == NULL) { in LZ4IO_compressFilename_Legacy()
427 if (!in_buff || !out_buff) in LZ4IO_compressFilename_Legacy()
432 if (fwrite(out_buff, 1, MAGICNUMBER_SIZE, foutput) != MAGICNUMBER_SIZE) in LZ4IO_compressFilename_Legacy()
440 if (inSize == 0) break; in LZ4IO_compressFilename_Legacy()
455 if (fwrite(out_buff, 1, (size_t)outSize+4, foutput) != (size_t)(outSize+4)) { in LZ4IO_compressFilename_Legacy()
458 if (ferror(finput)) EXM_THROW(25, "Error while reading %s ", input_filename); in LZ4IO_compressFilename_Legacy()
462 if (clockEnd==clockStart) clockEnd+=1; /* avoid division by zero (speed) */ in LZ4IO_compressFilename_Legacy()
476 if (strcmp(output_filename,stdoutmark)) fclose(foutput); /* do not close stdout */ in LZ4IO_compressFilename_Legacy()
496 if (dstFileName == NULL) return ifntSize; /* not enough memory */ in LZ4IO_compressMultipleFilenames_Legacy()
501 if (!strcmp(suffix, stdoutmark)) { in LZ4IO_compressMultipleFilenames_Legacy()
508 if (ofnSize <= ifnSize+suffixSize+1) { in LZ4IO_compressMultipleFilenames_Legacy()
512 if (dstFileName==NULL) { in LZ4IO_compressMultipleFilenames_Legacy()
554 if (!circularBuf) EXM_THROW(25, "Allocation error : not enough memory for circular buffer"); in LZ4IO_createDict()
555 if (!dictFilename) EXM_THROW(25, "Dictionary error : no filename provided"); in LZ4IO_createDict()
558 if (!dictFile) EXM_THROW(25, "Dictionary error : could not open dictionary file"); in LZ4IO_createDict()
560 /* opportunistically seek to the part of the file we care about. If this */ in LZ4IO_createDict()
562 if (strcmp(dictFilename, stdinmark)) { in LZ4IO_createDict()
572 if (dictLen > LZ4_MAX_DICT_SIZE) { in LZ4IO_createDict()
580 if (dictStart == 0) { in LZ4IO_createDict()
587 if (!dictBuf) EXM_THROW(25, "Allocation error : not enough memory"); in LZ4IO_createDict()
604 if (!prefs->useDictionary) return NULL; in LZ4IO_createCDict()
606 if (!dictionaryBuffer) EXM_THROW(25, "Dictionary error : could not create dictionary"); in LZ4IO_createCDict()
618if (LZ4F_isError(errorCode)) EXM_THROW(30, "Allocation error : can't create LZ4F context : %s", LZ… in LZ4IO_createCResources()
625 if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(31, "Allocation error : not enough memory"); in LZ4IO_createCResources()
641if (LZ4F_isError(errorCode)) EXM_THROW(38, "Error : can't free LZ4F context resource : %s", LZ4F_g… in LZ4IO_freeCResources()
667 if (srcFile == NULL) return 1; in LZ4IO_compressFilename_extRess()
669 if (dstFile == NULL) { fclose(srcFile); return 1; } in LZ4IO_compressFilename_extRess()
680 if (io_prefs->contentSizeFlag) { in LZ4IO_compressFilename_extRess()
682 prefs.frameInfo.contentSize = fileSize; /* == 0 if input == stdin */ in LZ4IO_compressFilename_extRess()
683 if (fileSize==0) in LZ4IO_compressFilename_extRess()
689 if (ferror(srcFile)) EXM_THROW(30, "Error reading %s ", srcFileName); in LZ4IO_compressFilename_extRess()
693 if (readSize < blockSize) { in LZ4IO_compressFilename_extRess()
696 if (LZ4F_isError(cSize)) in LZ4IO_compressFilename_extRess()
703 if (fwrite(dstBuffer, 1, cSize, dstFile) != cSize) { in LZ4IO_compressFilename_extRess()
713if (LZ4F_isError(headerSize)) EXM_THROW(33, "File header generation failed : %s", LZ4F_getErrorNam… in LZ4IO_compressFilename_extRess()
714 if (fwrite(dstBuffer, 1, headerSize, dstFile) != headerSize) in LZ4IO_compressFilename_extRess()
721 if (LZ4F_isError(outSize)) in LZ4IO_compressFilename_extRess()
728 if (fwrite(dstBuffer, 1, outSize, dstFile) != outSize) in LZ4IO_compressFilename_extRess()
735 if (ferror(srcFile)) EXM_THROW(37, "Error reading %s ", srcFileName); in LZ4IO_compressFilename_extRess()
739 if (LZ4F_isError(endSize)) in LZ4IO_compressFilename_extRess()
741 if (fwrite(dstBuffer, 1, endSize, dstFile) != endSize) in LZ4IO_compressFilename_extRess()
748 if (strcmp(dstFileName,stdoutmark)) fclose (dstFile); /* do not close stdout */ in LZ4IO_compressFilename_extRess()
752 if (strcmp (srcFileName, stdinmark) in LZ4IO_compressFilename_extRess()
759 if (io_prefs->removeSrcFile) { /* remove source file : --rm */ in LZ4IO_compressFilename_extRess()
760 if (remove(srcFileName)) in LZ4IO_compressFilename_extRess()
811 if (dstFileName == NULL) return ifntSize; /* not enough memory */ in LZ4IO_compressMultipleFilenames()
817 if (!strcmp(suffix, stdoutmark)) { in LZ4IO_compressMultipleFilenames()
823 if (ofnSize <= ifnSize+suffixSize+1) { in LZ4IO_compressMultipleFilenames()
827 if (dstFileName==NULL) { in LZ4IO_compressMultipleFilenames()
878 if (!sparseMode) { /* normal write */ in LZ4IO_fwriteSparse()
880 if (sizeCheck != bufferSize) EXM_THROW(70, "Write error : cannot write decoded block"); in LZ4IO_fwriteSparse()
885 if (storedSkips > 1 GB) { in LZ4IO_fwriteSparse()
887 if (seekResult != 0) EXM_THROW(71, "1 GB skip error (sparse file support)"); in LZ4IO_fwriteSparse()
896 if (seg0SizeT > bufferSizeT) seg0SizeT = bufferSizeT; in LZ4IO_fwriteSparse()
901 if (nb0T != seg0SizeT) { /* not all 0s */ in LZ4IO_fwriteSparse()
904if (seekResult) EXM_THROW(72, "Sparse skip error(%d): %s ; try --no-sparse", (int)errno, strerror(… in LZ4IO_fwriteSparse()
910if (sizeCheck != seg0SizeT) EXM_THROW(73, "Write error : cannot write decoded block"); in LZ4IO_fwriteSparse()
915 if (bufferSize & maskT) { /* size not multiple of sizeT : implies end of block */ in LZ4IO_fwriteSparse()
922 if (restPtr != restEnd) { in LZ4IO_fwriteSparse()
924 if (seekResult) EXM_THROW(74, "Sparse skip error ; try --no-sparse"); in LZ4IO_fwriteSparse()
927if (sizeCheck != (size_t)(restEnd - restPtr)) EXM_THROW(75, "Write error : cannot write decoded en… in LZ4IO_fwriteSparse()
936 if (storedSkips>0) { /* implies sparseFileSupport>0 */ in LZ4IO_fwriteSparseEnd()
938 if (UTIL_fseek(file, storedSkips-1, SEEK_CUR) != 0) in LZ4IO_fwriteSparseEnd()
940 if (fwrite(lastZeroByte, 1, 1, file) != 1) in LZ4IO_fwriteSparseEnd()
955 if (!in_buff || !out_buff) EXM_THROW(51, "Allocation error : not enough memory"); in LZ4IO_decodeLegacyStream()
963if (sizeCheck == 0) break; /* Nothing to read : file read is completed */ in LZ4IO_decodeLegacyStream()
964 if (sizeCheck != 4) EXM_THROW(52, "Read error : cannot access block size "); } in LZ4IO_decodeLegacyStream()
966 if (blockSize > LZ4_COMPRESSBOUND(LEGACY_BLOCKSIZE)) { in LZ4IO_decodeLegacyStream()
974if (sizeCheck!=blockSize) EXM_THROW(52, "Read error : cannot access compressed block !"); } in LZ4IO_decodeLegacyStream()
978 if (decodeSize < 0) EXM_THROW(53, "Decoding Failed ! Corrupted input detected !"); in LZ4IO_decodeLegacyStream()
983 if (ferror(finput)) EXM_THROW(54, "Read error : ferror"); in LZ4IO_decodeLegacyStream()
1009 if (!prefs->useDictionary) { in LZ4IO_loadDDict()
1016 if (!ress->dictBuffer) EXM_THROW(25, "Dictionary error : could not create dictionary"); in LZ4IO_loadDDict()
1026if (LZ4F_isError(errorCode)) EXM_THROW(60, "Can't create LZ4F context : %s", LZ4F_getErrorName(err… in LZ4IO_createDResources()
1033 if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(61, "Allocation error : not enough memory"); in LZ4IO_createDResources()
1044if (LZ4F_isError(errorCode)) EXM_THROW(69, "Error : can't free LZ4F context resource : %s", LZ4F_g… in LZ4IO_freeDResources()
1065if (LZ4F_isError(nextToLoad)) EXM_THROW(62, "Header error : %s", LZ4F_getErrorName(nextToLoad)); in LZ4IO_decompressLZ4F()
1075 if (nextToLoad > ress.srcBufferSize) nextToLoad = ress.srcBufferSize; in LZ4IO_decompressLZ4F()
1077 if (!readSize) break; /* reached end of file or stream */ in LZ4IO_decompressLZ4F()
1084if (LZ4F_isError(nextToLoad)) EXM_THROW(66, "Decompression error : %s", LZ4F_getErrorName(nextToLo… in LZ4IO_decompressLZ4F()
1088 if (decodedBytes) { in LZ4IO_decompressLZ4F()
1089 if (!prefs->testMode) in LZ4IO_decompressLZ4F()
1095 if (!nextToLoad) break; in LZ4IO_decompressLZ4F()
1099 if (ferror(srcFile)) EXM_THROW(67, "Read error"); in LZ4IO_decompressLZ4F()
1101 if (!prefs->testMode) LZ4IO_fwriteSparseEnd(dstFile, storedSkips); in LZ4IO_decompressLZ4F()
1102 if (nextToLoad!=0) EXM_THROW(68, "Unfinished stream"); in LZ4IO_decompressLZ4F()
1125 if (fwrite(MNstore, 1, MAGICNUMBER_SIZE, foutput) != MAGICNUMBER_SIZE) { in LZ4IO_passThrough()
1133 if (ferror(finput)) EXM_THROW(51, "Read Error"); in LZ4IO_passThrough()
1146 if (where != SEEK_CUR) return -1; /* Only allows SEEK_CUR */ in fseek_u32()
1149 if (s > stepMax) s = stepMax; in fseek_u32()
1151 if (errorNb != 0) break; in fseek_u32()
1171 if (g_magicRead) { /* magic number already read from finput (see legacy frame)*/ in selectDecoder()
1176 if (nbReadBytes==0) { nbFrames = 0; return ENDOFSTREAM; } /* EOF */ in selectDecoder()
1177 if (nbReadBytes != MAGICNUMBER_SIZE) in selectDecoder()
1181 if (LZ4IO_isSkippableMagicNumber(magicNumber)) in selectDecoder()
1194 if (nbReadBytes != 4) in selectDecoder()
1199 if (errorNb != 0) in selectDecoder()
1205 if (nbFrames == 1) { /* just started */ in selectDecoder()
1207 if (!prefs->testMode && prefs->overwrite && prefs->passThrough) { in selectDecoder()
1215 if (position != -1L) in selectDecoder()
1234 if (finput==NULL) return 1; in LZ4IO_decompressSrcFile()
1241 if (decodedSize == ENDOFSTREAM) break; in LZ4IO_decompressSrcFile()
1247 if (prefs->removeSrcFile) { /* --rm */ in LZ4IO_decompressSrcFile()
1248 if (remove(input_filename)) in LZ4IO_decompressSrcFile()
1269 if (foutput==NULL) return 1; /* failure */ in LZ4IO_decompressDstFile()
1271 if ( strcmp(input_filename, stdinmark) in LZ4IO_decompressDstFile()
1281 if ( stat_result != 0 in LZ4IO_decompressDstFile()
1321 if (outFileName==NULL) EXM_THROW(70, "Memory allocation error"); in LZ4IO_decompressMultipleFilenames()
1327 if (!strcmp(suffix, stdoutmark)) { in LZ4IO_decompressMultipleFilenames()
1331 if (ofnSize <= ifnSize-suffixSize+1) { in LZ4IO_decompressMultipleFilenames()
1335 if (outFileName==NULL) EXM_THROW(71, "Memory allocation error"); in LZ4IO_decompressMultipleFilenames()
1337 if (ifnSize <= suffixSize || strcmp(suffixPtr, suffix) != 0) { in LZ4IO_decompressMultipleFilenames()
1401 if (!fread(blockInfo, 1, LZ4F_BLOCK_HEADER_SIZE, finput)) { in LZ4IO_skipBlocksData()
1402 if (feof(finput)) return totalBlocksSize; in LZ4IO_skipBlocksData()
1408 if (nextCBlockSize == 0) { in LZ4IO_skipBlocksData()
1410 if (contentChecksumFlag) { in LZ4IO_skipBlocksData()
1412 if (UTIL_fseek(finput, LZ4F_CONTENT_CHECKSUM_SIZE, SEEK_CUR) != 0) { in LZ4IO_skipBlocksData()
1422 if (UTIL_fseek(finput, (long)nextBlock, SEEK_CUR) != 0) return 0; in LZ4IO_skipBlocksData()
1440 if (!fread(blockInfo, 1, LZIO_LEGACY_BLOCK_HEADER_SIZE, finput)) { in LZ4IO_skipLegacyBlocksData()
1441 if (feof(finput)) return totalBlocksSize; in LZ4IO_skipLegacyBlocksData()
1445 if ( nextCBlockSize == LEGACY_MAGICNUMBER || in LZ4IO_skipLegacyBlocksData()
1449 if (fseek(finput, -LZIO_LEGACY_BLOCK_HEADER_SIZE, SEEK_CUR) != 0) { in LZ4IO_skipLegacyBlocksData()
1456 if (UTIL_fseek(finput, nextCBlockSize, SEEK_CUR) != 0) { in LZ4IO_skipLegacyBlocksData()
1489 if (!b) b = strrchr(input_filename, '\\'); in LZ4IO_baseName()
1490 if (!b) return input_filename; in LZ4IO_baseName()
1506 if (finput == NULL) return LZ4IO_not_a_file; in LZ4IO_getCompressedFileInfo()
1514 if (nbReadBytes == 0) { break; } /* EOF */ in LZ4IO_getCompressedFileInfo()
1516 if (nbReadBytes != MAGICNUMBER_SIZE) { in LZ4IO_getCompressedFileInfo()
1520 if (LZ4IO_isSkippableMagicNumber(magicNumber)) in LZ4IO_getCompressedFileInfo()
1525 if (cfinfo->frameSummary.frameType != lz4Frame) cfinfo->eqFrameTypes = 0; in LZ4IO_getCompressedFileInfo()
1528 if (!readBytes || ferror(finput)) EXM_THROW(71, "Error reading %s", input_filename); in LZ4IO_getCompressedFileInfo()
1531 if (LZ4F_isError(hSize)) break; in LZ4IO_getCompressedFileInfo()
1532 if (hSize > (LZ4F_HEADER_SIZE_MIN + MAGICNUMBER_SIZE)) { in LZ4IO_getCompressedFileInfo()
1535if (!readBytes || ferror(finput)) EXM_THROW(72, "Error reading %s", input_filename); in LZ4IO_getCompressedFileInfo()
1539 if ( LZ4F_isError(LZ4F_createDecompressionContext(&dctx, LZ4F_VERSION)) ) break; in LZ4IO_getCompressedFileInfo()
1542 if (frameInfoError) break; in LZ4IO_getCompressedFileInfo()
1543if ((cfinfo->frameSummary.lz4FrameInfo.blockSizeID != frameInfo.lz4FrameInfo.blockSizeID || in LZ4IO_getCompressedFileInfo()
1550 if (totalBlocksSize) { in LZ4IO_getCompressedFileInfo()
1558 if (frameInfo.lz4FrameInfo.contentSize) { in LZ4IO_getCompressedFileInfo()
1577if (cfinfo->frameSummary.frameType != legacyFrame && cfinfo->frameCount != 0) cfinfo->eqFrameTypes… in LZ4IO_getCompressedFileInfo()
1581 if (totalBlocksSize) { in LZ4IO_getCompressedFileInfo()
1593if (cfinfo->frameSummary.frameType != skippableFrame && cfinfo->frameCount != 0) cfinfo->eqFrameTy… in LZ4IO_getCompressedFileInfo()
1597 if (nbReadBytes != 4) in LZ4IO_getCompressedFileInfo()
1602 if (errorNb != 0) in LZ4IO_getCompressedFileInfo()
1615 if (position != -1L) in LZ4IO_getCompressedFileInfo()
1621 if (result != LZ4IO_LZ4F_OK) break; in LZ4IO_getCompressedFileInfo()
1634 if (g_displayLevel < 3) { in LZ4IO_displayCompressedFilesInfo()
1642 if (!UTIL_isRegFile(inFileNames[idx])) { in LZ4IO_displayCompressedFilesInfo()
1650 if (op_result != LZ4IO_LZ4F_OK) { in LZ4IO_displayCompressedFilesInfo()
1656 if (g_displayLevel < 3) { in LZ4IO_displayCompressedFilesInfo()
1666 if (cfinfo.allContentSize) { in LZ4IO_displayCompressedFilesInfo()
1673 } } } /* if (g_displayLevel < 3) */ in LZ4IO_displayCompressedFilesInfo()