]> granicus.if.org Git - imagemagick/commitdiff
Added acquire and destroy method for CustomStreamInfo.
authorDirk Lemstra <dirk@git.imagemagick.org>
Fri, 3 Feb 2017 08:57:54 +0000 (09:57 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Fri, 3 Feb 2017 08:57:54 +0000 (09:57 +0100)
MagickCore/blob.c
MagickCore/blob.h

index 768c47bf06d2f6dafd6d3d56b6abf611fa8ec4c0..443f6ab3ccd328d1d86c5ff42c3023f50cace47f 100644 (file)
@@ -191,6 +191,42 @@ static int
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   A c q u i r e C u s t o m S t r e a m I n f o                             %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  AcquireCustomStreamInfo() allocates the CustomStreamInfo structure.
+%
+%  The format of the AcquireCustomStreamInfo method is:
+%
+%      CustomStreamInfo *AcquireCustomStreamInfo(ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport CustomStreamInfo *AcquireCustomStreamInfo(
+  ExceptionInfo *exception)
+{
+  CustomStreamInfo
+    *custom_stream;
+
+  custom_stream=(CustomStreamInfo *) AcquireMagickMemory(
+    sizeof(*custom_stream));
+  if (custom_stream == (CustomStreamInfo *) NULL)
+    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
+  (void) ResetMagickMemory(custom_stream,0,sizeof(*custom_stream));
+  return(custom_stream);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   A t t a c h B l o b                                                       %
 %                                                                             %
 %                                                                             %
@@ -683,6 +719,38 @@ MagickExport void DestroyBlob(Image *image)
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   D e s t r o y C u s t o m S t r e a m I n f o                             %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  DestroyCustomStreamInfo() destroys memory associated with the
+%  CustomStreamInfo structure.
+%
+%  The format of the DestroyCustomStreamInfo method is:
+%
+%      CustomStreamInfo *DestroyCustomStreamInfo(CustomStreamInfo *stream_info)
+%
+%  A description of each parameter follows:
+%
+%    o custom_stream: the custom stream info.
+%
+*/
+MagickExport CustomStreamInfo *DestroyCustomStreamInfo(
+  CustomStreamInfo *custom_stream)
+{
+  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
+  assert(custom_stream != (CustomStreamInfo *) NULL);
+  custom_stream=(CustomStreamInfo *) RelinquishMagickMemory(custom_stream);
+  return(custom_stream);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   D e t a c h B l o b                                                       %
 %                                                                             %
 %                                                                             %
index 6007a68f11f97fdcbce3a0b2e309377c75d57d24..ef9f57071ee493bddc14012e082a3238f71fbca1 100644 (file)
@@ -46,6 +46,10 @@ typedef struct _CustomStreamInfo
 #include "MagickCore/image.h"
 #include "MagickCore/stream.h"
 
+extern MagickExport CustomStreamInfo
+  *AcquireCustomStreamInfo(ExceptionInfo *),
+  *DestroyCustomStreamInfo(CustomStreamInfo *);
+
 extern MagickExport FILE
   *GetBlobFileHandle(const Image *);