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

Function main

win/share/gifread.c:655–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653};
654
655int
656main(int argc, char *argv[])
657{
658 pixel pixels[TILE_Y][TILE_X];
659
660 if (argc == 1) {
661 argc = SIZE(std_args);
662 argv = (char **) std_args;
663 } else if (argc != 3) {
664 Fprintf(stderr, "usage: gif2txt giffile txtfile\n");
665 exit(EXIT_FAILURE);
666 }
667
668 while (argc > 1) {
669 if (!fopen_gif_file(argv[1], RDBMODE))
670 exit(EXIT_FAILURE);
671
672 init_colormap();
673
674 if (!fopen_text_file(argv[2], WRTMODE)) {
675 (void) fclose_gif_file();
676 exit(EXIT_FAILURE);
677 }
678
679 while (read_gif_tile(pixels))
680 (void) write_text_tile(pixels);
681
682 (void) fclose_gif_file();
683 (void) fclose_text_file();
684
685 argc -= 2;
686 argv += 2;
687 }
688 exit(EXIT_SUCCESS);
689 /*NOTREACHED*/
690 return 0;
691}
692#endif

Callers

nothing calls this directly

Calls 7

fopen_gif_fileFunction · 0.85
init_colormapFunction · 0.85
fopen_text_fileFunction · 0.85
fclose_gif_fileFunction · 0.85
read_gif_tileFunction · 0.85
write_text_tileFunction · 0.85
fclose_text_fileFunction · 0.85

Tested by

no test coverage detected