18 #ifndef MAGICKCORE_EXCEPTION_PRIVATE_H 19 #define MAGICKCORE_EXCEPTION_PRIVATE_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 ThrowFatalException(severity,tag) \ 43 fatal_exception=AcquireExceptionInfo(); \ 44 fatal_message=GetExceptionMessage(errno); \ 45 (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity, \ 46 tag == (const char *) NULL ? "unknown" : tag,"`%s'",fatal_message); \ 47 fatal_message=DestroyString(fatal_message); \ 48 CatchException(fatal_exception); \ 49 (void) DestroyExceptionInfo(fatal_exception); \ 50 MagickCoreTerminus(); \ 51 _exit((int) (severity-FatalErrorException)+1); \ 53 #define ThrowFileException(exception,severity,tag,context) \ 58 file_message=GetExceptionMessage(errno); \ 59 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 60 tag == (const char *) NULL ? "unknown" : tag,"'%s': %s",context, \ 62 file_message=DestroyString(file_message); \ 64 #define ThrowImageException(severity,tag) \ 66 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 67 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image->filename); \ 68 return((Image *) NULL); \ 70 #define ThrowReaderException(severity,tag) \ 72 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 73 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image_info->filename); \ 74 if ((image) != (Image *) NULL) \ 76 (void) CloseBlob(image); \ 77 image=DestroyImageList(image); \ 79 return((Image *) NULL); \ 81 #define ThrowWriterException(severity,tag) \ 83 (void) ThrowMagickException(exception,GetMagickModule(),severity, \ 84 tag == (const char *) NULL ? "unknown" : tag,"`%s'",image->filename); \ 85 if (image_info->adjoin != MagickFalse) \ 86 while (image->previous != (Image *) NULL) \ 87 image=image->previous; \ 88 (void) CloseBlob(image); \ 89 return(MagickFalse); \ 99 #if defined(__cplusplus) || defined(c_plusplus)
MagickPrivate void InitializeExceptionInfo(ExceptionInfo *)
MagickPrivate MagickBooleanType ExceptionComponentGenesis(void)
MagickPrivate void ExceptionComponentTerminus(void)