00001 /* 00002 00003 Copyright 1996-2006 Roeland Merks 00004 00005 This file is part of Tissue Simulation Toolkit. 00006 00007 Tissue Simulation Toolkit is free software; you can redistribute 00008 it and/or modify it under the terms of the GNU General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 Tissue Simulation Toolkit is distributed in the hope that it will 00013 be useful, but WITHOUT ANY WARRANTY; without even the implied 00014 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00015 See the GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Tissue Simulation Toolkit; if not, write to the Free 00019 Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00020 02110-1301 USA 00021 00022 */ 00023 #ifndef WARNING_H_ 00024 #define WARNING_H_ 00025 00026 #define MEMORYCHECK(x) if ((x)==NULL) { fprintf(stderr, "Out of Memory error in "#x" \n"); exit(0); } 00027 00028 #define UNIDENTIFIED 2353996 00029 //static int last_value=UNIDENTIFIED; 00030 /*#define WATCH(x) if (last_value==UNIDENTIFIED) { last_value=x; 00031 } else { if (x!=last_value) { fprintf(stderr,"WATCH value changed. Suspending execution. \n Interrupt within debugger to examine position in program.\n"); 00032 last_value=x; 00033 while(1); 00034 } else { 00035 last_value=x; 00036 } 00037 }*/ 00038 00039 00040 /* These functions were a gift from Josh Barnes */ 00041 /* I changed the name "eprintf" to "warning" */ 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 void error(char *, ...); 00048 void warning(char *, ...); 00049 00050 #ifdef __cplusplus 00051 } 00052 #endif 00053 00054 #endif