Updated link in README file.
[Hack-Assembler.git] / error.c
blob3fdc33126a08a50e219f183710d306839ae102b4
1 #include <ctype.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <stdio.h>
6 #include "error.h"
8 void exit_error(const int err_num, const char *err_msg)
10 fprintf(stderr, "ERROR %d: %s\n", err_num, err_msg);
12 if(pInfile != NULL) { fclose(pInfile); }
13 if(pOutfile != NULL) { fclose(pOutfile); }
15 exit(EXIT_FAILURE);
18 void warning_error(const int err_num, const char *err_msg)
20 fprintf(stderr, "WARNING: %d: %s\n", err_num, err_msg);
23 void line_notification(const int line_num)
25 fprintf(stderr, "ERROR FOUND ON LINE: %d\n", line_num);