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 "magick/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))),
158 ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
159 const size_t,const ExceptionType,const char *,const char *,va_list)
160 magick_attribute((format (printf,7,0)));
162 extern MagickExport void
163 CatchException(ExceptionInfo *),
164 ClearMagickException(ExceptionInfo *),
165 GetExceptionInfo(ExceptionInfo *),
166 InheritException(ExceptionInfo *,const ExceptionInfo *),
167 MagickError(const ExceptionType,const char *,const char *),
168 MagickFatalError(const ExceptionType,const char *,const char *),
169 MagickWarning(const ExceptionType,const char *,const char *);
171 extern MagickExport WarningHandler
172 SetWarningHandler(WarningHandler);
174 #if defined(__cplusplus) || defined(c_plusplus)