Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
hit_error.h
Go to the documentation of this file.
1 
13 /*
14  * <license>
15  *
16  * Hitmap v1.2
17  *
18  * This software is provided to enhance knowledge and encourage progress in the scientific
19  * community. It should be used only for research and educational purposes. Any reproduction
20  * or use for commercial purpose, public redistribution, in source or binary forms, with or
21  * without modifications, is NOT ALLOWED without the previous authorization of the copyright
22  * holder. The origin of this software must not be misrepresented; you must not claim that you
23  * wrote the original software. If you use this software for any purpose (e.g. publication),
24  * a reference to the software package and the authors must be included.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY
27  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
29  * THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  * Copyright (c) 2007-2015, Trasgo Group, Universidad de Valladolid.
37  * All rights reserved.
38  *
39  * More information on http://trasgo.infor.uva.es/
40  *
41  * </license>
42 */
43 
44 #ifndef _HitError_
45 #define _HitError_
46 
47 #include <stdio.h>
48 
49 /* MACRO TO AVOID WARNINGS WHEN A PARAMETER IS NOT USED */
50 #define HIT_NOT_USED(x) ((void)(x))
51 
52 /* ERROR CODES */
53 #define HIT_OK 0
54 #define HIT_ERROR -1
55 #define HIT_ERR_INTERNAL -10
56 #define HIT_ERR_USER -100
57 
58 
59 
60 
61 
62 /* INTERNAL ERROR AND WARNING MESSAGES */
63 #define hit_errInternal( routine, text, extraParam, file, numLine ) \
64  { \
65  fprintf(stderr,"Hit RunTime-Error (%s): Internal - %s %s, used in %s[%d]\n", routine, text, extraParam, file, numLine); \
66  exit( HIT_ERR_INTERNAL ); \
67  }
68 
69 #define hit_warnInternal( routine, text, extraParam, file, numLine ) \
70  { \
71  fprintf(stderr,"Hit RunTime-Warning (%s): Internal - %s %s, used in %s[%d]\n", routine, text, extraParam, file, numLine); \
72  }
73 
74 
75 /* ERROR AND WARNING MESSAGES FOR PROGRAMMERS/USERS */
76 #define hit_error( name, file, numLine ) \
77  { \
78  fprintf(stderr,"Hit Programmer, RunTime-Error: %s, in %s[%d]\n", name, file, numLine); \
79  exit( HIT_ERR_USER ); \
80  }
81 
82 #define hit_warning( name, file, numLine ) \
83  { \
84  fprintf(stderr,"Hit Programmer, RunTime-Warning: %s, in %s[%d]\n", name, file, numLine); \
85  }
86 
87 #define hit_error_here(name) hit_error(name, __FILE__, __LINE__)
88 #define hit_warning_here(name) hit_warning(name, __FILE__, __LINE__)
89 
90 
95 char * get_gdb_trace();
96 
97 #endif
98 
99 /* END OF HEADER FILE _HitError_ */
char * get_gdb_trace()
Definition: hit_error.c:45