errore.c
Vai alla documentazione di questo file.00001
00012 #include <stdio.h>
00013 #include <errno.h>
00014
00015
00016
00017 #ifdef _DEBUG_MODE
00018
00019 int errore(const char *file, int line, const char *msg, int error_no){
00020 fprintf(stderr,"Errore file %s, linea %d\n", file, line-1);
00021 perror(msg);
00022 fprintf(stderr,"Error No: %d\n",error_no);
00023 errno = error_no;
00024 return error_no;
00025 }
00026
00027 #else
00028
00029 int errore(const char *file, int line, const char *msg, int error_no){
00030 errno = error_no;
00031 return error_no;
00032 }
00033
00034 #endif