2 Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore exception methods.
18 #ifndef _MAGICKCORE_EXCEPTION_H
19 #define _MAGICKCORE_EXCEPTION_H
21 #if defined(__cplusplus) || defined(c_plusplus)
26 #include "MagickCore/semaphore.h"
31 WarningException = 300,
32 ResourceLimitWarning = 300,
35 DelegateWarning = 315,
36 MissingDelegateWarning = 320,
37 CorruptImageWarning = 325,
38 FileOpenWarning = 330,
51 RegistryWarning = 390,
52 ConfigureWarning = 395,
55 ResourceLimitError = 400,
59 MissingDelegateError = 420,
60 CorruptImageError = 425,
77 FatalErrorException = 700,
78 ResourceLimitFatalError = 700,
80 OptionFatalError = 710,
81 DelegateFatalError = 715,
82 MissingDelegateFatalError = 720,
83 CorruptImageFatalError = 725,
84 FileOpenFatalError = 730,
86 StreamFatalError = 740,
87 CacheFatalError = 745,
88 CoderFatalError = 750,
89 FilterFatalError = 752,
90 ModuleFatalError = 755,
92 ImageFatalError = 765,
94 RandomFatalError = 775,
95 XServerFatalError = 780,
96 MonitorFatalError = 785,
97 RegistryFatalError = 790,
98 ConfigureFatalError = 795,
99 PolicyFatalError = 799
102 struct _ExceptionInfo
128 (*ErrorHandler)(const ExceptionType,const char *,const char *);
131 (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
134 (*WarningHandler)(const ExceptionType,const char *,const char *);
136 extern MagickExport char
137 *GetExceptionMessage(const int);
139 extern MagickExport const char
140 *GetLocaleExceptionMessage(const ExceptionType,const char *);
142 extern MagickExport ErrorHandler
143 SetErrorHandler(ErrorHandler);
145 extern MagickExport ExceptionInfo
146 *AcquireExceptionInfo(void),
147 *DestroyExceptionInfo(ExceptionInfo *);
149 extern MagickExport FatalErrorHandler
150 SetFatalErrorHandler(FatalErrorHandler);
152 extern MagickExport MagickBooleanType
153 ThrowException(ExceptionInfo *,const ExceptionType,const char *,
155 ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
156 const ExceptionType,const char *,const char *,...)
157 magick_attribute((format (printf,7,8)));
159 extern MagickExport void
160 CatchException(ExceptionInfo *),
161 ClearMagickException(ExceptionInfo *),
162 GetExceptionInfo(ExceptionInfo *),
163 InheritException(ExceptionInfo *,const ExceptionInfo *),
164 MagickError(const ExceptionType,const char *,const char *),
165 MagickFatalError(const ExceptionType,const char *,const char *),
166 MagickWarning(const ExceptionType,const char *,const char *);
168 extern MagickExport WarningHandler
169 SetWarningHandler(WarningHandler);
171 #if defined(__cplusplus) || defined(c_plusplus)