2 Copyright 1999-2014 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 #include "MagickCore/semaphore.h"
23 #if defined(__cplusplus) || defined(c_plusplus)
30 WarningException = 300,
31 ResourceLimitWarning = 300,
34 DelegateWarning = 315,
35 MissingDelegateWarning = 320,
36 CorruptImageWarning = 325,
37 FileOpenWarning = 330,
50 RegistryWarning = 390,
51 ConfigureWarning = 395,
54 ResourceLimitError = 400,
58 MissingDelegateError = 420,
59 CorruptImageError = 425,
76 FatalErrorException = 700,
77 ResourceLimitFatalError = 700,
79 OptionFatalError = 710,
80 DelegateFatalError = 715,
81 MissingDelegateFatalError = 720,
82 CorruptImageFatalError = 725,
83 FileOpenFatalError = 730,
85 StreamFatalError = 740,
86 CacheFatalError = 745,
87 CoderFatalError = 750,
88 FilterFatalError = 752,
89 ModuleFatalError = 755,
91 ImageFatalError = 765,
93 RandomFatalError = 775,
94 XServerFatalError = 780,
95 MonitorFatalError = 785,
96 RegistryFatalError = 790,
97 ConfigureFatalError = 795,
98 PolicyFatalError = 799
101 struct _ExceptionInfo
127 (*ErrorHandler)(const ExceptionType,const char *,const char *);
130 (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
133 (*WarningHandler)(const ExceptionType,const char *,const char *);
135 extern MagickExport char
136 *GetExceptionMessage(const int);
138 extern MagickExport const char
139 *GetLocaleExceptionMessage(const ExceptionType,const char *);
141 extern MagickExport ErrorHandler
142 SetErrorHandler(ErrorHandler);
144 extern MagickExport ExceptionInfo
145 *AcquireExceptionInfo(void),
146 *CloneExceptionInfo(ExceptionInfo *),
147 *DestroyExceptionInfo(ExceptionInfo *);
149 extern MagickExport FatalErrorHandler
150 SetFatalErrorHandler(FatalErrorHandler);
152 extern MagickExport MagickBooleanType
153 ThrowException(ExceptionInfo *,const ExceptionType,const char *,
155 ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
156 const size_t,const ExceptionType,const char *,const char *,va_list),
157 ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
158 const ExceptionType,const char *,const char *,...)
159 magick_attribute((__format__ (__printf__,7,8)));
161 extern MagickExport void
162 CatchException(ExceptionInfo *),
163 ClearMagickException(ExceptionInfo *),
164 GetExceptionInfo(ExceptionInfo *),
165 InheritException(ExceptionInfo *,const ExceptionInfo *),
166 MagickError(const ExceptionType,const char *,const char *),
167 MagickFatalError(const ExceptionType,const char *,const char *),
168 MagickWarning(const ExceptionType,const char *,const char *);
170 extern MagickExport WarningHandler
171 SetWarningHandler(WarningHandler);
173 #if defined(__cplusplus) || defined(c_plusplus)