Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:20

0001 /*
0002   Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004   
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007   
0008     https://imagemagick.org/script/license.php
0009   
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore exception methods.
0017 */
0018 #ifndef MAGICKCORE_EXCEPTION_H
0019 #define MAGICKCORE_EXCEPTION_H
0020 
0021 #include "MagickCore/semaphore.h"
0022 
0023 #if defined(__cplusplus) || defined(c_plusplus)
0024 extern "C" {
0025 #endif
0026 
0027 typedef enum
0028 {
0029   UndefinedException,
0030   WarningException = 300,
0031   ResourceLimitWarning = 300,
0032   TypeWarning = 305,
0033   OptionWarning = 310,
0034   DelegateWarning = 315,
0035   MissingDelegateWarning = 320,
0036   CorruptImageWarning = 325,
0037   FileOpenWarning = 330,
0038   BlobWarning = 335,
0039   StreamWarning = 340,
0040   CacheWarning = 345,
0041   CoderWarning = 350,
0042   FilterWarning = 352,
0043   ModuleWarning = 355,
0044   DrawWarning = 360,
0045   ImageWarning = 365,
0046   WandWarning = 370,
0047   RandomWarning = 375,
0048   XServerWarning = 380,
0049   MonitorWarning = 385,
0050   RegistryWarning = 390,
0051   ConfigureWarning = 395,
0052   PolicyWarning = 399,
0053   ErrorException = 400,
0054   ResourceLimitError = 400,
0055   TypeError = 405,
0056   OptionError = 410,
0057   DelegateError = 415,
0058   MissingDelegateError = 420,
0059   CorruptImageError = 425,
0060   FileOpenError = 430,
0061   BlobError = 435,
0062   StreamError = 440,
0063   CacheError = 445,
0064   CoderError = 450,
0065   FilterError = 452,
0066   ModuleError = 455,
0067   DrawError = 460,
0068   ImageError = 465,
0069   WandError = 470,
0070   RandomError = 475,
0071   XServerError = 480,
0072   MonitorError = 485,
0073   RegistryError = 490,
0074   ConfigureError = 495,
0075   PolicyError = 499,
0076   FatalErrorException = 700,
0077   ResourceLimitFatalError = 700,
0078   TypeFatalError = 705,
0079   OptionFatalError = 710,
0080   DelegateFatalError = 715,
0081   MissingDelegateFatalError = 720,
0082   CorruptImageFatalError = 725,
0083   FileOpenFatalError = 730,
0084   BlobFatalError = 735,
0085   StreamFatalError = 740,
0086   CacheFatalError = 745,
0087   CoderFatalError = 750,
0088   FilterFatalError = 752,
0089   ModuleFatalError = 755,
0090   DrawFatalError = 760,
0091   ImageFatalError = 765,
0092   WandFatalError = 770,
0093   RandomFatalError = 775,
0094   XServerFatalError = 780,
0095   MonitorFatalError = 785,
0096   RegistryFatalError = 790,
0097   ConfigureFatalError = 795,
0098   PolicyFatalError = 799
0099 } ExceptionType;
0100 
0101 struct _ExceptionInfo
0102 {
0103   ExceptionType
0104     severity;
0105 
0106   int
0107     error_number;
0108 
0109   char
0110     *reason,
0111     *description;
0112 
0113   void
0114     *exceptions;
0115 
0116   MagickBooleanType
0117     relinquish;
0118 
0119   SemaphoreInfo
0120     *semaphore;
0121 
0122   size_t
0123     signature;
0124 };
0125 
0126 typedef void
0127   (*ErrorHandler)(const ExceptionType,const char *,const char *);
0128 
0129 typedef void
0130   (*FatalErrorHandler)(const ExceptionType,const char *,const char *)
0131     magick_attribute((__noreturn__));
0132 
0133 typedef void
0134   (*WarningHandler)(const ExceptionType,const char *,const char *);
0135 
0136 extern MagickExport char
0137   *GetExceptionMessage(const int);
0138 
0139 extern MagickExport const char
0140   *GetLocaleExceptionMessage(const ExceptionType,const char *);
0141 
0142 extern MagickExport ErrorHandler
0143   SetErrorHandler(ErrorHandler);
0144 
0145 extern MagickExport ExceptionInfo
0146   *AcquireExceptionInfo(void),
0147   *CloneExceptionInfo(ExceptionInfo *),
0148   *DestroyExceptionInfo(ExceptionInfo *);
0149 
0150 extern MagickExport FatalErrorHandler
0151   SetFatalErrorHandler(FatalErrorHandler);
0152 
0153 extern MagickExport MagickBooleanType
0154   ThrowException(ExceptionInfo *,const ExceptionType,const char *,
0155     const char *),
0156   ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
0157     const size_t,const ExceptionType,const char *,const char *,va_list),
0158   ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
0159     const ExceptionType,const char *,const char *,...)
0160     magick_attribute((__format__ (__printf__,7,8)));
0161 
0162 extern MagickExport void
0163   CatchException(ExceptionInfo *),
0164   ClearMagickException(ExceptionInfo *),
0165   InheritException(ExceptionInfo *,const ExceptionInfo *),
0166   MagickError(const ExceptionType,const char *,const char *),
0167   MagickFatalError(const ExceptionType,const char *,const char *)
0168     magick_attribute((__noreturn__)),
0169   MagickWarning(const ExceptionType,const char *,const char *);
0170 
0171 extern MagickExport WarningHandler
0172   SetWarningHandler(WarningHandler);
0173 
0174 #if defined(__cplusplus) || defined(c_plusplus)
0175 }
0176 #endif
0177 
0178 #endif