MCPcopy Create free account
hub / github.com/NetHack/NetHack / main

Function main

win/share/ppmwrite.c:138–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138int
139main(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}

Callers

nothing calls this directly

Calls 7

fopen_text_fileFunction · 0.85
init_colormapFunction · 0.85
fopen_ppm_fileFunction · 0.85
fclose_text_fileFunction · 0.85
read_text_tileFunction · 0.85
write_ppm_tileFunction · 0.85
fclose_ppm_fileFunction · 0.85

Tested by

no test coverage detected