18#ifndef MAGICKCORE_EXCEPTION_PRIVATE_H
19#define MAGICKCORE_EXCEPTION_PRIVATE_H
21#include "MagickCore/log.h"
22#include "MagickCore/magick.h"
23#include "MagickCore/string_.h"
25#if defined(__cplusplus) || defined(c_plusplus)
29#define ThrowBinaryException(severity,tag,context) \
31 (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
33 return(MagickFalse); \
35#define ThrowFatalException(severity,tag) \
43 fatal_exception=AcquireExceptionInfo(); \
44 fatal_message=GetExceptionMessage(errno); \
45 (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity,tag, \
46 "`%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,tag, \
60 "'%s': %s",context,file_message); \
61 file_message=DestroyString(file_message); \
63#define ThrowImageException(severity,tag) \
65 (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
66 "`%s'",image->filename); \
67 return((Image *) NULL); \
69#define ThrowReaderException(severity,tag) \
71 (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
72 "`%s'",image_info->filename); \
73 if ((image) != (Image *) NULL) \
75 (void) CloseBlob(image); \
76 image=DestroyImageList(image); \
78 return((Image *) NULL); \
80#define ThrowWriterException(severity,tag) \
82 (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
83 "`%s'",image->filename); \
84 if (image_info->adjoin != MagickFalse) \
85 while (image->previous != (Image *) NULL) \
86 image=image->previous; \
87 (void) CloseBlob(image); \
88 return(MagickFalse); \
91extern MagickPrivate
void
92 ExceptionComponentTerminus(
void),
95extern MagickPrivate MagickBooleanType
96 ExceptionComponentGenesis(
void);
98#if defined(__cplusplus) || defined(c_plusplus)