MagickCore 7.0.10
|
#include "wizard/studio.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/hashmap.h"
#include "wizard/log.h"
#include "wizard/memory_.h"
#include "wizard/option.h"
#include "wizard/random_.h"
#include "wizard/resource_.h"
#include "wizard/semaphore.h"
#include "wizard/signature.h"
#include "wizard/splay-tree.h"
#include "wizard/string_.h"
#include "wizard/string-private.h"
#include "wizard/token.h"
#include "wizard/utility.h"
#include "wizard/utility-private.h"
Go to the source code of this file.
Data Structures | |
struct | _ResourceInfo |
Macros | |
#define | WizardResourceInfinity (~0UL) |
#define | O_NOFOLLOW 0 |
#define | TMP_MAX 238328 |
Typedefs | |
typedef struct _ResourceInfo | ResourceInfo |
Variables | |
static RandomInfo * | random_info = (RandomInfo *) NULL |
static ResourceInfo | resource_info |
static SemaphoreInfo * | resource_semaphore = (SemaphoreInfo *) NULL |
static SplayTreeInfo * | temporary_resources = (SplayTreeInfo *) NULL |
#define O_NOFOLLOW 0 |
#define TMP_MAX 238328 |
#define WizardResourceInfinity (~0UL) |
Definition at line 63 of file resource.c.
typedef struct _ResourceInfo ResourceInfo |
WizardExport WizardBooleanType AcquireUniqueFilename | ( | char * | path, |
ExceptionInfo * | exception | ||
) |
Definition at line 137 of file resource.c.
References AcquireUniqueFileResource(), GetWizardModule, ResourceError, ThrowWizardException(), WizardFalse, and WizardTrue.
WizardExport int AcquireUniqueFileResource | ( | const char * | path, |
char * | filename, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 250 of file resource.c.
References AcquireRandomInfo(), AcquireWizardResource(), ActivateSemaphoreInfo(), AddValueToSplayTree(), CompareSplayTreeString(), ConstantString(), DestroyStringInfo(), DestroyTemporaryResources(), FileResource, GetPathTemplate(), GetRandomKey(), GetStringInfoDatum(), GetStringInfoLength(), GetWizardModule, LockSemaphoreInfo(), LogWizardEvent(), NewSplayTree(), O_BINARY, O_NOFOLLOW, open_utf8(), random_info, remove_utf8(), resource_semaphore, ResourceDomain, ResourceError, ResourceEvent, S_MODE, SHA2256Hash, temporary_resources, ThrowWizardException(), TMP_MAX, UnlockSemaphoreInfo(), WizardAssert, and WizardFalse.
Referenced by AcquireUniqueFilename(), and AcquireVirtualMemory().
WizardExport WizardBooleanType AcquireWizardResource | ( | const ResourceType | type, |
const WizardSizeType | size | ||
) |
Definition at line 388 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatWizardSize(), GetWizardModule, LockSemaphoreInfo(), LogWizardEvent(), _ResourceInfo::map, _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, ResourceEvent, UnlockSemaphoreInfo(), WizardFalse, WizardFormatExtent, WizardOptionToMnemonic(), WizardResourceInfinity, WizardResourceOptions, and WizardTrue.
Referenced by AcquireUniqueFileResource(), AcquireVirtualMemory(), OpenBlob(), and SetBlobExtent().
WizardExport void AsynchronousResourceComponentTerminus | ( | void | ) |
Definition at line 511 of file resource.c.
References DestroyRandomInfo(), GetNextKeyInSplayTree(), random_info, remove_utf8(), ResetSplayTreeIterator(), and temporary_resources.
Referenced by WizardSignalHandler().
|
static |
Definition at line 181 of file resource.c.
References DestroyString(), and remove_utf8().
Referenced by AcquireUniqueFileResource().
WizardExport WizardBooleanType GetPathTemplate | ( | const char * | path, |
char * | filename | ||
) |
Definition at line 188 of file resource.c.
References ConstantString(), DirectorySeparator, FormatLocaleString(), GetEnvironmentValue(), RelinquishWizardMemory(), S_ISDIR, stat_utf8(), WizardFalse, WizardPathExtent, and WizardTrue.
Referenced by AcquireUniqueFileResource().
WizardExport WizardSizeType GetWizardResource | ( | const ResourceType | type | ) |
Definition at line 554 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, AreaResource, _ResourceInfo::disk, DiskResource, _ResourceInfo::file, FileResource, LockSemaphoreInfo(), _ResourceInfo::map, MapResource, _ResourceInfo::memory, MemoryResource, resource_info, resource_semaphore, and UnlockSemaphoreInfo().
WizardExport WizardSizeType GetWizardResourceLimit | ( | const ResourceType | type | ) |
Definition at line 620 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, LockSemaphoreInfo(), _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, and UnlockSemaphoreInfo().
WizardExport WizardBooleanType ListWizardResourceInfo | ( | FILE * | file, |
ExceptionInfo * | wizard_unusedexception | ||
) |
Definition at line 688 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, CopyWizardString(), _ResourceInfo::disk_limit, _ResourceInfo::file_limit, FormatWizardSize(), LockSemaphoreInfo(), _ResourceInfo::map_limit, _ResourceInfo::memory_limit, resource_info, resource_semaphore, UnlockSemaphoreInfo(), WizardFalse, WizardFormatExtent, WizardResourceInfinity, and WizardTrue.
WizardExport WizardBooleanType RelinquishUniqueFileResource | ( | const char * | path, |
const WizardBooleanType | trash | ||
) |
Definition at line 843 of file resource.c.
References DeleteNodeFromSplayTree(), GetNextKeyInSplayTree(), GetWizardModule, LocaleCompare(), LogWizardEvent(), remove_utf8(), ResetSplayTreeIterator(), ResourceDomain, ResourceEvent, temporary_resources, WizardAssert, WizardFalse, and WizardTrue.
Referenced by AcquireVirtualMemory(), and RelinquishVirtualMemory().
WizardExport void RelinquishWizardResource | ( | const ResourceType | type, |
const WizardSizeType | size | ||
) |
Definition at line 746 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatWizardSize(), GetWizardModule, LockSemaphoreInfo(), LogWizardEvent(), _ResourceInfo::map, _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, ResourceEvent, UnlockSemaphoreInfo(), WizardFalse, WizardFormatExtent, WizardOptionToMnemonic(), WizardResourceOptions, and WizardTrue.
Referenced by AcquireVirtualMemory(), DestroyBlob(), DetachBlob(), OpenBlob(), RelinquishVirtualMemory(), and SetBlobExtent().
WizardExport WizardBooleanType ResourceComponentGenesis | ( | void | ) |
Definition at line 887 of file resource.c.
References AcquireSemaphoreInfo(), AreaResource, DestroyString(), DiskResource, FileResource, GetEnvironmentValue(), MapResource, MemoryResource, resource_semaphore, SetWizardResourceLimit(), StringToUnsignedLong(), WizardMax, and WizardTrue.
Referenced by WizardsToolkitGenesis().
WizardExport void ResourceComponentTerminus | ( | void | ) |
Definition at line 983 of file resource.c.
References ActivateSemaphoreInfo(), DestroySplayTree(), LockSemaphoreInfo(), RelinquishSemaphoreInfo(), resource_semaphore, temporary_resources, and UnlockSemaphoreInfo().
Referenced by WizardsToolkitTerminus().
WizardExport WizardBooleanType SetWizardResourceLimit | ( | const ResourceType | type, |
const WizardSizeType | limit | ||
) |
Definition at line 1019 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, LockSemaphoreInfo(), _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, UnlockSemaphoreInfo(), and WizardTrue.
Referenced by ResourceComponentGenesis().
|
static |
Definition at line 89 of file resource.c.
Referenced by AcquireRandomInfo(), AcquireUniqueFileResource(), AsynchronousResourceComponentTerminus(), DestroyRandomInfo(), GenerateEntropicChaos(), GetEntropyFromReservoir(), GetPseudoRandomValue(), GetRandomKey(), GetRandomSecretKey(), GetRandomValue(), SaveEntropyToReservoir(), and SetRandomKey().
|
static |
Definition at line 92 of file resource.c.
Referenced by AcquireWizardResource(), GetWizardResource(), GetWizardResourceLimit(), ListWizardResourceInfo(), RelinquishWizardResource(), and SetWizardResourceLimit().
|
static |
Definition at line 107 of file resource.c.
Referenced by AcquireUniqueFileResource(), AcquireWizardResource(), GetWizardResource(), GetWizardResourceLimit(), ListWizardResourceInfo(), RelinquishWizardResource(), ResourceComponentGenesis(), ResourceComponentTerminus(), and SetWizardResourceLimit().
|
static |
Definition at line 110 of file resource.c.
Referenced by AcquireUniqueFileResource(), AsynchronousResourceComponentTerminus(), RelinquishUniqueFileResource(), and ResourceComponentTerminus().