#include "magick/studio.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/locale_.h"
#include "magick/log.h"
#include "magick/memory_.h"
#include "magick/splay-tree.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
Data Structures | |
struct | _NodeInfo |
struct | _SplayTreeInfo |
Defines | |
#define | MaxSplayTreeDepth 1024 |
Typedefs | |
typedef struct _NodeInfo | NodeInfo |
Functions | |
static int | IterateOverSplayTree (SplayTreeInfo *, int(*)(NodeInfo *, const void *), const void *) |
static void | SplaySplayTree (SplayTreeInfo *, const void *) |
MagickExport MagickBooleanType | AddValueToSplayTree (SplayTreeInfo *splay_tree, const void *key, const void *value) |
static NodeInfo * | LinkSplayTreeNodes (NodeInfo **nodes, const size_t low, const size_t high) |
static int | SplayTreeToNodeArray (NodeInfo *node, const void *nodes) |
static void | BalanceSplayTree (SplayTreeInfo *splay_tree) |
static void * | GetFirstSplayTreeNode (SplayTreeInfo *splay_tree) |
MagickExport SplayTreeInfo * | CloneSplayTree (SplayTreeInfo *splay_tree, void *(*clone_key)(void *), void *(*clone_value)(void *)) |
MagickExport int | CompareSplayTreeString (const void *target, const void *source) |
MagickExport int | CompareSplayTreeStringInfo (const void *target, const void *source) |
MagickExport MagickBooleanType | DeleteNodeByValueFromSplayTree (SplayTreeInfo *splay_tree, const void *value) |
MagickExport MagickBooleanType | DeleteNodeFromSplayTree (SplayTreeInfo *splay_tree, const void *key) |
MagickExport SplayTreeInfo * | DestroySplayTree (SplayTreeInfo *splay_tree) |
MagickExport const void * | GetNextKeyInSplayTree (SplayTreeInfo *splay_tree) |
MagickExport const void * | GetNextValueInSplayTree (SplayTreeInfo *splay_tree) |
MagickExport const void * | GetRootValueFromSplayTree (SplayTreeInfo *splay_tree) |
MagickExport const void * | GetValueFromSplayTree (SplayTreeInfo *splay_tree, const void *key) |
MagickExport size_t | GetNumberOfNodesInSplayTree (const SplayTreeInfo *splay_tree) |
MagickExport SplayTreeInfo * | NewSplayTree (int(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *)) |
MagickExport void * | RemoveNodeByValueFromSplayTree (SplayTreeInfo *splay_tree, const void *value) |
MagickExport void * | RemoveNodeFromSplayTree (SplayTreeInfo *splay_tree, const void *key) |
MagickExport void | ResetSplayTree (SplayTreeInfo *splay_tree) |
MagickExport void | ResetSplayTreeIterator (SplayTreeInfo *splay_tree) |
static NodeInfo * | Splay (SplayTreeInfo *splay_tree, const size_t depth, const void *key, NodeInfo **node, NodeInfo **parent, NodeInfo **grandparent) |
#define MaxSplayTreeDepth 1024 |
Referenced by Splay().
MagickExport MagickBooleanType AddValueToSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | key, | |||
const void * | value | |||
) |
References AcquireMagickMemory(), _SplayTreeInfo::compare, _SplayTreeInfo::key, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), MagickFalse, MagickTrue, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, SplaySplayTree(), UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by AcquireCoderCache(), AcquireUniqueFileResource(), CloneSplayTree(), FxChannelStatistics(), FxEvaluateSubexpression(), FxGetSymbol(), GetEXIFProperty(), GetImageAttribute(), GetMVGMacros(), GetXMLTreeAttributes(), GetXMPProperty(), IsMagickTreeInstantiated(), LoadCoderCache(), LoadFontConfigFonts(), LoadLocaleCache(), LoadTypeCache(), OpenDistributeCache(), RegisterMagickInfo(), SetImageArtifact(), SetImageOption(), SetImageProfileInternal(), SetImageProperty(), SetImageRegistry(), SyncExifProfile(), and WriteTo8BimProfile().
static void BalanceSplayTree | ( | SplayTreeInfo * | splay_tree | ) | [static] |
MagickExport SplayTreeInfo* CloneSplayTree | ( | SplayTreeInfo * | splay_tree, | |
void *(*)(void *) | clone_key, | |||
void *(*)(void *) | clone_value | |||
) |
References AddValueToSplayTree(), _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetFirstSplayTreeNode(), GetMagickModule, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, NewSplayTree(), _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by CloneImageArtifacts(), CloneImageOptions(), CloneImageProfiles(), and CloneImageProperties().
MagickExport int CompareSplayTreeString | ( | const void * | target, | |
const void * | source | |||
) |
References LocaleCompare().
Referenced by AcquireCoderCache(), AcquireFxInfo(), AcquireLocaleSplayTree(), AcquireTypeCache(), AcquireUniqueFileResource(), GetImageAttribute(), GetXMPProperty(), IsMagickTreeInstantiated(), SetImageArtifact(), SetImageOption(), SetImageProfileInternal(), SetImageProperty(), and SetImageRegistry().
MagickExport int CompareSplayTreeStringInfo | ( | const void * | target, | |
const void * | source | |||
) |
References CompareStringInfo().
MagickExport MagickBooleanType DeleteNodeByValueFromSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | value | |||
) |
References _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetFirstSplayTreeNode(), GetMagickModule, _SplayTreeInfo::key, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by UnregisterMagickInfo().
MagickExport MagickBooleanType DeleteNodeFromSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | key | |||
) |
References _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetMagickModule, _NodeInfo::key, _SplayTreeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by DeleteImageArtifact(), DeleteImageOption(), DeleteImageProfile(), DeleteImageProperty(), DeleteImageRegistry(), DestroyDistributeCache(), FxChannelStatistics(), FxEvaluateSubexpression(), and RelinquishUniqueFileResource().
MagickExport SplayTreeInfo* DestroySplayTree | ( | SplayTreeInfo * | splay_tree | ) |
References DestroySemaphoreInfo(), _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), MagickCoreSignature, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by CoderComponentTerminus(), DestroyFxInfo(), DestroyImageArtifacts(), DestroyImageAttributes(), DestroyImageOptions(), DestroyImageProfiles(), DestroyImageProperties(), DistributePixelCacheClient(), GetEXIFProperty(), LocaleComponentTerminus(), MagickComponentTerminus(), RegistryComponentTerminus(), RenderMVGContent(), ResourceComponentTerminus(), SyncExifProfile(), and TypeComponentTerminus().
static void* GetFirstSplayTreeNode | ( | SplayTreeInfo * | splay_tree | ) | [inline, static] |
References _NodeInfo::key, _NodeInfo::left, and _SplayTreeInfo::root.
Referenced by CloneSplayTree(), DeleteNodeByValueFromSplayTree(), RemoveNodeByValueFromSplayTree(), and ResetSplayTreeIterator().
MagickExport const void* GetNextKeyInSplayTree | ( | SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::debug, GetMagickModule, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::next, _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, and UnlockSemaphoreInfo().
Referenced by AsynchronousResourceComponentTerminus(), GetNextImageArtifact(), GetNextImageOption(), GetNextImageProfile(), GetNextImageProperty(), and GetNextImageRegistry().
MagickExport const void* GetNextValueInSplayTree | ( | SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::debug, GetMagickModule, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::next, _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by GetCoderInfoList(), GetCoderList(), GetImageArtifact(), GetImageMagick(), GetImageProperty(), GetLocaleInfo_(), GetLocaleInfoList(), GetLocaleList(), GetMagickInfoList(), GetMagickList(), GetTypeInfoByFamily(), GetTypeInfoList(), GetTypeList(), and UnregisterMagickInfo().
MagickExport size_t GetNumberOfNodesInSplayTree | ( | const SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::debug, GetMagickModule, LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::nodes, _SplayTreeInfo::signature, and TraceEvent.
Referenced by AcquireLocaleSplayTree(), AcquireTypeCache(), GetCoderInfoList(), GetCoderList(), GetLocaleInfoList(), GetLocaleList(), GetMagickInfoList(), GetMagickList(), GetTypeInfoList(), GetTypeList(), and UnregisterMagickInfo().
MagickExport const void* GetRootValueFromSplayTree | ( | SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::debug, GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by GetCoderInfo(), GetMagickInfo(), and GetTypeInfo().
MagickExport const void* GetValueFromSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | key | |||
) |
References _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetMagickModule, _NodeInfo::key, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by FxChannelStatistics(), FxGetSymbol(), GetCoderInfo(), GetEXIFProperty(), GetImageArtifact(), GetImageAttribute(), GetImageOption(), GetImageProfile(), GetImageProperty(), GetImageRegistry(), GetLocaleInfo_(), GetMagickInfo(), GetTypeInfo(), ReadDistributeCacheIndexes(), ReadDistributeCachePixels(), RenderMVGContent(), SyncExifProfile(), WriteDistributeCacheIndexes(), WriteDistributeCachePixels(), and WriteTo8BimProfile().
static int IterateOverSplayTree | ( | SplayTreeInfo * | splay_tree, | |
int(*)(NodeInfo *, const void *) | method, | |||
const void * | value | |||
) | [static] |
References AcquireQuantumMemory(), _NodeInfo::left, MagickFalse, MagickTrue, _SplayTreeInfo::nodes, RelinquishMagickMemory(), ResourceLimitFatalError, _NodeInfo::right, _SplayTreeInfo::root, and ThrowFatalException.
Referenced by BalanceSplayTree().
static NodeInfo* LinkSplayTreeNodes | ( | NodeInfo ** | nodes, | |
const size_t | low, | |||
const size_t | high | |||
) | [static] |
References _NodeInfo::left.
Referenced by BalanceSplayTree().
MagickExport SplayTreeInfo* NewSplayTree | ( | int(*)(const void *, const void *) | compare, | |
void *(*)(void *) | relinquish_key, | |||
void *(*)(void *) | relinquish_value | |||
) |
References AcquireMagickMemory(), AllocateSemaphoreInfo(), _SplayTreeInfo::balance, _SplayTreeInfo::compare, _SplayTreeInfo::debug, IsEventLogging(), _SplayTreeInfo::key, MagickCoreSignature, MagickFalse, _SplayTreeInfo::next, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, ResourceLimitFatalError, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, and ThrowFatalException.
Referenced by AcquireCoderCache(), AcquireFxInfo(), AcquireLocaleSplayTree(), AcquireTypeCache(), AcquireUniqueFileResource(), CloneSplayTree(), DistributePixelCacheClient(), GetEXIFProperty(), GetImageAttribute(), GetMVGMacros(), GetXMPProperty(), IsMagickTreeInstantiated(), SetImageArtifact(), SetImageOption(), SetImageProfileInternal(), SetImageProperty(), SetImageRegistry(), and SyncExifProfile().
MagickExport void* RemoveNodeByValueFromSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | value | |||
) |
References _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetFirstSplayTreeNode(), GetMagickModule, _SplayTreeInfo::key, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_value, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
MagickExport void* RemoveNodeFromSplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | key | |||
) |
References _SplayTreeInfo::compare, _SplayTreeInfo::debug, GetMagickModule, _NodeInfo::key, _SplayTreeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, SplaySplayTree(), TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by RemoveImageArtifact(), RemoveImageOption(), RemoveImageProfile(), RemoveImageProperty(), and RemoveImageRegistry().
MagickExport void ResetSplayTree | ( | SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::balance, _SplayTreeInfo::debug, GetMagickModule, _SplayTreeInfo::key, _NodeInfo::key, _NodeInfo::left, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::next, _SplayTreeInfo::nodes, _SplayTreeInfo::relinquish_key, _SplayTreeInfo::relinquish_value, RelinquishMagickMemory(), _NodeInfo::right, _SplayTreeInfo::root, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, TraceEvent, UnlockSemaphoreInfo(), and _NodeInfo::value.
Referenced by ResetImageOptions().
MagickExport void ResetSplayTreeIterator | ( | SplayTreeInfo * | splay_tree | ) |
References _SplayTreeInfo::debug, GetFirstSplayTreeNode(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _SplayTreeInfo::next, _SplayTreeInfo::semaphore, _SplayTreeInfo::signature, TraceEvent, and UnlockSemaphoreInfo().
Referenced by AsynchronousResourceComponentTerminus(), GetCoderInfoList(), GetCoderList(), GetImageArtifact(), GetImageMagick(), GetImageProperty(), GetLocaleInfo_(), GetLocaleInfoList(), GetMagickInfoList(), GetMagickList(), GetTypeInfoByFamily(), GetTypeInfoList(), GetTypeList(), ResetImageArtifactIterator(), ResetImageOptionIterator(), ResetImageProfileIterator(), ResetImagePropertyIterator(), ResetImageRegistryIterator(), and UnregisterMagickInfo().
static NodeInfo* Splay | ( | SplayTreeInfo * | splay_tree, | |
const size_t | depth, | |||
const void * | key, | |||
NodeInfo ** | node, | |||
NodeInfo ** | parent, | |||
NodeInfo ** | grandparent | |||
) | [static] |
References _SplayTreeInfo::balance, _SplayTreeInfo::compare, _NodeInfo::key, _NodeInfo::left, MagickFalse, MagickTrue, MaxSplayTreeDepth, and _NodeInfo::right.
Referenced by SplaySplayTree().
static void SplaySplayTree | ( | SplayTreeInfo * | splay_tree, | |
const void * | key | |||
) | [static] |
References _SplayTreeInfo::balance, BalanceSplayTree(), _SplayTreeInfo::compare, _NodeInfo::key, _SplayTreeInfo::key, MagickFalse, ResourceLimitFatalError, _SplayTreeInfo::root, Splay(), and ThrowFatalException.
Referenced by AddValueToSplayTree(), CloneSplayTree(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), GetNextKeyInSplayTree(), GetNextValueInSplayTree(), GetValueFromSplayTree(), RemoveNodeByValueFromSplayTree(), and RemoveNodeFromSplayTree().
static int SplayTreeToNodeArray | ( | NodeInfo * | node, | |
const void * | nodes | |||
) | [inline, static] |
Referenced by BalanceSplayTree().