]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/exception.c
(no commit message)
[imagemagick] / MagickCore / exception.c
index cf8ae32425bf6ea3a44bbcce8061d17ad2979623..492ef23675d0ff59f3f98b4b85adac03ba709609 100644 (file)
@@ -17,7 +17,7 @@
 %                                July 1993                                    %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -231,6 +231,42 @@ MagickExport void CatchException(ExceptionInfo *exception)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   C l o n e E x c e p t i o n I n f o                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  CloneExceptionInfo() clones the ExceptionInfo structure.
+%
+%  The format of the CloneExceptionInfo method is:
+%
+%      ExceptionInfo *CloneException(ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o exception: the exception info.
+%
+*/
+MagickExport ExceptionInfo *CloneExceptionInfo(ExceptionInfo *exception)
+{
+  ExceptionInfo
+    *clone_exception;
+
+  clone_exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception));
+  if (clone_exception == (ExceptionInfo *) NULL)
+    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
+  GetExceptionInfo(clone_exception);
+  InheritException(clone_exception,exception);
+  exception->relinquish=MagickTrue;
+  return(exception);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   D e f a u l t E r r o r H a n d l e r                                     %
 %                                                                             %
 %                                                                             %
@@ -458,7 +494,7 @@ MagickExport char *GetExceptionMessage(const int error)
 
   *exception='\0';
 #if defined(MAGICKCORE_HAVE_STRERROR_R)
-#if !defined(_GNU_SOURCE)
+#if !defined(MAGICKCORE_STRERROR_R_CHAR_P)
   (void) strerror_r(error,exception,sizeof(exception));
 #else
   (void) CopyMagickString(exception,strerror_r(error,exception,
@@ -915,8 +951,9 @@ MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception,
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  ThrowMagickException logs an exception as determined by the log configuration
-%  file.  If an error occurs, MagickFalse is returned otherwise MagickTrue.
+%  ThrowMagickException logs an exception as determined by the log
+%  configuration file.  If an error occurs, MagickFalse is returned
+%  otherwise MagickTrue.
 %
 %  The format of the ThrowMagickException method is:
 %
@@ -942,7 +979,7 @@ MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception,
 %
 */
 
-static MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *exception,
+MagickExport MagickBooleanType ThrowMagickExceptionList(ExceptionInfo *exception,
   const char *module,const char *function,const size_t line,
   const ExceptionType severity,const char *tag,const char *format,
   va_list operands)