Ejemplo n.º 1
0
int main () {

    readMaster();
    writeLangList();
    checkMissing();
    writeMasterKeys();

    return 0;
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
	if (argc != 3) {
		fprintf(stderr, "%s file\n", argv[0]);
		exit(EXIT_FAILURE);
	}

	fd1 = open(argv[1], O_RDONLY);
	if (fd1 == -1)
		handle_error("open");
	if (fstat(fd1, &sb) == -1)    /* To obtain file size */
		handle_error("fstat");
	fd2 = open(argv[2], O_RDONLY);
	if (fd2 == -1)
		handle_error("open");
	if (fstat(fd2, &sb) == -1)    /* To obtain file size */
		handle_error("fstat");

	parseFile(fd1);
	parseFile(fd2);
	findSymbolDefinitions();
	printUndefinedSymbols();


	if (numOfStart == 0) {
		printf("_start check: FAILED\n");
	}
	else {
		printf("_start check: PASSED\n");
	}
	if (duplicate == 0) {
		printf("duplicate check: PASSED\n");
	}
	checkMissing();

	if (numOfStart == 0 || duplicate != 0||missing!=0){
		exit(-1);
	}
	else
		printf("no missing symbols: PASSED\n");


	exit(EXIT_SUCCESS);
}