Lines Matching refs:pOpts
126 * @param pOpts The options.
129 static RTEXITCODE gzipPushFlushAndClose(PRTVFSIOSTREAM phVfsSrc, PCRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsDst)
149 if (!pOpts->fStdOut)
153 if (!pOpts->fKeep)
155 rc = RTFileDelete(pOpts->pszInput);
157 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to delete '%s': %Rrc", pOpts->pszInput, rc);
162 rc = RTFileDelete(pOpts->szOutput);
164 RTMsgError("Failed to delete '%s': %Rrc", pOpts->szOutput, rc);
177 * @param pOpts The options.
180 static RTEXITCODE gzipCompressFile(PRTVFSIOSTREAM phVfsSrc, PCRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsDst)
186 int rc = RTZipGzipCompressIoStream(*phVfsDst, 0 /*fFlags*/, pOpts->uLevel, &hVfsGzip);
194 return gzipPushFlushAndClose(phVfsSrc, pOpts, phVfsDst);
230 * @param pOpts The options.
233 static RTEXITCODE gzipDecompressFile(PRTVFSIOSTREAM phVfsSrc, PCRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsDst)
237 rcExit = gzipPushFlushAndClose(phVfsSrc, pOpts, phVfsDst);
247 * @param pOpts The options.
249 static RTEXITCODE gzipTestFile(PRTVFSIOSTREAM phVfsSrc, PCRTGZIPCMDOPTS pOpts)
272 static RTEXITCODE gzipListFile(PRTVFSIOSTREAM phVfsSrc, PCRTGZIPCMDOPTS pOpts)
284 * @param pOpts The options, szOutput will be filled in by this
299 static RTEXITCODE gzipOpenOutput(const char *pszFile, PRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsIos)
302 if (!strcmp(pszFile, "-") || pOpts->fStdOut)
304 strcpy(pOpts->szOutput, "-");
306 if ( !pOpts->fForce
307 && !pOpts->fDecompress
324 rc = RTStrCopy(pOpts->szOutput, sizeof(pOpts->szOutput), pszFile);
327 if (pOpts->fDecompress)
330 size_t cchSuff = strlen(pOpts->pszSuff); Assert(cchSuff > 0);
331 size_t cch = strlen(pOpts->szOutput);
333 || strcmp(&pOpts->szOutput[cch - cchSuff], pOpts->pszSuff))
334 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Input file does not end with: '%s'", pOpts->pszSuff);
335 pOpts->szOutput[cch - cchSuff] = '\0';
336 if (!RTPathFilename(pOpts->szOutput))
341 rc = RTStrCat(pOpts->szOutput, sizeof(pOpts->szOutput), pOpts->pszSuff);
348 if (pOpts->fForce)
352 rc = RTVfsIoStrmOpenNormal(pOpts->szOutput, fOpen, phVfsIos);
354 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error opening output file '%s': %Rrc", pOpts->szOutput, rc);
367 * @param pOpts The options, szOutput will be filled in by this
371 static RTEXITCODE gzipOpenInput(const char *pszFile, PRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsIos)
375 pOpts->pszInput = pszFile;
378 if ( !pOpts->fForce
379 && pOpts->fDecompress