MagickCore  7.0.3
exception.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 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. You may
6  obtain a copy of the License at
7 
8  https://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 #include "MagickCore/semaphore.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 typedef enum
28 {
32  TypeWarning = 305,
38  BlobWarning = 335,
40  CacheWarning = 345,
41  CoderWarning = 350,
44  DrawWarning = 360,
45  ImageWarning = 365,
46  WandWarning = 370,
55  TypeError = 405,
56  OptionError = 410,
61  BlobError = 435,
62  StreamError = 440,
63  CacheError = 445,
64  CoderError = 450,
65  FilterError = 452,
66  ModuleError = 455,
67  DrawError = 460,
68  ImageError = 465,
69  WandError = 470,
70  RandomError = 475,
71  XServerError = 480,
72  MonitorError = 485,
75  PolicyError = 499,
100 
102 {
105 
106  int
108 
109  char
111  *description;
112 
113  void
115 
118 
121 
122  size_t
124 };
125 
126 typedef void
127  (*ErrorHandler)(const ExceptionType,const char *,const char *);
128 
129 typedef void
130  (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
131 
132 typedef void
133  (*WarningHandler)(const ExceptionType,const char *,const char *);
134 
135 extern MagickExport char
136  *GetExceptionMessage(const int);
137 
138 extern MagickExport const char
139  *GetLocaleExceptionMessage(const ExceptionType,const char *);
140 
143 
145  *AcquireExceptionInfo(void),
148 
151 
153  ThrowException(ExceptionInfo *,const ExceptionType,const char *,
154  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)));
160 
161 extern MagickExport void
163  ClearMagickException(ExceptionInfo *),
164  InheritException(ExceptionInfo *,const ExceptionInfo *),
165  MagickError(const ExceptionType,const char *,const char *),
166  MagickFatalError(const ExceptionType,const char *,const char *),
167  MagickWarning(const ExceptionType,const char *,const char *);
168 
171 
172 #if defined(__cplusplus) || defined(c_plusplus)
173 }
174 #endif
175 
176 #endif
MagickExport ExceptionInfo * CloneExceptionInfo(ExceptionInfo *exception)
Definition: exception.c:251
size_t signature
Definition: exception.h:123
MagickExport void MagickError(const ExceptionType error, const char *reason, const char *description)
Definition: exception.c:714
MagickExport WarningHandler SetWarningHandler(WarningHandler handler)
Definition: exception.c:880
MagickExport void MagickWarning(const ExceptionType warning, const char *reason, const char *description)
Definition: exception.c:784
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
Definition: exception.c:108
MagickExport char * GetExceptionMessage(const int error)
Definition: exception.c:466
#define magick_attribute(x)
ExceptionType
Definition: exception.h:27
MagickExport MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format, va_list operands)
Definition: exception.c:1023
MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception, const ExceptionType severity, const char *reason, const char *description)
Definition: exception.c:921
MagickBooleanType
Definition: magick-type.h:158
MagickExport ErrorHandler SetErrorHandler(ErrorHandler handler)
Definition: exception.c:814
char * reason
Definition: exception.h:110
SemaphoreInfo * semaphore
Definition: exception.h:120
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:127
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1074
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler handler)
Definition: exception.c:847
MagickExport void CatchException(ExceptionInfo *exception)
Definition: exception.c:196
MagickExport void ClearMagickException(ExceptionInfo *exception)
Definition: exception.c:157
void(* WarningHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:133
void * exceptions
Definition: exception.h:114
#define MagickExport
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:130
MagickExport const char * GetLocaleExceptionMessage(const ExceptionType severity, const char *tag)
Definition: exception.c:584
char * description
Definition: exception.h:110
MagickExport void MagickFatalError(const ExceptionType error, const char *reason, const char *description)
Definition: exception.c:750
MagickBooleanType relinquish
Definition: exception.h:117
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
Definition: exception.c:411
MagickExport void InheritException(ExceptionInfo *exception, const ExceptionInfo *relative)
Definition: exception.c:628
ExceptionType severity
Definition: exception.h:104