1 #ifndef _ERROR_H_INCLUDED_
2 #define _ERROR_H_INCLUDED_
3 
4 /*=============================================================================
5    GNU UnRTF, a command-line program to convert RTF documents to other formats.
6    Copyright (C) 2000,2001,2004 by Zachary Smith
7 
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 
22    The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
23 =============================================================================*/
24 
25 
26 /*----------------------------------------------------------------------
27  * Module name:    error.h
28  * Author name:    Zachary Smith
29  * Create date:    1 Sept 2000
30  * Purpose:        Macros to be executed at the start of a function,
31  *                 when reporting source code file/line is useful.
32  *----------------------------------------------------------------------
33  * Changes
34  * 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
35  * 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
36  * 07 Oct 11, jf@dockes.org, added _ERROR_H_INCLUDED_
37  *--------------------------------------------------------------------*/
38 
39 
40 #define CHECK_PARAM_NOT_NULL(XX) { if ((XX)==NULL) { fprintf (stderr, "internal error: null pointer param in %s at %d\n", __FILE__, __LINE__); exit (1); }}
41 
42 #define CHECK_MALLOC_SUCCESS(XX) { if ((XX)==NULL) { fprintf (stderr, "internal error: cannot allocate memory in %s at %d\n", __FILE__, __LINE__); exit (1); }}
43 
44 
45 extern void usage(void);
46 extern void error_handler(char *);
47 extern void warning_handler(char *);
48 
49 
50 
51 #endif /* _ERROR_H_INCLUDED_ */
52