| 68 | } |
| 69 | |
| 70 | int main(int argc, const char** argv) |
| 71 | { |
| 72 | const char* const exeName = argv[0]; |
| 73 | int const cLevel = 3; |
| 74 | |
| 75 | if (argc<3) { |
| 76 | fprintf(stderr, "wrong arguments\n"); |
| 77 | fprintf(stderr, "usage:\n"); |
| 78 | fprintf(stderr, "%s [FILES] dictionary\n", exeName); |
| 79 | return 1; |
| 80 | } |
| 81 | |
| 82 | /* load dictionary only once */ |
| 83 | const char* const dictName = argv[argc-1]; |
| 84 | ZSTD_CDict* const dictPtr = createCDict_orDie(dictName, cLevel); |
| 85 | |
| 86 | int u; |
| 87 | for (u=1; u<argc-1; u++) { |
| 88 | const char* inFilename = argv[u]; |
| 89 | char* const outFilename = createOutFilename_orDie(inFilename); |
| 90 | compress(inFilename, outFilename, dictPtr); |
| 91 | free(outFilename); |
| 92 | } |
| 93 | |
| 94 | ZSTD_freeCDict(dictPtr); |
| 95 | printf("All %u files compressed. \n", argc-2); |
| 96 | return 0; |
| 97 | } |
nothing calls this directly
no test coverage detected