exception.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004   
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007   
00008     https://imagemagick.org/script/license.php
00009   
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore exception methods.
00017 */
00018 #ifndef MAGICKCORE_EXCEPTION_H
00019 #define MAGICKCORE_EXCEPTION_H
00020 
00021 #include "MagickCore/semaphore.h"
00022 
00023 #if defined(__cplusplus) || defined(c_plusplus)
00024 extern "C" {
00025 #endif
00026 
00027 typedef enum
00028 {
00029   UndefinedException,
00030   WarningException = 300,
00031   ResourceLimitWarning = 300,
00032   TypeWarning = 305,
00033   OptionWarning = 310,
00034   DelegateWarning = 315,
00035   MissingDelegateWarning = 320,
00036   CorruptImageWarning = 325,
00037   FileOpenWarning = 330,
00038   BlobWarning = 335,
00039   StreamWarning = 340,
00040   CacheWarning = 345,
00041   CoderWarning = 350,
00042   FilterWarning = 352,
00043   ModuleWarning = 355,
00044   DrawWarning = 360,
00045   ImageWarning = 365,
00046   WandWarning = 370,
00047   RandomWarning = 375,
00048   XServerWarning = 380,
00049   MonitorWarning = 385,
00050   RegistryWarning = 390,
00051   ConfigureWarning = 395,
00052   PolicyWarning = 399,
00053   ErrorException = 400,
00054   ResourceLimitError = 400,
00055   TypeError = 405,
00056   OptionError = 410,
00057   DelegateError = 415,
00058   MissingDelegateError = 420,
00059   CorruptImageError = 425,
00060   FileOpenError = 430,
00061   BlobError = 435,
00062   StreamError = 440,
00063   CacheError = 445,
00064   CoderError = 450,
00065   FilterError = 452,
00066   ModuleError = 455,
00067   DrawError = 460,
00068   ImageError = 465,
00069   WandError = 470,
00070   RandomError = 475,
00071   XServerError = 480,
00072   MonitorError = 485,
00073   RegistryError = 490,
00074   ConfigureError = 495,
00075   PolicyError = 499,
00076   FatalErrorException = 700,
00077   ResourceLimitFatalError = 700,
00078   TypeFatalError = 705,
00079   OptionFatalError = 710,
00080   DelegateFatalError = 715,
00081   MissingDelegateFatalError = 720,
00082   CorruptImageFatalError = 725,
00083   FileOpenFatalError = 730,
00084   BlobFatalError = 735,
00085   StreamFatalError = 740,
00086   CacheFatalError = 745,
00087   CoderFatalError = 750,
00088   FilterFatalError = 752,
00089   ModuleFatalError = 755,
00090   DrawFatalError = 760,
00091   ImageFatalError = 765,
00092   WandFatalError = 770,
00093   RandomFatalError = 775,
00094   XServerFatalError = 780,
00095   MonitorFatalError = 785,
00096   RegistryFatalError = 790,
00097   ConfigureFatalError = 795,
00098   PolicyFatalError = 799
00099 } ExceptionType;
00100 
00101 struct _ExceptionInfo
00102 {
00103   ExceptionType
00104     severity;
00105 
00106   int
00107     error_number;
00108 
00109   char
00110     *reason,
00111     *description;
00112 
00113   void
00114     *exceptions;
00115 
00116   MagickBooleanType
00117     relinquish;
00118 
00119   SemaphoreInfo
00120     *semaphore;
00121 
00122   size_t
00123     signature;
00124 };
00125 
00126 typedef void
00127   (*ErrorHandler)(const ExceptionType,const char *,const char *);
00128 
00129 typedef void
00130   (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
00131 
00132 typedef void
00133   (*WarningHandler)(const ExceptionType,const char *,const char *);
00134 
00135 extern MagickExport char
00136   *GetExceptionMessage(const int);
00137 
00138 extern MagickExport const char
00139   *GetLocaleExceptionMessage(const ExceptionType,const char *);
00140 
00141 extern MagickExport ErrorHandler
00142   SetErrorHandler(ErrorHandler);
00143 
00144 extern MagickExport ExceptionInfo
00145   *AcquireExceptionInfo(void),
00146   *CloneExceptionInfo(ExceptionInfo *),
00147   *DestroyExceptionInfo(ExceptionInfo *);
00148 
00149 extern MagickExport FatalErrorHandler
00150   SetFatalErrorHandler(FatalErrorHandler);
00151 
00152 extern MagickExport MagickBooleanType
00153   ThrowException(ExceptionInfo *,const ExceptionType,const char *,
00154     const char *),
00155   ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
00156     const size_t,const ExceptionType,const char *,const char *,va_list),
00157   ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
00158     const ExceptionType,const char *,const char *,...)
00159     magick_attribute((__format__ (__printf__,7,8)));
00160 
00161 extern MagickExport void
00162   CatchException(ExceptionInfo *),
00163   ClearMagickException(ExceptionInfo *),
00164   InheritException(ExceptionInfo *,const ExceptionInfo *),
00165   MagickError(const ExceptionType,const char *,const char *),
00166   MagickFatalError(const ExceptionType,const char *,const char *),
00167   MagickWarning(const ExceptionType,const char *,const char *);
00168 
00169 extern MagickExport WarningHandler
00170   SetWarningHandler(WarningHandler);
00171 
00172 #if defined(__cplusplus) || defined(c_plusplus)
00173 }
00174 #endif
00175 
00176 #endif

Generated on 7 Sep 2020 for MagickCore by  doxygen 1.6.1