MagickCore 7.0.10
|
#include "wizard/studio.h"
#include "wizard/blob.h"
#include "wizard/blob-private.h"
#include "wizard/cipher.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/memory_.h"
#include "wizard/semaphore.h"
#include "wizard/nt-base.h"
#include "wizard/string-private.h"
#include "wizard/utility.h"
#include "wizard/utility-private.h"
#include "bzlib.h"
#include "zlib.h"
Go to the source code of this file.
Data Structures | |
union | BlobFileInfo |
struct | _BlobInfo |
Macros | |
#define | WizardMaxBlobExtent (8*8192) |
#define | MAP_FAILED ((void *) -1) |
Typedefs | |
typedef union BlobFileInfo | BlobFileInfo |
Enumerations | |
enum | StreamType { UndefinedStream , StandardStream , FileStream , PipeStream , ZipStream , BZipStream , BlobStream } |
Functions | |
static unsigned char * | DetachBlob (BlobInfo *) |
static void | AttachBlob (BlobInfo *blob_info, const void *blob, const size_t length) |
static void | ThrowBlobException (BlobInfo *blob_info) |
WizardExport WizardBooleanType | CloseBlob (BlobInfo *blob_info) |
WizardExport BlobInfo * | DestroyBlob (BlobInfo *blob_info) |
WizardExport int | EOFBlob (BlobInfo *blob_info) |
WizardExport void * | FileToBlob (const char *filename, const size_t extent, size_t *length, ExceptionInfo *exception) |
WizardExport const char * | GetBlobFilename (const BlobInfo *blob_info) |
WizardExport void | GetBlobInfo (BlobInfo *blob_info) |
static WizardBooleanType | GetPathAttributes (const char *path, void *attributes) |
WizardExport WizardSizeType | GetBlobSize (BlobInfo *blob_info) |
WizardExport const struct stat * | GetBlobProperties (const BlobInfo *blob_info) |
WizardExport void * | MapBlob (int file, const MapMode mode, const WizardOffsetType offset, const size_t length) |
WizardExport BlobInfo * | OpenBlob (const char *filename, const BlobMode mode, const WizardBooleanType compress, ExceptionInfo *exception) |
WizardExport ssize_t | ReadBlob (BlobInfo *blob_info, const size_t length, void *data) |
static const void * | ReadBlobStream (BlobInfo *blob_info, const size_t length, void *data, ssize_t *count) |
WizardExport int | ReadBlobByte (BlobInfo *blob_info) |
WizardExport ssize_t | ReadBlobChunk (BlobInfo *blob_info, const size_t length, void *data) |
WizardExport WizardBooleanType | SetBlobExtent (BlobInfo *blob_info, const WizardSizeType extent) |
WizardExport int | SyncBlob (BlobInfo *blob_info) |
WizardExport WizardOffsetType | TellBlob (const BlobInfo *blob_info) |
WizardExport WizardBooleanType | UnmapBlob (void *map, const size_t length) |
WizardExport ssize_t | WriteBlob (BlobInfo *blob_info, const size_t length, const void *data) |
static ssize_t | WriteBlobStream (BlobInfo *blob_info, const size_t length, const void *data) |
WizardExport ssize_t | WriteBlobByte (BlobInfo *blob_info, const unsigned char value) |
WizardExport ssize_t | WriteBlobChunk (BlobInfo *blob_info, const size_t length, const void *data) |
WizardExport ssize_t | WriteBlobString (BlobInfo *blob_info, const char *string) |
typedef union BlobFileInfo BlobFileInfo |
enum StreamType |
|
static |
Definition at line 191 of file blob.c.
References BlobStream, _BlobInfo::data, _BlobInfo::debug, _BlobInfo::extent, BlobFileInfo::file, _BlobInfo::file_info, GetWizardModule, _BlobInfo::length, LogWizardEvent(), _BlobInfo::mapped, _BlobInfo::offset, _BlobInfo::quantum, TraceEvent, _BlobInfo::type, WizardFalse, and WizardMaxBlobExtent.
Referenced by OpenBlob().
WizardExport WizardBooleanType CloseBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 236 of file blob.c.
References BlobStream, BZipStream, _BlobInfo::debug, DetachBlob(), _BlobInfo::eof, _BlobInfo::error, _BlobInfo::exempt, BlobFileInfo::file, _BlobInfo::file_info, _BlobInfo::filename, FileStream, GetBlobSize(), GetWizardModule, LogWizardEvent(), _BlobInfo::mode, PipeStream, _BlobInfo::signature, _BlobInfo::size, StandardStream, _BlobInfo::status, SyncBlob(), ThrowBlobException(), TraceEvent, _BlobInfo::type, UndefinedBlobMode, UndefinedStream, WizardFalse, WizardSignature, WizardTrue, and ZipStream.
Referenced by DestroyBlob().
WizardExport BlobInfo * DestroyBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 369 of file blob.c.
References CloseBlob(), _BlobInfo::data, _BlobInfo::debug, _BlobInfo::filename, GetWizardModule, _BlobInfo::length, LockSemaphoreInfo(), LogWizardEvent(), _BlobInfo::mapped, MapResource, _BlobInfo::reference_count, RelinquishSemaphoreInfo(), RelinquishWizardMemory(), RelinquishWizardResource(), _BlobInfo::semaphore, _BlobInfo::signature, TraceEvent, UnlockSemaphoreInfo(), UnmapBlob(), WizardFalse, WizardSignature, and WizardTrue.
|
static |
Definition at line 422 of file blob.c.
References _BlobInfo::data, _BlobInfo::debug, _BlobInfo::eof, _BlobInfo::exempt, BlobFileInfo::file, _BlobInfo::file_info, GetWizardModule, _BlobInfo::length, LogWizardEvent(), _BlobInfo::mapped, MapResource, _BlobInfo::offset, RelinquishWizardResource(), TraceEvent, _BlobInfo::type, UndefinedStream, UnmapBlob(), and WizardFalse.
Referenced by CloseBlob(), SetBlobExtent(), and WriteBlob().
WizardExport int EOFBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 471 of file blob.c.
References BlobStream, BZipStream, _BlobInfo::debug, _BlobInfo::eof, BlobFileInfo::file, _BlobInfo::file_info, FileStream, GetWizardModule, LogWizardEvent(), PipeStream, _BlobInfo::signature, StandardStream, TraceEvent, _BlobInfo::type, UndefinedStream, WizardFalse, WizardSignature, WizardTrue, and ZipStream.
WizardExport void * FileToBlob | ( | const char * | filename, |
const size_t | extent, | ||
size_t * | length, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 546 of file blob.c.
References AcquireQuantumMemory(), BlobError, GetWizardModule, LogWizardEvent(), MapBlob(), MaxCipherBlocksize, Min, O_BINARY, open_utf8(), ReadMode, RelinquishWizardMemory(), ResizeQuantumMemory(), ResourceError, ThrowWizardException(), TraceEvent, UnmapBlob(), WizardFalse, and WizardMaxBufferExtent.
Referenced by FileToString(), and FileToStringInfo().
WizardExport const char * GetBlobFilename | ( | const BlobInfo * | blob_info | ) |
Definition at line 717 of file blob.c.
References _BlobInfo::debug, _BlobInfo::filename, GetWizardModule, LogWizardEvent(), TraceEvent, and WizardFalse.
WizardExport void GetBlobInfo | ( | BlobInfo * | blob_info | ) |
Definition at line 748 of file blob.c.
References AcquireSemaphoreInfo(), _BlobInfo::debug, IsEventLogging(), _BlobInfo::quantum, _BlobInfo::reference_count, _BlobInfo::semaphore, _BlobInfo::signature, _BlobInfo::type, UndefinedStream, WizardMaxBlobExtent, and WizardSignature.
Referenced by OpenBlob().
WizardExport const struct stat * GetBlobProperties | ( | const BlobInfo * | blob_info | ) |
Definition at line 882 of file blob.c.
References _BlobInfo::debug, _BlobInfo::filename, GetWizardModule, LogWizardEvent(), _BlobInfo::properties, TraceEvent, and WizardFalse.
WizardExport WizardSizeType GetBlobSize | ( | BlobInfo * | blob_info | ) |
Definition at line 800 of file blob.c.
References BlobStream, BZipStream, _BlobInfo::debug, _BlobInfo::extent, BlobFileInfo::file, _BlobInfo::file_info, _BlobInfo::filename, FileStream, GetPathAttributes(), GetWizardModule, LogWizardEvent(), PipeStream, _BlobInfo::properties, _BlobInfo::size, StandardStream, TraceEvent, _BlobInfo::type, UndefinedStream, WizardFalse, and ZipStream.
Referenced by CloseBlob(), and OpenBlob().
|
static |
Definition at line 784 of file blob.c.
References stat_utf8(), WizardFalse, and WizardTrue.
Referenced by GetBlobSize().
WizardExport void * MapBlob | ( | int | file, |
const MapMode | mode, | ||
const WizardOffsetType | offset, | ||
const size_t | length | ||
) |
Definition at line 920 of file blob.c.
References IOMode, MAP_FAILED, ReadMode, and WriteMode.
Referenced by AcquireVirtualMemory(), ConfigureFileToStringInfo(), FileToBlob(), FileToXML(), OpenBlob(), and SetBlobExtent().
WizardExport BlobInfo * OpenBlob | ( | const char * | filename, |
const BlobMode | mode, | ||
const WizardBooleanType | compress, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1014 of file blob.c.
References AcquireWizardMemory(), AcquireWizardResource(), AttachBlob(), BlobError, BlobEvent, BZipStream, CopyWizardString(), _BlobInfo::exempt, ExtensionPath, BlobFileInfo::file, _BlobInfo::file_info, _BlobInfo::filename, FileStream, fopen_utf8(), GetBlobInfo(), GetBlobSize(), GetPathComponent(), GetWizardModule, LocaleCompare(), LocaleNCompare(), LogWizardEvent(), MapBlob(), _BlobInfo::mapped, MapResource, PipeStream, popen_utf8(), _BlobInfo::properties, ReadBinaryBlobMode, ReadBlobMode, ReadMode, RelinquishWizardMemory(), RelinquishWizardResource(), ResourceError, _BlobInfo::size, stat_utf8(), _BlobInfo::status, StringToLong(), ThrowWizardException(), TraceEvent, _BlobInfo::type, UndefinedStream, WizardFalse, WizardMaxBufferExtent, WizardPathExtent, WizardTrue, WriteBinaryBlobMode, WriteBlobMode, and ZipStream.
WizardExport ssize_t ReadBlob | ( | BlobInfo * | blob_info, |
const size_t | length, | ||
void * | data | ||
) |
Definition at line 1286 of file blob.c.
References BlobStream, BZipStream, _BlobInfo::data, _BlobInfo::eof, BlobFileInfo::file, _BlobInfo::file_info, FileStream, _BlobInfo::length, _BlobInfo::offset, PipeStream, _BlobInfo::signature, StandardStream, _BlobInfo::type, UndefinedStream, WizardMin, WizardSignature, WizardTrue, and ZipStream.
Referenced by ReadBlobChunk(), and ReadBlobStream().
WizardExport int ReadBlobByte | ( | BlobInfo * | blob_info | ) |
Definition at line 1484 of file blob.c.
References ReadBlobStream(), _BlobInfo::signature, and WizardSignature.
WizardExport ssize_t ReadBlobChunk | ( | BlobInfo * | blob_info, |
const size_t | length, | ||
void * | data | ||
) |
Definition at line 1533 of file blob.c.
References BlobStream, ReadBlob(), _BlobInfo::signature, _BlobInfo::type, UndefinedStream, WizardMin, and WizardSignature.
|
inlinestatic |
Definition at line 1460 of file blob.c.
References BlobStream, _BlobInfo::data, _BlobInfo::eof, _BlobInfo::length, _BlobInfo::offset, ReadBlob(), _BlobInfo::type, WizardMin, and WizardTrue.
Referenced by ReadBlobByte().
WizardExport WizardBooleanType SetBlobExtent | ( | BlobInfo * | blob_info, |
const WizardSizeType | extent | ||
) |
Definition at line 1590 of file blob.c.
References AcquireWizardResource(), BlobStream, BZipStream, _BlobInfo::data, DetachBlob(), _BlobInfo::extent, BlobFileInfo::file, _BlobInfo::file_info, FileStream, _BlobInfo::length, MapBlob(), _BlobInfo::mapped, MapResource, PipeStream, RelinquishWizardResource(), ResizeQuantumMemory(), _BlobInfo::signature, StandardStream, SyncBlob(), _BlobInfo::type, UndefinedStream, UnmapBlob(), WizardFalse, WizardSignature, WizardTrue, WriteMode, and ZipStream.
Referenced by WriteBlobStream().
WizardExport int SyncBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 1714 of file blob.c.
References BlobStream, BZipStream, BlobFileInfo::file, _BlobInfo::file_info, _BlobInfo::filename, FileStream, GetWizardModule, LogWizardEvent(), PipeStream, _BlobInfo::signature, StandardStream, TraceEvent, _BlobInfo::type, UndefinedStream, WizardSignature, and ZipStream.
Referenced by CloseBlob(), SetBlobExtent(), and WriteBlob().
WizardExport WizardOffsetType TellBlob | ( | const BlobInfo * | blob_info | ) |
Definition at line 1776 of file blob.c.
References BlobStream, BZipStream, BlobFileInfo::file, _BlobInfo::file_info, _BlobInfo::filename, FileStream, GetWizardModule, LogWizardEvent(), _BlobInfo::offset, PipeStream, _BlobInfo::signature, StandardStream, TraceEvent, _BlobInfo::type, UndefinedStream, WizardSignature, and ZipStream.
|
inlinestatic |
Definition at line 229 of file blob.c.
References _BlobInfo::error_number, and _BlobInfo::status.
Referenced by CloseBlob().
WizardExport WizardBooleanType UnmapBlob | ( | void * | map, |
const size_t | length | ||
) |
Definition at line 1841 of file blob.c.
References WizardFalse, and WizardTrue.
Referenced by ConfigureFileToStringInfo(), DestroyBlob(), DestroyWizardMemory(), DetachBlob(), FileToBlob(), FileToXML(), RelinquishVirtualMemory(), and SetBlobExtent().
WizardExport ssize_t WriteBlob | ( | BlobInfo * | blob_info, |
const size_t | length, | ||
const void * | data | ||
) |
Definition at line 1882 of file blob.c.
References BlobStream, BZipStream, _BlobInfo::data, DetachBlob(), _BlobInfo::extent, BlobFileInfo::file, _BlobInfo::file_info, FileStream, _BlobInfo::length, _BlobInfo::mapped, _BlobInfo::offset, PipeStream, _BlobInfo::quantum, ResizeQuantumMemory(), _BlobInfo::signature, StandardStream, SyncBlob(), _BlobInfo::type, UndefinedStream, WizardFalse, WizardSignature, and ZipStream.
Referenced by WriteBlobChunk(), and WriteBlobStream().
WizardExport ssize_t WriteBlobByte | ( | BlobInfo * | blob_info, |
const unsigned char | value | ||
) |
Definition at line 2091 of file blob.c.
References _BlobInfo::signature, WizardSignature, and WriteBlobStream().
WizardExport ssize_t WriteBlobChunk | ( | BlobInfo * | blob_info, |
const size_t | length, | ||
const void * | data | ||
) |
Definition at line 2129 of file blob.c.
References BlobStream, _BlobInfo::signature, _BlobInfo::type, WizardMin, WizardSignature, and WriteBlob().
|
inlinestatic |
Definition at line 2061 of file blob.c.
References BlobStream, _BlobInfo::data, _BlobInfo::extent, _BlobInfo::length, _BlobInfo::offset, _BlobInfo::quantum, SetBlobExtent(), _BlobInfo::type, UndefinedStream, WizardFalse, and WriteBlob().
Referenced by WriteBlobByte(), and WriteBlobString().
WizardExport ssize_t WriteBlobString | ( | BlobInfo * | blob_info, |
const char * | string | ||
) |
Definition at line 2183 of file blob.c.
References _BlobInfo::signature, WizardSignature, and WriteBlobStream().