exception.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2010 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.
00006   obtain a copy of the License at
00007   
00008     http://www.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 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #include <stdarg.h>
00026 #include "magick/semaphore.h"
00027 
00028 typedef enum
00029 {
00030   UndefinedException,
00031   WarningException = 300,
00032   ResourceLimitWarning = 300,
00033   TypeWarning = 305,
00034   OptionWarning = 310,
00035   DelegateWarning = 315,
00036   MissingDelegateWarning = 320,
00037   CorruptImageWarning = 325,
00038   FileOpenWarning = 330,
00039   BlobWarning = 335,
00040   StreamWarning = 340,
00041   CacheWarning = 345,
00042   CoderWarning = 350,
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   ModuleError = 455,
00066   DrawError = 460,
00067   ImageError = 465,
00068   WandError = 470,
00069   RandomError = 475,
00070   XServerError = 480,
00071   MonitorError = 485,
00072   RegistryError = 490,
00073   ConfigureError = 495,
00074   PolicyError = 499,
00075   FatalErrorException = 700,
00076   ResourceLimitFatalError = 700,
00077   TypeFatalError = 705,
00078   OptionFatalError = 710,
00079   DelegateFatalError = 715,
00080   MissingDelegateFatalError = 720,
00081   CorruptImageFatalError = 725,
00082   FileOpenFatalError = 730,
00083   BlobFatalError = 735,
00084   StreamFatalError = 740,
00085   CacheFatalError = 745,
00086   CoderFatalError = 750,
00087   ModuleFatalError = 755,
00088   DrawFatalError = 760,
00089   ImageFatalError = 765,
00090   WandFatalError = 770,
00091   RandomFatalError = 775,
00092   XServerFatalError = 780,
00093   MonitorFatalError = 785,
00094   RegistryFatalError = 790,
00095   ConfigureFatalError = 795,
00096   PolicyFatalError = 799
00097 } ExceptionType;
00098 
00099 struct _ExceptionInfo
00100 {
00101   ExceptionType
00102     severity;
00103 
00104   int
00105     error_number;
00106 
00107   char
00108     *reason,
00109     *description;
00110 
00111   void
00112     *exceptions;
00113 
00114   MagickBooleanType
00115     relinquish;
00116 
00117   SemaphoreInfo
00118     *semaphore;
00119 
00120   unsigned long
00121     signature;
00122 };
00123 
00124 typedef void
00125   (*ErrorHandler)(const ExceptionType,const char *,const char *);
00126 
00127 typedef void
00128   (*FatalErrorHandler)(const ExceptionType,const char *,const char *);
00129 
00130 typedef void
00131   (*WarningHandler)(const ExceptionType,const char *,const char *);
00132 
00133 extern MagickExport char
00134   *GetExceptionMessage(const int);
00135 
00136 extern MagickExport const char
00137   *GetLocaleExceptionMessage(const ExceptionType,const char *);
00138 
00139 extern MagickExport ErrorHandler
00140   SetErrorHandler(ErrorHandler);
00141 
00142 extern MagickExport ExceptionInfo
00143   *AcquireExceptionInfo(void),
00144   *DestroyExceptionInfo(ExceptionInfo *);
00145 
00146 extern MagickExport FatalErrorHandler
00147   SetFatalErrorHandler(FatalErrorHandler);
00148 
00149 extern MagickExport MagickBooleanType
00150   ThrowException(ExceptionInfo *,const ExceptionType,const char *,
00151     const char *),
00152   ThrowMagickException(ExceptionInfo *,const char *,const char *,
00153     const unsigned long,const ExceptionType,const char *,const char *,...)
00154     magick_attribute((format (printf,7,8))),
00155   ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *,
00156     const unsigned long,const ExceptionType,const char *,const char *,va_list)
00157     magick_attribute((format (printf,7,0)));
00158 
00159 extern MagickExport void
00160   CatchException(ExceptionInfo *),
00161   ClearMagickException(ExceptionInfo *),
00162   GetExceptionInfo(ExceptionInfo *),
00163   InheritException(ExceptionInfo *,const ExceptionInfo *),
00164   MagickError(const ExceptionType,const char *,const char *),
00165   MagickFatalError(const ExceptionType,const char *,const char *),
00166   MagickWarning(const ExceptionType,const char *,const char *);
00167 
00168 extern MagickExport WarningHandler
00169   SetWarningHandler(WarningHandler);
00170 
00171 #if defined(__cplusplus) || defined(c_plusplus)
00172 }
00173 #endif
00174 
00175 #endif

Generated on Thu Jul 2 12:03:19 2009 for MagickCore by  doxygen 1.5.8