1 /* 2 Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization 3 dedicated to making software imaging solutions freely available. 4 5 You may not use this file except in compliance with the License. 6 obtain a copy of the License at 7 8 http://www.imagemagick.org/script/license.php 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 16 MagickCore Binary Large OBjects private methods. 17 */ 18 #ifndef MAGICKCORE_BLOB_PRIVATE_H 19 #define MAGICKCORE_BLOB_PRIVATE_H 20 21 #include "MagickCore/image.h" 22 #include "MagickCore/stream.h" 23 #include "MagickCore/nt-base-private.h" 24 25 #if defined(__cplusplus) || defined(c_plusplus) 26 extern "C" { 27 #endif 28 29 #define MagickMinBlobExtent 32767L 30 #if defined(MAGICKCORE_HAVE_FSEEKO) 31 # define fseek fseeko 32 # define ftell ftello 33 #endif 34 35 typedef enum 36 { 37 UndefinedBlobMode, 38 ReadBlobMode, 39 ReadBinaryBlobMode, 40 WriteBlobMode, 41 WriteBinaryBlobMode, 42 AppendBlobMode, 43 AppendBinaryBlobMode 44 } BlobMode; 45 46 typedef enum 47 { 48 UndefinedStream, 49 FileStream, 50 StandardStream, 51 PipeStream, 52 ZipStream, 53 BZipStream, 54 FifoStream, 55 BlobStream 56 } StreamType; 57 58 typedef int 59 *(*BlobFifo)(const Image *,const void *,const size_t); 60 61 extern MagickExport BlobInfo 62 *CloneBlobInfo(const BlobInfo *), 63 *ReferenceBlob(BlobInfo *); 64 65 extern MagickExport char 66 *ReadBlobString(Image *,char *); 67 68 extern MagickExport const struct stat 69 *GetBlobProperties(const Image *); 70 71 extern MagickExport const void 72 *ReadBlobStream(Image *,const size_t,void *,ssize_t *); 73 74 extern MagickExport double 75 ReadBlobDouble(Image *); 76 77 extern MagickExport float 78 ReadBlobFloat(Image *); 79 80 extern MagickExport int 81 EOFBlob(const Image *), 82 ReadBlobByte(Image *); 83 84 extern MagickExport MagickBooleanType 85 CloseBlob(Image *), 86 DiscardBlobBytes(Image *,const MagickSizeType), 87 OpenBlob(const ImageInfo *,Image *,const BlobMode,ExceptionInfo *), 88 SetBlobExtent(Image *,const MagickSizeType), 89 UnmapBlob(void *,const size_t); 90 91 extern MagickExport MagickOffsetType 92 SeekBlob(Image *,const MagickOffsetType,const int), 93 TellBlob(const Image *); 94 95 extern MagickExport MagickSizeType 96 ReadBlobLongLong(Image *), 97 ReadBlobMSBLongLong(Image *); 98 99 extern MagickExport signed int 100 ReadBlobLSBSignedLong(Image *), 101 ReadBlobMSBSignedLong(Image *), 102 ReadBlobSignedLong(Image *); 103 104 extern MagickExport signed short 105 ReadBlobLSBSignedShort(Image *), 106 ReadBlobMSBSignedShort(Image *), 107 ReadBlobSignedShort(Image *); 108 109 extern MagickExport ssize_t 110 ReadBlob(Image *,const size_t,void *), 111 WriteBlob(Image *,const size_t,const void *), 112 WriteBlobByte(Image *,const unsigned char), 113 WriteBlobFloat(Image *,const float), 114 WriteBlobLong(Image *,const unsigned int), 115 WriteBlobShort(Image *,const unsigned short), 116 WriteBlobLSBLong(Image *,const unsigned int), 117 WriteBlobLSBShort(Image *,const unsigned short), 118 WriteBlobLSBSignedLong(Image *,const signed int), 119 WriteBlobLSBSignedShort(Image *,const signed short), 120 WriteBlobMSBLong(Image *,const unsigned int), 121 WriteBlobMSBLongLong(Image *,const MagickSizeType), 122 WriteBlobMSBShort(Image *,const unsigned short), 123 WriteBlobMSBSignedLong(Image *,const signed int), 124 WriteBlobMSBSignedShort(Image *,const signed short), 125 WriteBlobString(Image *,const char *); 126 127 extern MagickExport unsigned int 128 ReadBlobLong(Image *), 129 ReadBlobLSBLong(Image *), 130 ReadBlobMSBLong(Image *); 131 132 extern MagickExport unsigned short 133 ReadBlobShort(Image *), 134 ReadBlobLSBShort(Image *), 135 ReadBlobMSBShort(Image *); 136 137 extern MagickExport void 138 AttachBlob(BlobInfo *,const void *,const size_t), 139 *DetachBlob(BlobInfo *), 140 DisassociateBlob(Image *), 141 GetBlobInfo(BlobInfo *), 142 *MapBlob(int,const MapMode,const MagickOffsetType,const size_t), 143 MSBOrderLong(unsigned char *,const size_t), 144 MSBOrderShort(unsigned char *,const size_t); 145 146 #if defined(__cplusplus) || defined(c_plusplus) 147 } 148 #endif 149 150 #endif 151