Lines Matching refs:blob_info
263 MagickExport void AttachBlob(BlobInfo *blob_info,const void *blob, in AttachBlob() argument
266 assert(blob_info != (BlobInfo *) NULL); in AttachBlob()
267 if (blob_info->debug != MagickFalse) in AttachBlob()
269 blob_info->length=length; in AttachBlob()
270 blob_info->extent=length; in AttachBlob()
271 blob_info->quantum=(size_t) MagickMaxBlobExtent; in AttachBlob()
272 blob_info->offset=0; in AttachBlob()
273 blob_info->type=BlobStream; in AttachBlob()
274 blob_info->file_info.file=(FILE *) NULL; in AttachBlob()
275 blob_info->data=(unsigned char *) blob; in AttachBlob()
276 blob_info->mapped=MagickFalse; in AttachBlob()
304 MagickExport void AttachCustomStream(BlobInfo *blob_info, in AttachCustomStream() argument
307 assert(blob_info != (BlobInfo *) NULL); in AttachCustomStream()
310 if (blob_info->debug != MagickFalse) in AttachCustomStream()
312 blob_info->type=CustomStream; in AttachCustomStream()
313 blob_info->custom_stream=custom_stream; in AttachCustomStream()
431 *blob_info, in BlobToImage() local
449 blob_info=CloneImageInfo(image_info); in BlobToImage()
450 blob_info->blob=(void *) blob; in BlobToImage()
451 blob_info->length=length; in BlobToImage()
452 if (*blob_info->magick == '\0') in BlobToImage()
453 (void) SetImageInfo(blob_info,0,exception); in BlobToImage()
454 magick_info=GetMagickInfo(blob_info->magick,exception); in BlobToImage()
459 blob_info->magick); in BlobToImage()
460 blob_info=DestroyImageInfo(blob_info); in BlobToImage()
471 (void) CopyMagickString(filename,blob_info->filename,MagickPathExtent); in BlobToImage()
472 (void) FormatLocaleString(blob_info->filename,MagickPathExtent,"%s:%s", in BlobToImage()
473 blob_info->magick,filename); in BlobToImage()
474 image=ReadImage(blob_info,exception); in BlobToImage()
477 blob_info=DestroyImageInfo(blob_info); in BlobToImage()
483 blob_info->blob=(void *) NULL; in BlobToImage()
484 blob_info->length=0; in BlobToImage()
485 *blob_info->filename='\0'; in BlobToImage()
486 status=BlobToFile(blob_info->filename,blob,length,exception); in BlobToImage()
489 (void) RelinquishUniqueFileResource(blob_info->filename); in BlobToImage()
490 blob_info=DestroyImageInfo(blob_info); in BlobToImage()
493 clone_info=CloneImageInfo(blob_info); in BlobToImage()
495 blob_info->magick,blob_info->filename); in BlobToImage()
517 (void) RelinquishUniqueFileResource(blob_info->filename); in BlobToImage()
518 blob_info=DestroyImageInfo(blob_info); in BlobToImage()
545 MagickExport BlobInfo *CloneBlobInfo(const BlobInfo *blob_info) in CloneBlobInfo() argument
555 if (blob_info == (BlobInfo *) NULL) in CloneBlobInfo()
558 (void) memcpy(clone_info,blob_info,sizeof(*clone_info)); in CloneBlobInfo()
559 if (blob_info->mapped != MagickFalse) in CloneBlobInfo()
560 (void) AcquireMagickResource(MapResource,blob_info->length); in CloneBlobInfo()
593 *magick_restrict blob_info; in CloseBlob() local
605 blob_info=image->blob; in CloseBlob()
606 if ((blob_info == (BlobInfo *) NULL) || (blob_info->type == UndefinedStream)) in CloseBlob()
609 switch (blob_info->type) in CloseBlob()
617 if (blob_info->synchronize != MagickFalse) in CloseBlob()
618 status=fsync(fileno(blob_info->file_info.file)); in CloseBlob()
619 status=ferror(blob_info->file_info.file); in CloseBlob()
625 (void) gzerror(blob_info->file_info.gzfile,&status); in CloseBlob()
632 (void) BZ2_bzerror(blob_info->file_info.bzfile,&status); in CloseBlob()
640 if (blob_info->file_info.file != (FILE *) NULL) in CloseBlob()
642 if (blob_info->synchronize != MagickFalse) in CloseBlob()
643 status=fsync(fileno(blob_info->file_info.file)); in CloseBlob()
644 status=ferror(blob_info->file_info.file); in CloseBlob()
651 blob_info->status=status < 0 ? MagickTrue : MagickFalse; in CloseBlob()
652 blob_info->size=GetBlobSize(image); in CloseBlob()
653 image->extent=blob_info->size; in CloseBlob()
654 blob_info->eof=MagickFalse; in CloseBlob()
655 blob_info->error=0; in CloseBlob()
656 blob_info->mode=UndefinedBlobMode; in CloseBlob()
657 if (blob_info->exempt != MagickFalse) in CloseBlob()
659 blob_info->type=UndefinedStream; in CloseBlob()
660 return(blob_info->status); in CloseBlob()
662 switch (blob_info->type) in CloseBlob()
669 status=fclose(blob_info->file_info.file); in CloseBlob()
675 status=pclose(blob_info->file_info.file); in CloseBlob()
682 status=gzclose(blob_info->file_info.gzfile); in CloseBlob()
689 BZ2_bzclose(blob_info->file_info.bzfile); in CloseBlob()
697 if (blob_info->file_info.file != (FILE *) NULL) in CloseBlob()
698 status=fclose(blob_info->file_info.file); in CloseBlob()
704 (void) DetachBlob(blob_info); in CloseBlob()
705 blob_info->status=status < 0 ? MagickTrue : MagickFalse; in CloseBlob()
706 return(blob_info->status); in CloseBlob()
745 *blob_info; in CustomStreamToImage() local
756 blob_info=CloneImageInfo(image_info); in CustomStreamToImage()
757 if (*blob_info->magick == '\0') in CustomStreamToImage()
758 (void) SetImageInfo(blob_info,0,exception); in CustomStreamToImage()
759 magick_info=GetMagickInfo(blob_info->magick,exception); in CustomStreamToImage()
764 blob_info->magick); in CustomStreamToImage()
765 blob_info=DestroyImageInfo(blob_info); in CustomStreamToImage()
770 (*blob_info->filename != '\0')) in CustomStreamToImage()
779 (void) CopyMagickString(filename,blob_info->filename,MagickPathExtent); in CustomStreamToImage()
780 (void) FormatLocaleString(blob_info->filename,MagickPathExtent,"%s:%s", in CustomStreamToImage()
781 blob_info->magick,filename); in CustomStreamToImage()
782 image=ReadImage(blob_info,exception); in CustomStreamToImage()
803 blob_info->custom_stream=(CustomStreamInfo *) NULL; in CustomStreamToImage()
810 blob_info=DestroyImageInfo(blob_info); in CustomStreamToImage()
819 blob_info=DestroyImageInfo(blob_info); in CustomStreamToImage()
822 clone_info=CloneImageInfo(blob_info); in CustomStreamToImage()
823 blob_info->file=fdopen(file,"wb+"); in CustomStreamToImage()
824 if (blob_info->file != (FILE *) NULL) in CustomStreamToImage()
836 (void) fclose(blob_info->file); in CustomStreamToImage()
838 "%s:%s",blob_info->magick,unique); in CustomStreamToImage()
865 blob_info=DestroyImageInfo(blob_info); in CustomStreamToImage()
894 *magick_restrict blob_info; in DestroyBlob() local
905 blob_info=image->blob; in DestroyBlob()
907 LockSemaphoreInfo(blob_info->semaphore); in DestroyBlob()
908 blob_info->reference_count--; in DestroyBlob()
909 assert(blob_info->reference_count >= 0); in DestroyBlob()
910 if (blob_info->reference_count == 0) in DestroyBlob()
912 UnlockSemaphoreInfo(blob_info->semaphore); in DestroyBlob()
919 if (blob_info->mapped != MagickFalse) in DestroyBlob()
921 (void) UnmapBlob(blob_info->data,blob_info->length); in DestroyBlob()
922 RelinquishMagickResource(MapResource,blob_info->length); in DestroyBlob()
924 if (blob_info->semaphore != (SemaphoreInfo *) NULL) in DestroyBlob()
925 RelinquishSemaphoreInfo(&blob_info->semaphore); in DestroyBlob()
926 blob_info->signature=(~MagickCoreSignature); in DestroyBlob()
927 image->blob=(BlobInfo *) RelinquishMagickMemory(blob_info); in DestroyBlob()
986 MagickExport void *DetachBlob(BlobInfo *blob_info) in DetachBlob() argument
991 assert(blob_info != (BlobInfo *) NULL); in DetachBlob()
992 if (blob_info->debug != MagickFalse) in DetachBlob()
994 if (blob_info->mapped != MagickFalse) in DetachBlob()
996 (void) UnmapBlob(blob_info->data,blob_info->length); in DetachBlob()
997 RelinquishMagickResource(MapResource,blob_info->length); in DetachBlob()
999 blob_info->mapped=MagickFalse; in DetachBlob()
1000 blob_info->length=0; in DetachBlob()
1001 blob_info->offset=0; in DetachBlob()
1002 blob_info->eof=MagickFalse; in DetachBlob()
1003 blob_info->error=0; in DetachBlob()
1004 blob_info->exempt=MagickFalse; in DetachBlob()
1005 blob_info->type=UndefinedStream; in DetachBlob()
1006 blob_info->file_info.file=(FILE *) NULL; in DetachBlob()
1007 data=blob_info->data; in DetachBlob()
1008 blob_info->data=(unsigned char *) NULL; in DetachBlob()
1009 blob_info->stream=(StreamHandler) NULL; in DetachBlob()
1010 blob_info->custom_stream=(CustomStreamInfo *) NULL; in DetachBlob()
1041 *magick_restrict blob_info, in DisassociateBlob() local
1053 blob_info=image->blob; in DisassociateBlob()
1055 LockSemaphoreInfo(blob_info->semaphore); in DisassociateBlob()
1056 assert(blob_info->reference_count >= 0); in DisassociateBlob()
1057 if (blob_info->reference_count > 1) in DisassociateBlob()
1059 UnlockSemaphoreInfo(blob_info->semaphore); in DisassociateBlob()
1062 clone_info=CloneBlobInfo(blob_info); in DisassociateBlob()
1188 *magick_restrict blob_info; in EOFBlob() local
1196 blob_info=image->blob; in EOFBlob()
1197 switch (blob_info->type) in EOFBlob()
1205 blob_info->eof=feof(blob_info->file_info.file) != 0 ? MagickTrue : in EOFBlob()
1212 blob_info->eof=gzeof(blob_info->file_info.gzfile) != 0 ? MagickTrue : in EOFBlob()
1224 (void) BZ2_bzerror(blob_info->file_info.bzfile,&status); in EOFBlob()
1225 blob_info->eof=status == BZ_UNEXPECTED_EOF ? MagickTrue : MagickFalse; in EOFBlob()
1231 blob_info->eof=MagickFalse; in EOFBlob()
1239 return((int) blob_info->eof); in EOFBlob()
1268 *magick_restrict blob_info; in ErrorBlob() local
1276 blob_info=image->blob; in ErrorBlob()
1277 switch (blob_info->type) in ErrorBlob()
1285 blob_info->error=ferror(blob_info->file_info.file); in ErrorBlob()
1291 (void) gzerror(blob_info->file_info.gzfile,&blob_info->error); in ErrorBlob()
1298 (void) BZ2_bzerror(blob_info->file_info.bzfile,&blob_info->error); in ErrorBlob()
1304 blob_info->error=0; in ErrorBlob()
1312 return(blob_info->error); in ErrorBlob()
1542 *magick_restrict blob_info; in WriteBlobStream() local
1553 blob_info=image->blob; in WriteBlobStream()
1554 if (blob_info->type != BlobStream) in WriteBlobStream()
1556 extent=(MagickSizeType) (blob_info->offset+(MagickOffsetType) length); in WriteBlobStream()
1557 if (extent >= blob_info->extent) in WriteBlobStream()
1559 extent=blob_info->extent+blob_info->quantum+length; in WriteBlobStream()
1560 blob_info->quantum<<=1; in WriteBlobStream()
1564 q=blob_info->data+blob_info->offset; in WriteBlobStream()
1566 blob_info->offset+=length; in WriteBlobStream()
1567 if (blob_info->offset >= (MagickOffsetType) blob_info->length) in WriteBlobStream()
1568 blob_info->length=(size_t) blob_info->offset; in WriteBlobStream()
1732 MagickExport void GetBlobInfo(BlobInfo *blob_info) in GetBlobInfo() argument
1734 assert(blob_info != (BlobInfo *) NULL); in GetBlobInfo()
1735 (void) memset(blob_info,0,sizeof(*blob_info)); in GetBlobInfo()
1736 blob_info->type=UndefinedStream; in GetBlobInfo()
1737 blob_info->quantum=(size_t) MagickMaxBlobExtent; in GetBlobInfo()
1738 blob_info->properties.st_mtime=time((time_t *) NULL); in GetBlobInfo()
1739 blob_info->properties.st_ctime=blob_info->properties.st_mtime; in GetBlobInfo()
1740 blob_info->debug=IsEventLogging(); in GetBlobInfo()
1741 blob_info->reference_count=1; in GetBlobInfo()
1742 blob_info->semaphore=AcquireSemaphoreInfo(); in GetBlobInfo()
1743 blob_info->signature=MagickCoreSignature; in GetBlobInfo()
1803 *magick_restrict blob_info; in GetBlobSize() local
1813 blob_info=image->blob; in GetBlobSize()
1815 switch (blob_info->type) in GetBlobSize()
1820 extent=blob_info->size; in GetBlobSize()
1825 if (fstat(fileno(blob_info->file_info.file),&blob_info->properties) == 0) in GetBlobSize()
1826 extent=(MagickSizeType) blob_info->properties.st_size; in GetBlobSize()
1831 extent=blob_info->size; in GetBlobSize()
1840 status=GetPathAttributes(image->filename,&blob_info->properties); in GetBlobSize()
1842 extent=(MagickSizeType) blob_info->properties.st_size; in GetBlobSize()
1849 extent=(MagickSizeType) blob_info->length; in GetBlobSize()
1854 if ((blob_info->custom_stream->teller != (CustomStreamTeller) NULL) && in GetBlobSize()
1855 (blob_info->custom_stream->seeker != (CustomStreamSeeker) NULL)) in GetBlobSize()
1860 offset=blob_info->custom_stream->teller( in GetBlobSize()
1861 blob_info->custom_stream->data); in GetBlobSize()
1862 extent=(MagickSizeType) blob_info->custom_stream->seeker(0,SEEK_END, in GetBlobSize()
1863 blob_info->custom_stream->data); in GetBlobSize()
1864 (void) blob_info->custom_stream->seeker(offset,SEEK_SET, in GetBlobSize()
1865 blob_info->custom_stream->data); in GetBlobSize()
1973 *blob_info; in ImageToBlob() local
1991 blob_info=CloneImageInfo(image_info); in ImageToBlob()
1992 blob_info->adjoin=MagickFalse; in ImageToBlob()
1993 (void) SetImageInfo(blob_info,1,exception); in ImageToBlob()
1994 if (*blob_info->magick != '\0') in ImageToBlob()
1995 (void) CopyMagickString(image->magick,blob_info->magick,MagickPathExtent); in ImageToBlob()
2002 blob_info=DestroyImageInfo(blob_info); in ImageToBlob()
2005 (void) CopyMagickString(blob_info->magick,image->magick,MagickPathExtent); in ImageToBlob()
2011 blob_info->length=0; in ImageToBlob()
2012 blob_info->blob=AcquireQuantumMemory(MagickMaxBlobExtent, in ImageToBlob()
2014 if (blob_info->blob == NULL) in ImageToBlob()
2022 status=WriteImage(blob_info,image,exception); in ImageToBlob()
2026 blob_info->blob=RelinquishMagickMemory(blob_info->blob); in ImageToBlob()
2052 blob_info->file=fdopen(file,"wb"); in ImageToBlob()
2053 if (blob_info->file != (FILE *) NULL) in ImageToBlob()
2057 status=WriteImage(blob_info,image,exception); in ImageToBlob()
2059 (void) fclose(blob_info->file); in ImageToBlob()
2066 blob_info=DestroyImageInfo(blob_info); in ImageToBlob()
2840 *magick_restrict blob_info; in IsBlobSeekable() local
2846 blob_info=image->blob; in IsBlobSeekable()
2847 switch (blob_info->type) in IsBlobSeekable()
2856 if (blob_info->file_info.file == (FILE *) NULL) in IsBlobSeekable()
2858 status=fseek(blob_info->file_info.file,0,SEEK_CUR); in IsBlobSeekable()
2867 if (blob_info->file_info.gzfile == (gzFile) NULL) in IsBlobSeekable()
2869 offset=gzseek(blob_info->file_info.gzfile,0,SEEK_CUR); in IsBlobSeekable()
2883 if ((blob_info->custom_stream->seeker != (CustomStreamSeeker) NULL) && in IsBlobSeekable()
2884 (blob_info->custom_stream->teller != (CustomStreamTeller) NULL)) in IsBlobSeekable()
3167 *magick_restrict blob_info; in OpenBlob() local
3189 blob_info=image->blob; in OpenBlob()
3193 blob_info->stream=(StreamHandler) image_info->stream; in OpenBlob()
3194 AttachBlob(blob_info,image_info->blob,image_info->length); in OpenBlob()
3200 blob_info->type=CustomStream; in OpenBlob()
3201 blob_info->custom_stream=image_info->custom_stream; in OpenBlob()
3204 (void) DetachBlob(blob_info); in OpenBlob()
3205 blob_info->mode=mode; in OpenBlob()
3217 blob_info->synchronize=image_info->synchronize; in OpenBlob()
3220 blob_info->stream=image_info->stream; in OpenBlob()
3223 blob_info->type=FifoStream; in OpenBlob()
3245 blob_info->file_info.file=(*type == 'r') ? stdin : stdout; in OpenBlob()
3248 setmode(fileno(blob_info->file_info.file),_O_BINARY); in OpenBlob()
3250 blob_info->type=StandardStream; in OpenBlob()
3251 blob_info->exempt=MagickTrue; in OpenBlob()
3262 blob_info->file_info.file=fdopen(StringToLong(filename+3),fileMode); in OpenBlob()
3263 if (blob_info->file_info.file == (FILE *) NULL) in OpenBlob()
3270 setmode(fileno(blob_info->file_info.file),_O_BINARY); in OpenBlob()
3272 blob_info->type=FileStream; in OpenBlob()
3273 blob_info->exempt=MagickTrue; in OpenBlob()
3293 blob_info->file_info.file=(FILE *) popen_utf8(sanitize_command,fileMode); in OpenBlob()
3295 if (blob_info->file_info.file == (FILE *) NULL) in OpenBlob()
3300 blob_info->type=PipeStream; in OpenBlob()
3301 blob_info->exempt=MagickTrue; in OpenBlob()
3305 status=GetPathAttributes(filename,&blob_info->properties); in OpenBlob()
3307 if ((status != MagickFalse) && S_ISFIFO(blob_info->properties.st_mode)) in OpenBlob()
3309 blob_info->file_info.file=(FILE *) fopen_utf8(filename,type); in OpenBlob()
3310 if (blob_info->file_info.file == (FILE *) NULL) in OpenBlob()
3315 blob_info->type=FileStream; in OpenBlob()
3316 blob_info->exempt=MagickTrue; in OpenBlob()
3355 blob_info->file_info.file=image_info->file; in OpenBlob()
3356 blob_info->type=FileStream; in OpenBlob()
3357 blob_info->exempt=MagickTrue; in OpenBlob()
3362 blob_info->file_info.file=(FILE *) fopen_utf8(filename,type); in OpenBlob()
3363 if (blob_info->file_info.file != (FILE *) NULL) in OpenBlob()
3371 blob_info->type=FileStream; in OpenBlob()
3374 count=fread(magick,1,sizeof(magick),blob_info->file_info.file); in OpenBlob()
3375 (void) fseek(blob_info->file_info.file,-((off_t) count),SEEK_CUR); in OpenBlob()
3377 (void) fflush(blob_info->file_info.file); in OpenBlob()
3385 if (blob_info->file_info.file != (FILE *) NULL) in OpenBlob()
3386 (void) fclose(blob_info->file_info.file); in OpenBlob()
3387 blob_info->file_info.file=(FILE *) NULL; in OpenBlob()
3388 blob_info->file_info.gzfile=gzopen(filename,"rb"); in OpenBlob()
3389 if (blob_info->file_info.gzfile != (gzFile) NULL) in OpenBlob()
3390 blob_info->type=ZipStream; in OpenBlob()
3396 if (blob_info->file_info.file != (FILE *) NULL) in OpenBlob()
3397 (void) fclose(blob_info->file_info.file); in OpenBlob()
3398 blob_info->file_info.file=(FILE *) NULL; in OpenBlob()
3399 blob_info->file_info.bzfile=BZ2_bzopen(filename,"r"); in OpenBlob()
3400 if (blob_info->file_info.bzfile != (BZFILE *) NULL) in OpenBlob()
3401 blob_info->type=BZipStream; in OpenBlob()
3404 if (blob_info->type == FileStream) in OpenBlob()
3418 length=(size_t) blob_info->properties.st_size; in OpenBlob()
3427 blob=MapBlob(fileno(blob_info->file_info.file),ReadMode,0, in OpenBlob()
3437 blob_info->exempt=MagickFalse; in OpenBlob()
3440 (void) fclose(blob_info->file_info.file); in OpenBlob()
3441 blob_info->file_info.file=(FILE *) NULL; in OpenBlob()
3443 AttachBlob(blob_info,blob,length); in OpenBlob()
3444 blob_info->mapped=MagickTrue; in OpenBlob()
3457 blob_info->file_info.gzfile=gzopen(filename,"wb"); in OpenBlob()
3458 if (blob_info->file_info.gzfile != (gzFile) NULL) in OpenBlob()
3459 blob_info->type=ZipStream; in OpenBlob()
3466 blob_info->file_info.bzfile=BZ2_bzopen(filename,"w"); in OpenBlob()
3467 if (blob_info->file_info.bzfile != (BZFILE *) NULL) in OpenBlob()
3468 blob_info->type=BZipStream; in OpenBlob()
3473 blob_info->file_info.file=(FILE *) fopen_utf8(filename,type); in OpenBlob()
3474 if (blob_info->file_info.file != (FILE *) NULL) in OpenBlob()
3476 blob_info->type=FileStream; in OpenBlob()
3480 blob_info->status=MagickFalse; in OpenBlob()
3481 if (blob_info->type != UndefinedStream) in OpenBlob()
3482 blob_info->size=GetBlobSize(image); in OpenBlob()
3677 *magick_restrict blob_info; in ReadBlob() local
3695 blob_info=image->blob; in ReadBlob()
3698 switch (blob_info->type) in ReadBlob()
3710 count=(ssize_t) fread(q,1,length,blob_info->file_info.file); in ReadBlob()
3715 c=getc(blob_info->file_info.file); in ReadBlob()
3723 c=getc(blob_info->file_info.file); in ReadBlob()
3731 c=getc(blob_info->file_info.file); in ReadBlob()
3739 c=getc(blob_info->file_info.file); in ReadBlob()
3762 count=(ssize_t) gzread(blob_info->file_info.gzfile,q+i, in ReadBlob()
3776 c=gzgetc(blob_info->file_info.gzfile); in ReadBlob()
3784 c=gzgetc(blob_info->file_info.gzfile); in ReadBlob()
3792 c=gzgetc(blob_info->file_info.gzfile); in ReadBlob()
3800 c=gzgetc(blob_info->file_info.gzfile); in ReadBlob()
3820 count=(ssize_t) BZ2_bzread(blob_info->file_info.bzfile,q+i, in ReadBlob()
3840 if (blob_info->offset >= (MagickOffsetType) blob_info->length) in ReadBlob()
3842 blob_info->eof=MagickTrue; in ReadBlob()
3845 p=blob_info->data+blob_info->offset; in ReadBlob()
3847 blob_info->length-blob_info->offset); in ReadBlob()
3848 blob_info->offset+=count; in ReadBlob()
3850 blob_info->eof=MagickTrue; in ReadBlob()
3856 if (blob_info->custom_stream->reader != (CustomStreamHandler) NULL) in ReadBlob()
3857 count=blob_info->custom_stream->reader(q,length, in ReadBlob()
3858 blob_info->custom_stream->data); in ReadBlob()
3890 *magick_restrict blob_info; in ReadBlobByte() local
3902 blob_info=image->blob; in ReadBlobByte()
3903 switch (blob_info->type) in ReadBlobByte()
3913 c=getc(blob_info->file_info.file); in ReadBlobByte()
4706 *magick_restrict blob_info; in ReadBlobStream() local
4713 blob_info=image->blob; in ReadBlobStream()
4714 if (blob_info->type != BlobStream) in ReadBlobStream()
4720 if (blob_info->offset >= (MagickOffsetType) blob_info->length) in ReadBlobStream()
4723 blob_info->eof=MagickTrue; in ReadBlobStream()
4726 data=blob_info->data+blob_info->offset; in ReadBlobStream()
4728 blob_info->length-blob_info->offset); in ReadBlobStream()
4729 blob_info->offset+=(*count); in ReadBlobStream()
4731 blob_info->eof=MagickTrue; in ReadBlobStream()
4863 *magick_restrict blob_info; in SeekBlob() local
4871 blob_info=image->blob; in SeekBlob()
4872 switch (blob_info->type) in SeekBlob()
4883 if (fseek(blob_info->file_info.file,offset,whence) < 0) in SeekBlob()
4885 blob_info->offset=TellBlob(image); in SeekBlob()
4891 if (gzseek(blob_info->file_info.gzfile,offset,whence) < 0) in SeekBlob()
4894 blob_info->offset=TellBlob(image); in SeekBlob()
4910 blob_info->offset=offset; in SeekBlob()
4915 if (((offset > 0) && (blob_info->offset > (SSIZE_MAX-offset))) || in SeekBlob()
4916 ((offset < 0) && (blob_info->offset < (-SSIZE_MAX-offset)))) in SeekBlob()
4921 if ((blob_info->offset+offset) < 0) in SeekBlob()
4923 blob_info->offset+=offset; in SeekBlob()
4928 if (((MagickOffsetType) blob_info->length+offset) < 0) in SeekBlob()
4930 blob_info->offset=blob_info->length+offset; in SeekBlob()
4934 if (blob_info->offset < (MagickOffsetType) ((off_t) blob_info->length)) in SeekBlob()
4936 blob_info->eof=MagickFalse; in SeekBlob()
4939 if (blob_info->offset >= (MagickOffsetType) ((off_t) blob_info->extent)) in SeekBlob()
4945 if (blob_info->custom_stream->seeker == (CustomStreamSeeker) NULL) in SeekBlob()
4947 blob_info->offset=blob_info->custom_stream->seeker(offset,whence, in SeekBlob()
4948 blob_info->custom_stream->data); in SeekBlob()
4952 return(blob_info->offset); in SeekBlob()
5019 *magick_restrict blob_info; in SetBlobExtent() local
5027 blob_info=image->blob; in SetBlobExtent()
5028 switch (blob_info->type) in SetBlobExtent()
5053 blob_info->file_info.file); in SetBlobExtent()
5055 if (blob_info->synchronize != MagickFalse) in SetBlobExtent()
5060 file=fileno(blob_info->file_info.file); in SetBlobExtent()
5082 if (blob_info->mapped != MagickFalse) in SetBlobExtent()
5090 (void) UnmapBlob(blob_info->data,blob_info->length); in SetBlobExtent()
5091 RelinquishMagickResource(MapResource,blob_info->length); in SetBlobExtent()
5101 blob_info->file_info.file); in SetBlobExtent()
5103 if (blob_info->synchronize != MagickFalse) in SetBlobExtent()
5108 file=fileno(blob_info->file_info.file); in SetBlobExtent()
5118 blob_info->data=(unsigned char*) MapBlob(fileno( in SetBlobExtent()
5119 blob_info->file_info.file),WriteMode,0,(size_t) extent); in SetBlobExtent()
5120 blob_info->extent=(size_t) extent; in SetBlobExtent()
5121 blob_info->length=(size_t) extent; in SetBlobExtent()
5125 blob_info->extent=(size_t) extent; in SetBlobExtent()
5126 blob_info->data=(unsigned char *) ResizeQuantumMemory(blob_info->data, in SetBlobExtent()
5127 blob_info->extent+1,sizeof(*blob_info->data)); in SetBlobExtent()
5129 if (blob_info->data == (unsigned char *) NULL) in SetBlobExtent()
5131 (void) DetachBlob(blob_info); in SetBlobExtent()
5332 *magick_restrict blob_info; in SyncBlob() local
5343 blob_info=image->blob; in SyncBlob()
5345 switch (blob_info->type) in SyncBlob()
5353 status=fflush(blob_info->file_info.file); in SyncBlob()
5359 status=gzflush(blob_info->file_info.gzfile,Z_SYNC_FLUSH); in SyncBlob()
5366 status=BZ2_bzflush(blob_info->file_info.bzfile); in SyncBlob()
5405 *magick_restrict blob_info; in TellBlob() local
5416 blob_info=image->blob; in TellBlob()
5418 switch (blob_info->type) in TellBlob()
5425 offset=ftell(blob_info->file_info.file); in TellBlob()
5433 offset=(MagickOffsetType) gztell(blob_info->file_info.gzfile); in TellBlob()
5443 offset=blob_info->offset; in TellBlob()
5448 if (blob_info->custom_stream->teller != (CustomStreamTeller) NULL) in TellBlob()
5449 offset=blob_info->custom_stream->teller(blob_info->custom_stream->data); in TellBlob()
5528 *magick_restrict blob_info; in WriteBlob() local
5549 blob_info=image->blob; in WriteBlob()
5553 switch (blob_info->type) in WriteBlob()
5566 blob_info->file_info.file); in WriteBlob()
5571 c=putc((int) *p++,blob_info->file_info.file); in WriteBlob()
5578 c=putc((int) *p++,blob_info->file_info.file); in WriteBlob()
5585 c=putc((int) *p++,blob_info->file_info.file); in WriteBlob()
5592 c=putc((int) *p++,blob_info->file_info.file); in WriteBlob()
5614 count=(ssize_t) gzwrite(blob_info->file_info.gzfile,q+i, in WriteBlob()
5628 c=gzputc(blob_info->file_info.gzfile,(int) *p++); in WriteBlob()
5635 c=gzputc(blob_info->file_info.gzfile,(int) *p++); in WriteBlob()
5642 c=gzputc(blob_info->file_info.gzfile,(int) *p++); in WriteBlob()
5649 c=gzputc(blob_info->file_info.gzfile,(int) *p++); in WriteBlob()
5668 count=(ssize_t) BZ2_bzwrite(blob_info->file_info.bzfile,q+i, in WriteBlob()
5683 count=(ssize_t) blob_info->stream(image,data,length); in WriteBlob()
5688 if ((blob_info->offset+(MagickOffsetType) length) >= in WriteBlob()
5689 (MagickOffsetType) blob_info->extent) in WriteBlob()
5691 if (blob_info->mapped != MagickFalse) in WriteBlob()
5693 blob_info->extent+=length+blob_info->quantum; in WriteBlob()
5694 blob_info->quantum<<=1; in WriteBlob()
5695 blob_info->data=(unsigned char *) ResizeQuantumMemory( in WriteBlob()
5696 blob_info->data,blob_info->extent+1,sizeof(*blob_info->data)); in WriteBlob()
5698 if (blob_info->data == (unsigned char *) NULL) in WriteBlob()
5700 (void) DetachBlob(blob_info); in WriteBlob()
5704 q=blob_info->data+blob_info->offset; in WriteBlob()
5706 blob_info->offset+=length; in WriteBlob()
5707 if (blob_info->offset >= (MagickOffsetType) blob_info->length) in WriteBlob()
5708 blob_info->length=(size_t) blob_info->offset; in WriteBlob()
5714 if (blob_info->custom_stream->writer != (CustomStreamHandler) NULL) in WriteBlob()
5715 count=blob_info->custom_stream->writer((unsigned char *) data, in WriteBlob()
5716 length,blob_info->custom_stream->data); in WriteBlob()
5751 *magick_restrict blob_info; in WriteBlobByte() local
5760 blob_info=image->blob; in WriteBlobByte()
5762 switch (blob_info->type) in WriteBlobByte()
5771 c=putc((int) value,blob_info->file_info.file); in WriteBlobByte()