Elaborato_SO/src/errExit.c

19 lines
426 B
C

#include <stdio.h>
#include <stdlib.h>
#include <errExit.h>
void errExit(char *func, char *where) {
fprintf(stderr, "\033[91m<Error>\033[39m %s failed in %s\n", func, where);
perror("");
exit(1);
}
void warningMsg(char *msg) {
fprintf(stderr, "\033[0;33m<Warning>\033[39m %s\n", msg);
}
void errExitMsg(char *msg) {
fprintf(stderr, "\033[91m<Error>\033[39m %s\n", msg);
exit(1);
}