18 #ifndef MAGICKCORE_EXCEPTION_PRIVATE_H 19 #define MAGICKCORE_EXCEPTION_PRIVATE_H 21 #include "magick/log.h" 22 #include "magick/magick.h" 23 #include "magick/string_.h" 25 #if defined(__cplusplus) || defined(c_plusplus) 29 #define ThrowBinaryException(severity,tag,context) \ 31 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 32 tag == (const char *) NULL ? "unknown" : tag,"`%s'",context); \ 33 return(MagickFalse); \ 35 #define ThrowBinaryImageException(severity,tag,context) \ 37 if (image != (Image *) NULL) \ 38 (void) ThrowMagickException(&image->exception,GetMagickModule(),severity, \ 39 tag == (const char *) NULL ? "unknown" : tag,"`%s'",context); \ 40 return(MagickFalse); \ 42 #define ThrowFatalException(severity,tag) \ 50 fatal_exception=AcquireExceptionInfo(); \ 51 fatal_message=GetExceptionMessage(errno); \ 52 (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity, \ 53 tag == (const char *) NULL ? "unknown" : tag,"`%s'",fatal_message); \ 54 fatal_message=DestroyString(fatal_message); \ 55 CatchException(fatal_exception); \ 56 (void) DestroyExceptionInfo(fatal_exception); \ 57 MagickCoreTerminus(); \ 58 _exit((int) (severity-FatalErrorException)+1); \ 60 #define ThrowFileException(exception,severity,tag,context) \ 65 message=GetExceptionMessage(errno); \ 66 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 67 tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context,message); \ 68 message=DestroyString(message); \ 70 #define ThrowImageException(severity,tag) \ 72 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 73 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image->filename); \ 74 return((Image *) NULL); \ 76 #define ThrowPolicyException(tag,status) \ 79 (void) ThrowMagickException(exception,GetMagickModule(),PolicyError, \ 80 "NotAuthorized","`%s'",tag); \ 83 #define ThrowReaderException(severity,tag) \ 85 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 86 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image_info->filename); \ 87 if ((image) != (Image *) NULL) \ 89 (void) CloseBlob(image); \ 90 image=DestroyImageList(image); \ 92 return((Image *) NULL); \ 94 #define ThrowWriterException(severity,tag) \ 96 (void) ThrowMagickException(&image->exception,GetMagickModule(),severity, \ 97 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image->filename); \ 98 if (image_info->adjoin != MagickFalse) \ 99 while (image->previous != (Image *) NULL) \ 100 image=image->previous; \ 101 (void) CloseBlob(image); \ 102 return(MagickFalse); \ 105 extern MagickPrivate MagickBooleanType
107 ExceptionComponentGenesis(
void);
109 extern MagickPrivate
void 110 ExceptionComponentTerminus(
void),
113 #if defined(__cplusplus) || defined(c_plusplus)