MagickCore  7.0.8
Convert, Edit, Or Compose Bitmap Images
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
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
Definition: exception.h:64
Definition: exception.h:32
Definition: exception.h:88
Definition: exception.h:44
Definition: exception.h:93
Definition: exception.h:76
Definition: exception.h:86
Definition: exception.h:45
Definition: exception.h:73
MagickExport MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *, va_list)
Definition: exception.h:66
Definition: exception.h:68
Definition: exception.h:69
MagickExport MagickBooleanType ThrowException(ExceptionInfo *, const ExceptionType, const char *, const char *)
MagickExport ExceptionInfo * CloneExceptionInfo(ExceptionInfo *)
Definition: exception.h:52
size_t signature
Definition: exception.h:123
Definition: exception.h:95
Definition: exception.h:49
Definition: exception.h:101
Definition: exception.h:94
Definition: exception.h:96
Definition: exception.h:80
MagickExport ErrorHandler SetErrorHandler(ErrorHandler)
Definition: exception.c:873
Definition: exception.h:98
Definition: exception.h:43
Definition: exception.h:70
Definition: exception.h:85
Definition: exception.h:34
MagickExport MagickBooleanType MagickExport void InheritException(ExceptionInfo *, const ExceptionInfo *)
MagickExport MagickBooleanType MagickExport void CatchException(ExceptionInfo *)
Definition: exception.h:60
Definition: exception.h:74
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler)
Definition: exception.c:910
#define magick_attribute(x)
Definition: method-attribute.h:104
ExceptionType
Definition: exception.h:27
Definition: exception.h:91
MagickExport MagickBooleanType MagickExport void MagickError(const ExceptionType, const char *, const char *)
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:130
Definition: exception.h:77
Definition: exception.h:41
Definition: exception.h:82
MagickBooleanType
Definition: magick-type.h:158
Definition: exception.h:61
MagickExport WarningHandler SetWarningHandler(WarningHandler)
Definition: exception.c:947
char * reason
Definition: exception.h:110
Definition: exception.h:78
int error_number
Definition: exception.h:107
MagickExport MagickBooleanType MagickExport void ClearMagickException(ExceptionInfo *)
Definition: exception.h:62
Definition: exception.h:92
SemaphoreInfo * semaphore
Definition: exception.h:120
Definition: exception.h:33
MagickExport const char * GetLocaleExceptionMessage(const ExceptionType, const char *)
Definition: exception.c:643
Definition: exception.h:90
Definition: exception.h:67
Definition: exception.h:55
Definition: exception.h:46
MagickExport MagickBooleanType MagickExport void MagickFatalError(const ExceptionType, const char *, const char *)
MagickExport char * GetExceptionMessage(const int)
Definition: exception.c:525
Definition: exception.h:29
Definition: exception.h:59
void(* WarningHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:133
Definition: exception.h:35
Definition: exception.h:58
Definition: exception.h:87
Definition: exception.h:54
Definition: exception.h:75
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *)
Definition: exception.c:418
Definition: exception.h:37
Definition: exception.h:42
Definition: exception.h:47
Definition: exception.h:72
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *,...) magick_attribute((__format__(__printf__
Definition: exception.h:36
Definition: exception.h:65
Definition: exception.h:89
Definition: exception.h:97
void * exceptions
Definition: exception.h:114
Definition: exception.h:31
Definition: exception.h:39
Definition: exception.h:38
Definition: exception.h:84
Definition: exception.h:71
Definition: exception.h:81
Definition: exception.h:50
Definition: exception.h:63
#define MagickExport
Definition: method-attribute.h:80
Definition: exception.h:53
Definition: exception.h:48
Definition: exception.h:83
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:127
Definition: exception.h:79
Definition: exception.h:57
char * description
Definition: exception.h:110
Definition: exception.h:30
MagickBooleanType relinquish
Definition: exception.h:117
Definition: semaphore.c:59
Definition: exception.h:40
Definition: exception.h:56
Definition: exception.h:51
MagickExport MagickBooleanType MagickExport void MagickWarning(const ExceptionType, const char *, const char *)
Definition: exception.c:843
ExceptionType severity
Definition: exception.h:104