MagickCore  6.9.10
Convert, Edit, Or Compose Bitmap Images
exception.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2018 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  https://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 #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,
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),
149 
152 
154  ThrowException(ExceptionInfo *,const ExceptionType,const char *,
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
164  CatchException(ExceptionInfo *),
165  ClearMagickException(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
Definition: exception.h:65
Definition: exception.h:33
Definition: exception.h:89
Definition: exception.h:45
Definition: exception.h:94
Definition: exception.h:77
Definition: exception.h:87
Definition: exception.h:46
Definition: exception.h:74
Definition: exception.h:67
Definition: exception.h:69
Definition: exception.h:70
MagickExport MagickBooleanType ThrowException(ExceptionInfo *, const ExceptionType, const char *, const char *)
MagickExport ExceptionInfo * CloneExceptionInfo(ExceptionInfo *)
Definition: exception.h:53
size_t signature
Definition: exception.h:124
Definition: exception.h:96
Definition: exception.h:50
Definition: exception.h:102
Definition: exception.h:95
Definition: exception.h:97
Definition: exception.h:81
MagickExport ErrorHandler SetErrorHandler(ErrorHandler)
Definition: exception.c:819
Definition: exception.h:99
Definition: exception.h:44
Definition: exception.h:71
Definition: exception.h:86
Definition: exception.h:35
MagickExport MagickBooleanType MagickExport void InheritException(ExceptionInfo *, const ExceptionInfo *)
MagickExport MagickBooleanType MagickExport void CatchException(ExceptionInfo *)
Definition: exception.h:61
Definition: exception.h:75
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler)
Definition: exception.c:852
ExceptionType
Definition: exception.h:28
Definition: exception.h:92
MagickExport MagickBooleanType MagickExport void MagickError(const ExceptionType, const char *, const char *)
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:131
Definition: exception.h:78
Definition: exception.h:42
Definition: exception.h:83
MagickBooleanType
Definition: magick-type.h:189
Definition: exception.h:62
MagickExport WarningHandler SetWarningHandler(WarningHandler)
Definition: exception.c:885
char * reason
Definition: exception.h:111
Definition: exception.h:79
int error_number
Definition: exception.h:108
MagickExport MagickBooleanType MagickExport void ClearMagickException(ExceptionInfo *)
Definition: exception.h:63
Definition: exception.h:93
MagickExport MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *, va_list) magick_attribute((__format__(__printf__
SemaphoreInfo * semaphore
Definition: exception.h:121
Definition: exception.h:34
MagickExport const char * GetLocaleExceptionMessage(const ExceptionType, const char *)
Definition: exception.c:589
Definition: exception.h:91
Definition: exception.h:68
Definition: exception.h:56
Definition: exception.h:47
MagickExport MagickBooleanType MagickExport void MagickFatalError(const ExceptionType, const char *, const char *)
MagickExport char * GetExceptionMessage(const int)
Definition: exception.c:471
Definition: exception.h:30
Definition: exception.h:60
void(* WarningHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:134
Definition: exception.h:36
Definition: exception.h:59
Definition: exception.h:88
Definition: exception.h:55
Definition: exception.h:76
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *)
Definition: exception.c:441
MagickExport MagickBooleanType magick_attribute((deprecated))
Definition: exception.h:38
Definition: exception.h:43
Definition: exception.h:48
Definition: exception.h:73
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *,...) magick_attribute((__format__(__printf__
Definition: exception.h:37
Definition: exception.h:66
Definition: exception.h:90
Definition: exception.h:98
void * exceptions
Definition: exception.h:115
Definition: exception.h:32
Definition: exception.h:40
Definition: exception.h:39
Definition: exception.h:85
Definition: exception.h:72
Definition: exception.h:82
Definition: exception.h:51
Definition: exception.h:64
#define MagickExport
Definition: method-attribute.h:98
Definition: exception.h:54
Definition: exception.h:49
Definition: exception.h:84
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:128
Definition: exception.h:80
Definition: exception.h:58
char * description
Definition: exception.h:111
Definition: exception.h:31
MagickBooleanType relinquish
Definition: exception.h:118
Definition: semaphore.c:59
Definition: exception.h:41
Definition: exception.h:57
Definition: exception.h:52
MagickExport MagickBooleanType MagickExport void MagickWarning(const ExceptionType, const char *, const char *)
Definition: exception.c:789
ExceptionType severity
Definition: exception.h:105