MagickCore  7.0.7
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 "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 MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *, va_list)
MagickExport MagickBooleanType ThrowException(ExceptionInfo *, const ExceptionType, const char *, const char *)
MagickExport ExceptionInfo * CloneExceptionInfo(ExceptionInfo *)
size_t signature
Definition: exception.h:123
MagickExport ErrorHandler SetErrorHandler(ErrorHandler)
Definition: exception.c:819
MagickExport MagickBooleanType MagickExport void InheritException(ExceptionInfo *, const ExceptionInfo *)
MagickExport MagickBooleanType MagickExport void CatchException(ExceptionInfo *)
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler)
Definition: exception.c:852
#define magick_attribute(x)
ExceptionType
Definition: exception.h:27
MagickExport MagickBooleanType MagickExport void MagickError(const ExceptionType, const char *, const char *)
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:130
MagickBooleanType
Definition: magick-type.h:156
MagickExport WarningHandler SetWarningHandler(WarningHandler)
Definition: exception.c:885
char * reason
Definition: exception.h:110
MagickExport MagickBooleanType MagickExport void ClearMagickException(ExceptionInfo *)
SemaphoreInfo * semaphore
Definition: exception.h:120
MagickExport const char * GetLocaleExceptionMessage(const ExceptionType, const char *)
Definition: exception.c:589
MagickExport MagickBooleanType MagickExport void MagickFatalError(const ExceptionType, const char *, const char *)
MagickExport char * GetExceptionMessage(const int)
Definition: exception.c:471
void(* WarningHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:133
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *)
Definition: exception.c:417
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *, const char *, const char *, const size_t, const ExceptionType, const char *, const char *,...) magick_attribute((__format__(__printf__
void * exceptions
Definition: exception.h:114
#define MagickExport
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
Definition: exception.h:127
char * description
Definition: exception.h:110
MagickBooleanType relinquish
Definition: exception.h:117
MagickExport MagickBooleanType MagickExport void MagickWarning(const ExceptionType, const char *, const char *)
Definition: exception.c:789
ExceptionType severity
Definition: exception.h:104