MagickCore  6.9.11-60
Convert, Edit, Or Compose Bitmap Images
exception.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2021 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 <stdarg.h>
22 #include "magick/semaphore.h"
23 
24 #if defined(__cplusplus) || defined(c_plusplus)
25 extern "C" {
26 #endif
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,
99  PolicyFatalError = 799
101 
103 {
106 
107  int
109 
110  char
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 
149 
152 
155  const char *),
156  ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
157  const ExceptionType,const char *,const char *,...)
158  magick_attribute((__format__ (__printf__,7,8))),
159  ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
160  const size_t,const ExceptionType,const char *,const char *,va_list)
161  magick_attribute((__format__ (__printf__,7,0)));
162 
163 extern MagickExport void
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
MagickExport MagickBooleanType magick_attribute((deprecated))
MagickExport MagickBooleanType MagickExport void MagickWarning(const ExceptionType, const char *, const char *)
Definition: exception.c:848
ExceptionType
Definition: exception.h:29
@ CoderWarning
Definition: exception.h:42
@ CoderError
Definition: exception.h:65
@ ImageError
Definition: exception.h:69
@ FileOpenFatalError
Definition: exception.h:84
@ MonitorWarning
Definition: exception.h:50
@ RegistryError
Definition: exception.h:74
@ FatalErrorException
Definition: exception.h:77
@ WandFatalError
Definition: exception.h:93
@ ModuleWarning
Definition: exception.h:44
@ WandWarning
Definition: exception.h:47
@ PolicyError
Definition: exception.h:76
@ CacheWarning
Definition: exception.h:41
@ StreamFatalError
Definition: exception.h:86
@ PolicyWarning
Definition: exception.h:53
@ UndefinedException
Definition: exception.h:30
@ RegistryWarning
Definition: exception.h:51
@ ImageFatalError
Definition: exception.h:92
@ OptionWarning
Definition: exception.h:34
@ FilterFatalError
Definition: exception.h:89
@ BlobWarning
Definition: exception.h:39
@ DelegateError
Definition: exception.h:58
@ ConfigureError
Definition: exception.h:75
@ FileOpenError
Definition: exception.h:61
@ CacheError
Definition: exception.h:64
@ RandomWarning
Definition: exception.h:48
@ WarningException
Definition: exception.h:31
@ MissingDelegateError
Definition: exception.h:59
@ CoderFatalError
Definition: exception.h:88
@ DrawFatalError
Definition: exception.h:91
@ BlobError
Definition: exception.h:62
@ ResourceLimitWarning
Definition: exception.h:32
@ XServerFatalError
Definition: exception.h:95
@ ConfigureWarning
Definition: exception.h:52
@ StreamWarning
Definition: exception.h:40
@ TypeWarning
Definition: exception.h:33
@ XServerError
Definition: exception.h:72
@ PolicyFatalError
Definition: exception.h:99
@ CacheFatalError
Definition: exception.h:87
@ RegistryFatalError
Definition: exception.h:97
@ FileOpenWarning
Definition: exception.h:38
@ MissingDelegateWarning
Definition: exception.h:36
@ BlobFatalError
Definition: exception.h:85
@ TypeFatalError
Definition: exception.h:79
@ DrawWarning
Definition: exception.h:45
@ RandomFatalError
Definition: exception.h:94
@ OptionFatalError
Definition: exception.h:80
@ ErrorException
Definition: exception.h:54
@ StreamError
Definition: exception.h:63
@ MonitorError
Definition: exception.h:73
@ WandError
Definition: exception.h:70
@ FilterError
Definition: exception.h:66
@ MissingDelegateFatalError
Definition: exception.h:82
@ ConfigureFatalError
Definition: exception.h:98
@ TypeError
Definition: exception.h:56
@ CorruptImageWarning
Definition: exception.h:37
@ ModuleError
Definition: exception.h:67
@ ResourceLimitFatalError
Definition: exception.h:78
@ DelegateWarning
Definition: exception.h:35
@ RandomError
Definition: exception.h:71
@ ResourceLimitError
Definition: exception.h:55
@ DrawError
Definition: exception.h:68
@ OptionError
Definition: exception.h:57
@ ImageWarning
Definition: exception.h:46
@ XServerWarning
Definition: exception.h:49
@ FilterWarning
Definition: exception.h:43
@ ModuleFatalError
Definition: exception.h:90
@ CorruptImageError
Definition: exception.h:60
@ MonitorFatalError
Definition: exception.h:96
@ DelegateFatalError
Definition: exception.h:81
@ CorruptImageFatalError
Definition: exception.h:83
void(* WarningHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:134
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *,...) magick_attribute((__format__(__printf__
MagickExport MagickBooleanType MagickExport void ClearMagickException(ExceptionInfo *)
MagickExport ErrorHandler SetErrorHandler(ErrorHandler)
Definition: exception.c:878
MagickExport const char * GetLocaleExceptionMessage(const ExceptionType, const char *)
Definition: exception.c:648
MagickExport MagickBooleanType MagickExport void InheritException(ExceptionInfo *, const ExceptionInfo *)
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:131
MagickExport char * GetExceptionMessage(const int)
Definition: exception.c:530
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:128
MagickExport MagickBooleanType MagickExport void CatchException(ExceptionInfo *)
MagickExport ExceptionInfo * CloneExceptionInfo(ExceptionInfo *)
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *)
Definition: exception.c:448
MagickExport MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *, va_list) magick_attribute((__format__(__printf__
MagickExport WarningHandler SetWarningHandler(WarningHandler)
Definition: exception.c:952
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler)
Definition: exception.c:915
MagickExport MagickBooleanType MagickExport void MagickError(const ExceptionType, const char *, const char *)
MagickExport MagickBooleanType MagickExport void MagickFatalError(const ExceptionType, const char *, const char *)
MagickExport MagickBooleanType ThrowException(ExceptionInfo *, const ExceptionType, const char *, const char *)
MagickBooleanType
Definition: magick-type.h:203
#define MagickExport
Definition: method-attribute.h:80
Definition: semaphore.c:61
Definition: exception.h:103
MagickBooleanType relinquish
Definition: exception.h:118
char * reason
Definition: exception.h:111
ExceptionType severity
Definition: exception.h:105
int error_number
Definition: exception.h:108
SemaphoreInfo * semaphore
Definition: exception.h:121
char * description
Definition: exception.h:112
void * exceptions
Definition: exception.h:115
size_t signature
Definition: exception.h:124