Created
January 28, 2014 06:29
-
-
Save dardevelin/8663132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdarg.h> | |
#include "error.h" | |
void __error_report(const char *fname, int line, int e_code, const char *fmt, ...) | |
{ | |
va_list args; | |
va_start(args, fmt); | |
fprintf(stderr,"elog_message:\n"); | |
fprintf(stderr,"\tin : %s\tline: %d\n", fname, line); | |
fprintf(stderr,"\te_type: %d\n\tmsg : ", e_code); | |
vfprintf(stderr, fmt, args); | |
putchar('\n'); | |
va_end(args); | |
}//end error report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef M_ERROR_REPORT_H_ | |
#define M_ERROR_REPORT_H_ | |
void __error_report(const char *fname, int line, int e_code, const char *fmt, ...); | |
//char *e_name_resolution(int e_code); | |
#define error(...) __error_report(__func__,__LINE__,__VA_ARGS__); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment