| 93 | } |
| 94 | |
| 95 | int main(int argc, const char** argv) |
| 96 | { |
| 97 | const char* const exeName = argv[0]; |
| 98 | |
| 99 | if (argc<2) { |
| 100 | printf("wrong arguments\n"); |
| 101 | printf("usage:\n"); |
| 102 | printf("%s FILE(s)\n", exeName); |
| 103 | return 1; |
| 104 | } |
| 105 | |
| 106 | int const cLevel = 7; |
| 107 | resources const ress = createResources_orDie(cLevel); |
| 108 | void* ofnBuffer = NULL; |
| 109 | size_t ofnbSize = 0; |
| 110 | |
| 111 | int argNb; |
| 112 | for (argNb = 1; argNb < argc; argNb++) { |
| 113 | const char* const ifn = argv[argNb]; |
| 114 | size_t const ifnSize = strlen(ifn); |
| 115 | size_t const ofnSize = ifnSize + 5; |
| 116 | if (ofnbSize <= ofnSize) { |
| 117 | ofnbSize = ofnSize + 16; |
| 118 | free(ofnBuffer); |
| 119 | ofnBuffer = malloc_orDie(ofnbSize); |
| 120 | } |
| 121 | memset(ofnBuffer, 0, ofnSize); |
| 122 | strcat(ofnBuffer, ifn); |
| 123 | strcat(ofnBuffer, ".zst"); |
| 124 | compressFile_orDie(ress, ifn, ofnBuffer); |
| 125 | } |
| 126 | |
| 127 | freeResources(ress); |
| 128 | free(ofnBuffer); |
| 129 | |
| 130 | printf("compressed %i files \n", argc-1); |
| 131 | |
| 132 | return 0; |
| 133 | } |
nothing calls this directly
no test coverage detected