about summary refs log tree commit diff
path: root/converter/other/fiasco/binerror.h
blob: e7ff43c97c4a82f693d01b5370cd955686bb2abc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 *  error.h
 *  
 *  Written by:		Stefan Frank
 *			Ullrich Hafner
 *
 *  This file is part of FIASCO («F»ractal «I»mage «A»nd «S»equence «CO»dec)
 *  Copyright (C) 1994-2000 Ullrich Hafner <hafner@bigfoot.de>
 */

/*
 *  $Date: 2000/03/20 21:29:59 $
 *  $Author: hafner $
 *  $Revision: 4.3 $
 *  $State: Exp $
 */

#ifndef _ERROR_H
#define _ERROR_H

#define error          error_line=__LINE__,error_file=__FILE__,_error
#define warning        error_line=__LINE__,error_file=__FILE__,_warning
#define file_error(fn) error_line=__LINE__,error_file=__FILE__,_file_error(fn)

#ifdef _ERROR_C
#define _EXTERN_TYPE
#else
#define _EXTERN_TYPE	extern
#endif

_EXTERN_TYPE int   error_line;
_EXTERN_TYPE const char *error_file;

void
init_error_handling (const char *name);
void
_error (const char *format, ...);
void
_warning (const char *format, ...);
void
_file_error (const char *filename);

#if HAVE_ASSERT_H
#	include <assert.h>
#else /* not HAVE_ASSERT_H */
#	define assert(exp)	{if (!(exp)) error ("Assertion `" #exp " != NULL' failed.");}
#endif /* not HAVE_ASSERT_H */

#endif /* not _ERROR_H */