|
WizardsToolkit
1.0.7
|
#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/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 | |
| struct | _BlobInfo |
Defines | |
| #define | WizardMaxBlobExtent 65541 |
| #define | MAP_FAILED ((void *) -1) |
| #define | MS_SYNC 0x04 |
Enumerations | |
| enum | StreamType { UndefinedStream, FileStream, StandardStream, PipeStream, ZipStream, BZipStream, BlobStream } |
Functions | |
| static unsigned char * | DetachBlob (BlobInfo *) |
| static void | AttachBlob (BlobInfo *blob_info, const void *blob, const size_t length) |
| WizardExport WizardBooleanType | CloseBlob (BlobInfo *blob_info) |
| WizardExport BlobInfo * | DestroyBlob (BlobInfo *blob_info) |
| WizardExport int | EOFBlob (BlobInfo *blob_info) |
| WizardExport unsigned char * | 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) |
| WizardExport WizardSizeType | GetBlobSize (BlobInfo *blob_info) |
| WizardExport 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) |
| static size_t | WizardMin (const size_t x, const size_t y) |
| WizardExport ssize_t | ReadBlob (BlobInfo *blob_info, const size_t length, unsigned char *data) |
| static const unsigned char * | ReadBlobStream (BlobInfo *blob_info, const size_t length, unsigned char *data, ssize_t *count) |
| WizardExport int | ReadBlobByte (BlobInfo *blob_info) |
| WizardExport ssize_t | ReadBlobChunk (BlobInfo *blob_info, const size_t length, unsigned char *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 unsigned char *data) |
| static ssize_t | WriteBlobStream (BlobInfo *blob_info, const size_t length, const unsigned char *data) |
| WizardExport ssize_t | WriteBlobByte (BlobInfo *blob_info, const unsigned char value) |
| WizardExport ssize_t | WriteBlobChunk (BlobInfo *blob_info, const size_t length, const unsigned char *data) |
| WizardExport ssize_t | WriteBlobString (BlobInfo *blob_info, const char *string) |
| #define MS_SYNC 0x04 |
Definition at line 73 of file blob.c.
Referenced by SyncBlob().
| #define WizardMaxBlobExtent 65541 |
Definition at line 65 of file blob.c.
Referenced by AttachBlob(), and GetBlobInfo().
| enum StreamType |
| static void AttachBlob | ( | BlobInfo * | blob_info, |
| const void * | blob, | ||
| const size_t | length | ||
| ) | [static] |
Definition at line 172 of file blob.c.
References _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::length, _BlobInfo::extent, _BlobInfo::quantum, WizardMaxBlobExtent, _BlobInfo::offset, _BlobInfo::type, BlobStream, _BlobInfo::file, _BlobInfo::data, and _BlobInfo::mapped.
Referenced by OpenBlob().
| WizardExport WizardBooleanType CloseBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 209 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, _BlobInfo::type, UndefinedStream, WizardTrue, SyncBlob(), _BlobInfo::size, GetBlobSize(), _BlobInfo::eof, _BlobInfo::exempt, FileStream, StandardStream, PipeStream, _BlobInfo::file, ZipStream, BZipStream, BlobStream, _BlobInfo::status, pclose, and DetachBlob().
Definition at line 323 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, LockSemaphoreInfo(), _BlobInfo::semaphore, _BlobInfo::reference_count, WizardTrue, UnlockSemaphoreInfo(), CloseBlob(), _BlobInfo::mapped, UnmapBlob(), _BlobInfo::data, _BlobInfo::length, DestroySemaphoreInfo(), and RelinquishWizardMemory().
| static unsigned char * DetachBlob | ( | BlobInfo * | blob_info | ) | [static] |
Definition at line 373 of file blob.c.
References _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::mapped, UnmapBlob(), _BlobInfo::data, _BlobInfo::length, _BlobInfo::offset, _BlobInfo::eof, _BlobInfo::exempt, _BlobInfo::type, UndefinedStream, and _BlobInfo::file.
Referenced by CloseBlob(), SetBlobExtent(), and WriteBlob().
| WizardExport int EOFBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 418 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::type, UndefinedStream, FileStream, StandardStream, PipeStream, _BlobInfo::eof, _BlobInfo::file, WizardTrue, ZipStream, BZipStream, and BlobStream.
| WizardExport unsigned char* FileToBlob | ( | const char * | filename, |
| const size_t | extent, | ||
| size_t * | length, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 492 of file blob.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, fileno, open_utf8(), O_BINARY, ThrowWizardException(), BlobError, lseek, stat, WizardMaxBufferExtent, fstat, Min, AcquireQuantumMemory(), read, RelinquishWizardMemory(), ResizeQuantumMemory(), close, ResourceError, MaxCipherBlocksize, MapBlob(), ReadMode, UnmapBlob(), WizardFalse, and SSIZE_MAX.
Referenced by FileToString(), and FileToStringInfo().
| WizardExport const char* GetBlobFilename | ( | const BlobInfo * | blob_info | ) |
Definition at line 661 of file blob.c.
References _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, and _BlobInfo::filename.
| WizardExport void GetBlobInfo | ( | BlobInfo * | blob_info | ) |
Definition at line 692 of file blob.c.
References ResetWizardMemory(), _BlobInfo::type, UndefinedStream, _BlobInfo::quantum, WizardMaxBlobExtent, _BlobInfo::debug, IsEventLogging(), _BlobInfo::reference_count, _BlobInfo::semaphore, AllocateSemaphoreInfo(), _BlobInfo::signature, and WizardSignature.
Referenced by OpenBlob().
| WizardExport struct stat* GetBlobProperties | ( | const BlobInfo * | blob_info | ) | [read] |
Definition at line 803 of file blob.c.
References _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, and _BlobInfo::properties.
| WizardExport WizardSizeType GetBlobSize | ( | BlobInfo * | blob_info | ) |
Definition at line 727 of file blob.c.
References _BlobInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, _BlobInfo::type, UndefinedStream, _BlobInfo::size, FileStream, fstat, fileno, _BlobInfo::file, _BlobInfo::properties, StandardStream, PipeStream, ZipStream, BZipStream, BlobStream, and _BlobInfo::length.
Referenced by CloseBlob(), and OpenBlob().
| WizardExport void* MapBlob | ( | int | file, |
| const MapMode | mode, | ||
| const WizardOffsetType | offset, | ||
| const size_t | length | ||
| ) |
Definition at line 841 of file blob.c.
References MAP_ANONYMOUS, MAP_PRIVATE, ReadMode, PROT_READ, mmap, WriteMode, PROT_WRITE, MAP_SHARED, IOMode, and MAP_FAILED.
Referenced by FileToBlob(), OpenBlob(), SetBlobExtent(), and ConfigureFileToStringInfo().
| WizardExport BlobInfo* OpenBlob | ( | const char * | filename, |
| const BlobMode | mode, | ||
| const WizardBooleanType | compress, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 936 of file blob.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, AcquireWizardMemory(), ThrowWizardException(), ResourceError, GetBlobInfo(), ReadBlobMode, ReadBinaryBlobMode, WriteBlobMode, WriteBinaryBlobMode, CopyWizardString(), _BlobInfo::filename, MaxTextExtent, LocaleCompare(), _BlobInfo::file, setmode, _BlobInfo::type, StandardStream, _BlobInfo::exempt, WizardTrue, LocaleNCompare(), fdopen, StringToLong(), popen_utf8(), BlobError, RelinquishWizardMemory(), PipeStream, stat_utf8(), _BlobInfo::properties, WizardFalse, fopen_utf8(), FileStream, ResetWizardMemory(), BlobEvent, ZipStream, BZipStream, stat, MapBlob(), fileno, ReadMode, AttachBlob(), _BlobInfo::mapped, GetPathComponent(), ExtensionPath, _BlobInfo::status, UndefinedStream, _BlobInfo::size, and GetBlobSize().
| WizardExport ssize_t ReadBlob | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| unsigned char * | data | ||
| ) |
Definition at line 1198 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, UndefinedStream, FileStream, StandardStream, PipeStream, _BlobInfo::file, ZipStream, BZipStream, BlobStream, _BlobInfo::offset, _BlobInfo::length, _BlobInfo::eof, WizardTrue, _BlobInfo::data, and WizardMin().
| WizardExport int ReadBlobByte | ( | BlobInfo * | blob_info | ) |
Definition at line 1365 of file blob.c.
References _BlobInfo::signature, WizardSignature, and ReadBlobStream().
| WizardExport ssize_t ReadBlobChunk | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| unsigned char * | data | ||
| ) |
Definition at line 1414 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, UndefinedStream, BlobStream, ReadBlob(), WizardMin(), and SSIZE_MAX.
| static const unsigned char* ReadBlobStream | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| unsigned char * | data, | ||
| ssize_t * | count | ||
| ) | [inline, static] |
Definition at line 1340 of file blob.c.
References _BlobInfo::type, BlobStream, ReadBlob(), _BlobInfo::offset, _BlobInfo::length, _BlobInfo::eof, WizardTrue, _BlobInfo::data, and WizardMin().
Referenced by ReadBlobByte().
| WizardExport WizardBooleanType SetBlobExtent | ( | BlobInfo * | blob_info, |
| const WizardSizeType | extent | ||
| ) |
Definition at line 1470 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, UndefinedStream, FileStream, WizardFalse, TellBlob(), fileno, _BlobInfo::file, StandardStream, PipeStream, ZipStream, BZipStream, BlobStream, _BlobInfo::mapped, UnmapBlob(), _BlobInfo::data, _BlobInfo::length, MapBlob(), WriteMode, _BlobInfo::extent, SyncBlob(), ResizeQuantumMemory(), DetachBlob(), and WizardTrue.
Referenced by WriteBlobStream().
| WizardExport int SyncBlob | ( | BlobInfo * | blob_info | ) |
Definition at line 1582 of file blob.c.
References _BlobInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, _BlobInfo::type, UndefinedStream, FileStream, StandardStream, PipeStream, _BlobInfo::file, ZipStream, BZipStream, BlobStream, _BlobInfo::mapped, WizardFalse, msync, _BlobInfo::data, _BlobInfo::length, and MS_SYNC.
Referenced by CloseBlob(), SetBlobExtent(), and WriteBlob().
| WizardExport WizardOffsetType TellBlob | ( | const BlobInfo * | blob_info | ) |
Definition at line 1650 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, UndefinedStream, LogWizardEvent(), TraceEvent, GetWizardModule, _BlobInfo::filename, FileStream, _BlobInfo::file, StandardStream, PipeStream, ZipStream, BZipStream, BlobStream, and _BlobInfo::offset.
Referenced by SetBlobExtent().
| WizardExport WizardBooleanType UnmapBlob | ( | void * | map, |
| const size_t | length | ||
| ) |
Definition at line 1715 of file blob.c.
References munmap, WizardFalse, and WizardTrue.
Referenced by DestroyBlob(), DetachBlob(), FileToBlob(), SetBlobExtent(), DestroyWizardMemory(), and ConfigureFileToStringInfo().
| static size_t WizardMin | ( | const size_t | x, |
| const size_t | y | ||
| ) | [inline, static] |
Definition at line 1191 of file blob.c.
Referenced by ReadBlob(), ReadBlobStream(), ReadBlobChunk(), and WriteBlobChunk().
| WizardExport ssize_t WriteBlob | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| const unsigned char * | data | ||
| ) |
Definition at line 1756 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, UndefinedStream, FileStream, StandardStream, PipeStream, _BlobInfo::file, ZipStream, BZipStream, BlobStream, _BlobInfo::offset, _BlobInfo::extent, _BlobInfo::mapped, WizardFalse, _BlobInfo::quantum, _BlobInfo::data, ResizeQuantumMemory(), SyncBlob(), DetachBlob(), and _BlobInfo::length.
| WizardExport ssize_t WriteBlobByte | ( | BlobInfo * | blob_info, |
| const unsigned char | value | ||
| ) |
Definition at line 1938 of file blob.c.
References _BlobInfo::signature, WizardSignature, and WriteBlobStream().
| WizardExport ssize_t WriteBlobChunk | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| const unsigned char * | data | ||
| ) |
Definition at line 1976 of file blob.c.
References _BlobInfo::signature, WizardSignature, _BlobInfo::type, BlobStream, WriteBlob(), WizardMin(), and SSIZE_MAX.
| static ssize_t WriteBlobStream | ( | BlobInfo * | blob_info, |
| const size_t | length, | ||
| const unsigned char * | data | ||
| ) | [inline, static] |
Definition at line 1908 of file blob.c.
References _BlobInfo::type, BlobStream, WriteBlob(), UndefinedStream, _BlobInfo::offset, _BlobInfo::extent, _BlobInfo::quantum, SetBlobExtent(), WizardFalse, _BlobInfo::data, and _BlobInfo::length.
Referenced by WriteBlobByte(), and WriteBlobString().
| WizardExport ssize_t WriteBlobString | ( | BlobInfo * | blob_info, |
| const char * | string | ||
| ) |
Definition at line 2029 of file blob.c.
References _BlobInfo::signature, WizardSignature, and WriteBlobStream().