This repository was archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPapyErrorMacros3.h
105 lines (92 loc) · 5.39 KB
/
PapyErrorMacros3.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/********************************************************************************/
/* */
/* Papyrus 3 library. */
/* This library constitutes a DICOM file system which helps reading and writing */
/* DICOM files and DICOMDIR files. */
/* */
/* Copyright (C) 2004 - Service of Medical Informatics - */
/* University Hospitals of Geneva (HUG), Geneva, Switzerland */
/* */
/* This library is a free software; you can redistribute it and/or modify it */
/* under the terms of the GNU Lesser General Public License as published by the */
/* Free Software Foundation; either version 2.1 of the License, or */
/* (at your option) any later version. */
/* */
/* This library is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/* See the GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this library; if not, write to */
/* the Free Software Foundation, Inc., */
/* 59 Temple Place, Suite 330, */
/* Boston, MA 02111-1307 USA */
/* */
/* You can contact us for more information at [email protected] */
/* or by writing to Papyrus, */
/* Unite d'Imagerie Numerique / Service d'Informatique Medicale / HUG, */
/* 24, Micheli-du-Crest street, 1211 Geneva 14, Switzerland. */
/* */
/* The University Hopitals of Geneva, hereby disclaims all copyright interest */
/* in the library `Papyrus' (a library for reading and writing DICOM files). */
/* */
/* Geneva, april 2004 */
/* Antoine Geissbuhler, head of the Service of Medical Informatics, */
/* University Hospitals of Geneva, Switzerland */
/* */
/********************************************************************************/
/********************************************************************************/
/* */
/* Project : P A P Y R U S Toolkit */
/* File : PapyErrorMacros3.h */
/* Function : contains the fatal, warning and debug printing messages */
/* Authors : Jean-Francois Vurlod */
/* */
/* History : 12.1991 version 1.2 */
/* 06.1993 version 2.0 */
/* 06.1994 version 3.0 */
/* 06.1995 version 3.1 */
/* 02.1996 version 3.3 */
/* 02.1999 version 3.6 */
/* 04.2001 version 3.7 */
/* 09.2001 version 3.7 on CVS */
/* 10.2001 version 3.71 MAJ Dicom par CHG */
/* */
/********************************************************************************/
#ifndef __Papy3ErrorMacros__
#define __Papy3ErrorMacros__
#include <stdio.h>
/* Eventually there should be a "SetFatalErrorHandler" function. */
#define PAPY_FATAL_ERROR(code,str)\
{\
fprintf(stderr,\
"\nFatal Error -- Code: %d\n\tMessage: %s\n\tFile: %s Line: %d\n",\
code,\
str,\
__FILE__,\
__LINE__);\
if (ExitWhenError) exit((int)code);\
}
#define PAPY_WARNING(code,str)\
{\
fprintf(stderr,\
"\nWARNING -- Code: %d\n\tMessage: %s\n\tFile: %s Line: %d\n",\
code,\
str,\
__FILE__,\
__LINE__);\
}
#ifdef DEBUG
#define PAPY_DEBUG(str)\
{\
fprintf(stderr,\
"\nDEBUG -- Message: %s\n\tFile: %s Line: %d\n",\
str,\
__FILE__,\
__LINE__);\
}
#else
#define PAPY_DEBUG(str)
#endif
#endif /* __Papy3ErrorMacros__ */