12 fprintf(stderr,
"Error while reading a comment from %s\n", filename);
27 for (
int i = 0; i < length; ++i)
33int main(
int argc,
char* argv[])
38 "compare_files expects two arguments <filename1, filename2>\n");
42 FILE *f1 = fopen(argv[1],
"rb");
45 fprintf(stderr,
"Unable to open file %s.\n", argv[1]);
49 FILE *f2 = fopen(argv[2],
"rb");
52 fprintf(stderr,
"Unable to open file %s.\n", argv[2]);
56 bool tile_started =
false;
63 bool eof1 = (feof(f1) != 0), eof2 = (feof(f2) != 0);
67 fprintf(stdout,
"Matching files.\n");
70 else if (!eof1 && !eof2)
74 if (!tile_started && old_c1 == 0xFF && c1 == 0x64) {
78 if (!tile_started && old_c1 == 0xFF && c1 == 0x90) {
87 fprintf(stderr,
"One file finished before the other one.\n");
static int getc_and_check(FILE *f, const char *filename)
int main(int argc, char *argv[])
static void eat_comments(FILE *f, const char *filename, int &c) noexcept