| 136 | } |
| 137 | |
| 138 | int |
| 139 | main(int argc, char *argv[]) |
| 140 | { |
| 141 | pixel pixels[TILE_Y][TILE_X]; |
| 142 | |
| 143 | if (argc != 3) { |
| 144 | Fprintf(stderr, "usage: txt2ppm txtfile ppmfile\n"); |
| 145 | exit(EXIT_FAILURE); |
| 146 | } |
| 147 | |
| 148 | if (!fopen_text_file(argv[1], RDTMODE)) |
| 149 | exit(EXIT_FAILURE); |
| 150 | |
| 151 | init_colormap(); |
| 152 | |
| 153 | if (!fopen_ppm_file(argv[2], WRBMODE)) { |
| 154 | (void) fclose_text_file(); |
| 155 | exit(EXIT_FAILURE); |
| 156 | } |
| 157 | |
| 158 | while (read_text_tile(pixels)) |
| 159 | (void) write_ppm_tile(pixels); |
| 160 | |
| 161 | (void) fclose_text_file(); |
| 162 | (void) fclose_ppm_file(); |
| 163 | exit(EXIT_SUCCESS); |
| 164 | /*NOTREACHED*/ |
| 165 | return 0; |
| 166 | } |
nothing calls this directly
no test coverage detected