GetBlobInfo(BlobInfo *),
*MapBlob(int,const MapMode,const MagickOffsetType,const size_t),
MSBOrderLong(unsigned char *,const size_t),
- MSBOrderShort(unsigned char *,const size_t),
- SetBlobCustomStream(BlobInfo *,
- ssize_t (*reader)(const unsigned char *,const size_t,const void *),
- ssize_t (*writer)(const unsigned char *,const size_t,const void *),
- size_t (*seeker)(const MagickOffsetType,const int,const void *),
- MagickOffsetType (*teller)(const void *));
+ MSBOrderShort(unsigned char *,const size_t);
#if defined(__cplusplus) || defined(c_plusplus)
}
/*
Typedef declarations.
*/
-typedef ssize_t
- (*BlobHandler)(const unsigned char *,const size_t,const void *);
-
-typedef size_t
- (*BlobSeeker)(const MagickOffsetType offset,const int whence,const void *);
-
-typedef MagickOffsetType
- (*BlobTeller)(const void *);
-
-struct _CustomStreamInfo
-{
- BlobHandler
- reader,
- writer;
-
- BlobSeeker
- seeker;
-
- BlobTeller
- teller;
-
- void
- *data;
-};
-
typedef union FileInfo
{
FILE
blob[*length]='\0';
return(blob);
}
- *length=(size_t) MagickMin(offset,(MagickOffsetType)
+ *length=(size_t) MagickMin(offset,(MagickOffsetType)
MagickMin(extent,SSIZE_MAX));
blob=(unsigned char *) NULL;
if (~(*length) >= (MagickPathExtent-1))
(void) RelinquishUniqueFileResource(filename);
return(MagickFalse);
}
- (void) FormatLocaleString(byte_image->filename,MagickPathExtent,"%s:%s",format,
- filename);
+ (void) FormatLocaleString(byte_image->filename,MagickPathExtent,"%s:%s",
+ format,filename);
DestroyBlob(byte_image);
byte_image->blob=CloneBlobInfo((BlobInfo *) NULL);
write_info=CloneImageInfo(image_info);
% %
% %
% %
-% S e t B l o b C u s t o m S t r e a m %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% SetBlobCustomStream() sets the blob's custom stream handlers.
-%
-% The format of the SetBlobCustomStream method is:
-%
-% void SetBlobCustomStream(BlobInfo *blob_info,
-% ssize_t (*reader)(const unsigned char *,const size_t,const void *),
-% ssize_t (*writer)(const unsigned char *,const size_t,const void *),
-% size_t (*seeker)(const MagickOffsetType,const int,const void *),
-% MagickOffsetType (*teller)(const void *))
-%
-% A description of each parameter follows:
-%
-% o blob_info: the blob info.
-%
-% o reader: your custom stream reader.
-%
-% o writer: your custom stream writer.
-%
-% o seeker: your custom stream seeker.
-%
-% o teller: your custom stream teller.
-%
-*/
-MagickExport void SetBlobCustomStream(BlobInfo *blob_info,
- ssize_t (*reader)(const unsigned char *,const size_t,const void *),
- ssize_t (*writer)(const unsigned char *,const size_t,const void *),
- size_t (*seeker)(const MagickOffsetType,const int,const void *),
- MagickOffsetType (*teller)(const void *))
-{
- assert(blob_info != (BlobInfo *) NULL);
- assert(blob_info->signature == MagickCoreSignature);
- blob_info->custom_stream->reader=reader;
- blob_info->custom_stream->writer=writer;
- blob_info->custom_stream->seeker=seeker;
- blob_info->custom_stream->teller=teller;
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
+ S e t B l o b E x e m p t %
% %
% %
#ifndef MAGICKCORE_BLOB_H
#define MAGICKCORE_BLOB_H
-#include "MagickCore/image.h"
-#include "MagickCore/stream.h"
-
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
IOMode
} MapMode;
+typedef ssize_t
+ (*BlobHandler)(const unsigned char *,const size_t,const void *);
+
+typedef size_t
+ (*BlobSeeker)(const MagickOffsetType offset,const int whence,const void *);
+
+typedef MagickOffsetType
+ (*BlobTeller)(const void *);
+
typedef struct _CustomStreamInfo
- CustomStreamInfo;
+{
+ BlobHandler
+ reader,
+ writer;
+
+ BlobSeeker
+ seeker;
+
+ BlobTeller
+ teller;
+
+ void
+ *data;
+} CustomStreamInfo;
+
+#include "MagickCore/image.h"
+#include "MagickCore/stream.h"
+
extern MagickExport FILE
*GetBlobFileHandle(const Image *);
% The format of the SetImageInfoCustomStream method is:
%
% void SetImageInfoCustomStream(ImageInfo *image_info,
-% ssize_t (*reader)(const unsigned char *,const size_t,const void *),
-% ssize_t (*writer)(const unsigned char *,const size_t,const void *),
-% size_t (*seeker)(const MagickOffsetType,const int,const void *),
-% MagickOffsetType (*teller)(const void *))
+% CustomStreamInfo *custom_stream)
%
% A description of each parameter follows:
%
% o image_info: the image info.
%
-% o reader: your custom stream reader.
-%
-% o writer: your custom stream writer.
-%
-% o seeker: your custom stream seeker.
-%
-% o teller: your custom stream teller.
+% o custom_stream: your custom stream methods.
%
*/
MagickExport void SetImageInfoCustomStream(ImageInfo *image_info,
- ssize_t (*reader)(const unsigned char *,const size_t,const void *),
- ssize_t (*writer)(const unsigned char *,const size_t,const void *),
- size_t (*seeker)(const MagickOffsetType,const int,const void *),
- MagickOffsetType (*teller)(const void *))
+ CustomStreamInfo *custom_stream)
{
assert(image_info != (ImageInfo *) NULL);
assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
- SetBlobCustomStream(image_info->blob,reader,writer,seeker,teller);
+ image_info->custom_stream=(void *) custom_stream;
}
\f
/*
into per-image artifacts, while ensuring only specifically set per-image
artifacts are preserved when parenthesis ends.
*/
- if (image->image_info != (ImageInfo *) NULL)
- image->image_info=DestroyImageInfo(image->image_info);
image->image_info=CloneImageInfo(image_info);
return(MagickTrue);
}
#ifndef MAGICKCORE_IMAGE_H
#define MAGICKCORE_IMAGE_H
-#include "MagickCore/color.h"
-#include "MagickCore/pixel.h"
-
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
GetImageInfo(ImageInfo *),
SetImageInfoBlob(ImageInfo *,const void *,const size_t),
SetImageInfoFile(ImageInfo *,FILE *),
- SetImageInfoCustomStream(ImageInfo *,
- ssize_t (*reader)(const unsigned char *,const size_t,const void *),
- ssize_t (*writer)(const unsigned char *,const size_t,const void *),
- size_t (*seeker)(const MagickOffsetType,const int,const void *),
- MagickOffsetType (*teller)(const void *));
+ SetImageInfoCustomStream(ImageInfo *,CustomStreamInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
}