MagickCore  6.8.5
exception.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License.
6  obtain a copy of the License at
7 
8  http://www.imagemagick.org/script/license.php
9 
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.
15 
16  MagickCore exception methods.
17 */
18 #ifndef _MAGICKCORE_EXCEPTION_H
19 #define _MAGICKCORE_EXCEPTION_H
20 
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24 
25 #include <stdarg.h>
26 #include "magick/semaphore.h"
27 
28 typedef enum
29 {
33  TypeWarning = 305,
39  BlobWarning = 335,
41  CacheWarning = 345,
42  CoderWarning = 350,
45  DrawWarning = 360,
46  ImageWarning = 365,
47  WandWarning = 370,
56  TypeError = 405,
57  OptionError = 410,
62  BlobError = 435,
63  StreamError = 440,
64  CacheError = 445,
65  CoderError = 450,
66  FilterError = 452,
67  ModuleError = 455,
68  DrawError = 460,
69  ImageError = 465,
70  WandError = 470,
71  RandomError = 475,
72  XServerError = 480,
73  MonitorError = 485,
76  PolicyError = 499,
100 } ExceptionType;
101 
103 {
106 
107  int
109 
110  char
112  *description;
113 
114  void
116 
119 
122 
123  size_t
125 };
126 
127 typedef void
128  (*ErrorHandler)(const ExceptionType,const char *,const char *);
129 
130 typedef void
131  (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
132 
133 typedef void
134  (*WarningHandler)(const ExceptionType,const char *,const char *);
135 
136 extern MagickExport char
137  *GetExceptionMessage(const int);
138 
139 extern MagickExport const char
140  *GetLocaleExceptionMessage(const ExceptionType,const char *);
141 
144 
146  *AcquireExceptionInfo(void),
148 
151 
153  ThrowException(ExceptionInfo *,const ExceptionType,const char *,
154  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)));
161 
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 *);
170 
173 
174 #if defined(__cplusplus) || defined(c_plusplus)
175 }
176 #endif
177 
178 #endif