| 191 | } |
| 192 | |
| 193 | static int |
| 194 | repack(const char *inFileName, const char *outFileName, Format format, int quality) |
| 195 | { |
| 196 | int ret = EXIT_FAILURE; |
| 197 | |
| 198 | trace::File *inFile = trace::File::createForRead(inFileName); |
| 199 | if (!inFile) { |
| 200 | return 1; |
| 201 | } |
| 202 | |
| 203 | trace::OutStream *outFile = nullptr; |
| 204 | if (format == FORMAT_SNAPPY) { |
| 205 | outFile = trace::createSnappyStream(outFileName); |
| 206 | } else if (format == FORMAT_BROTLI) { |
| 207 | ret = repack_brotli(inFile, outFileName, quality); |
| 208 | delete inFile; |
| 209 | return ret; |
| 210 | } else if (format == FORMAT_ZLIB) { |
| 211 | outFile = trace::createZLibStream(outFileName); |
| 212 | } else if (format == FORMAT_ZSTD) { |
| 213 | outFile = trace::createZstdStream(outFileName, quality); |
| 214 | } |
| 215 | if (outFile) { |
| 216 | ret = repack_generic(inFile, outFile); |
| 217 | delete outFile; |
| 218 | } |
| 219 | |
| 220 | delete inFile; |
| 221 | |
| 222 | return ret; |
| 223 | } |
| 224 | |
| 225 | static int |
| 226 | command(int argc, char *argv[]) |
no test coverage detected