1 /* 2 * error.h 3 * 4 * Written by: Stefan Frank 5 * Ullrich Hafner 6 * 7 * This file is part of FIASCO (Fractal Image And Sequence COdec) 8 * Copyright (C) 1994-2000 Ullrich Hafner 9 */ 10 11 /* 12 * $Date: 2000/03/20 21:29:59 $ 13 * $Author: hafner $ 14 * $Revision: 4.3 $ 15 * $State: Exp $ 16 */ 17 18 #ifndef _ERROR_H 19 #define _ERROR_H 20 21 #define error error_line=__LINE__,error_file=__FILE__,_error 22 #define warning error_line=__LINE__,error_file=__FILE__,_warning 23 #define file_error(fn) error_line=__LINE__,error_file=__FILE__,_file_error(fn) 24 25 #ifdef _ERROR_C 26 #define _EXTERN_TYPE 27 #else 28 #define _EXTERN_TYPE extern 29 #endif 30 31 _EXTERN_TYPE int error_line; 32 _EXTERN_TYPE const char *error_file; 33 34 void 35 init_error_handling (const char *name); 36 void 37 _error (const char *format, ...); 38 void 39 _warning (const char *format, ...); 40 void 41 _file_error (const char *filename); 42 43 #if HAVE_ASSERT_H 44 # include <assert.h> 45 #else /* not HAVE_ASSERT_H */ 46 # define assert(exp) {if (!(exp)) error ("Assertion `" #exp " != NULL' failed.");} 47 #endif /* not HAVE_ASSERT_H */ 48 49 #endif /* not _ERROR_H */ 50 51