2 Copyright 1999-2009 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,
50 RegistryWarning = 390,
51 ConfigureWarning = 395,
54 ResourceLimitError = 400,
58 MissingDelegateError = 420,
59 CorruptImageError = 425,
75 FatalErrorException = 700,
76 ResourceLimitFatalError = 700,
78 OptionFatalError = 710,
79 DelegateFatalError = 715,
80 MissingDelegateFatalError = 720,
81 CorruptImageFatalError = 725,
82 FileOpenFatalError = 730,
84 StreamFatalError = 740,
85 CacheFatalError = 745,
86 CoderFatalError = 750,
87 ModuleFatalError = 755,
89 ImageFatalError = 765,
91 RandomFatalError = 775,
92 XServerFatalError = 780,
93 MonitorFatalError = 785,
94 RegistryFatalError = 790,
95 ConfigureFatalError = 795,
96 PolicyFatalError = 799
125 (*ErrorHandler)(const ExceptionType,const char *,const char *);
128 (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
131 (*WarningHandler)(const ExceptionType,const char *,const char *);
133 extern MagickExport char
134 *GetExceptionMessage(const int);
136 extern MagickExport const char
137 *GetLocaleExceptionMessage(const ExceptionType,const char *);
139 extern MagickExport ErrorHandler
140 SetErrorHandler(ErrorHandler);
142 extern MagickExport ExceptionInfo
143 *AcquireExceptionInfo(void),
144 *DestroyExceptionInfo(ExceptionInfo *);
146 extern MagickExport FatalErrorHandler
147 SetFatalErrorHandler(FatalErrorHandler);
149 extern MagickExport MagickBooleanType
150 ThrowException(ExceptionInfo *,const ExceptionType,const char *,
152 ThrowMagickException(ExceptionInfo *,const char *,const char *,
153 const unsigned long,const ExceptionType,const char *,const char *,...)
154 magick_attribute((format (printf,7,8))),
155 ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
156 const unsigned long,const ExceptionType,const char *,const char *,va_list)
157 magick_attribute((format (printf,7,0)));
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)