MagickCore 7.0.10
splay-tree.c File Reference
#include "wizard/studio.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/log.h"
#include "wizard/memory_.h"
#include "wizard/splay-tree.h"
#include "wizard/semaphore.h"
#include "wizard/string_.h"
Include dependency graph for splay-tree.c:

Go to the source code of this file.

Data Structures

struct  _NodeInfo
 
struct  _SplayTreeInfo
 

Macros

#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 *)
 
WizardExport WizardBooleanType AddValueToSplayTree (SplayTreeInfo *splay_tree, const void *key, const void *value)
 
static NodeInfoLinkSplayTreeNodes (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)
 
WizardExport SplayTreeInfoCloneSplayTree (SplayTreeInfo *splay_tree, void *(*clone_key)(void *), void *(*clone_value)(void *))
 
WizardExport int CompareSplayTreeString (const void *target, const void *source)
 
WizardExport int CompareSplayTreeStringInfo (const void *target, const void *source)
 
WizardExport WizardBooleanType DeleteNodeByValueFromSplayTree (SplayTreeInfo *splay_tree, const void *value)
 
WizardExport WizardBooleanType DeleteNodeFromSplayTree (SplayTreeInfo *splay_tree, const void *key)
 
WizardExport SplayTreeInfoDestroySplayTree (SplayTreeInfo *splay_tree)
 
WizardExport const void * GetNextKeyInSplayTree (SplayTreeInfo *splay_tree)
 
WizardExport const void * GetNextValueInSplayTree (SplayTreeInfo *splay_tree)
 
WizardExport const void * GetValueFromSplayTree (SplayTreeInfo *splay_tree, const void *key)
 
WizardExport size_t GetNumberOfNodesInSplayTree (const SplayTreeInfo *splay_tree)
 
WizardExport SplayTreeInfoNewSplayTree (int(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *))
 
WizardExport void * RemoveNodeByValueFromSplayTree (SplayTreeInfo *splay_tree, const void *value)
 
WizardExport void * RemoveNodeFromSplayTree (SplayTreeInfo *splay_tree, const void *key)
 
WizardExport void ResetSplayTree (SplayTreeInfo *splay_tree)
 
WizardExport void ResetSplayTreeIterator (SplayTreeInfo *splay_tree)
 
static NodeInfoSplay (SplayTreeInfo *splay_tree, const size_t depth, const void *key, NodeInfo **node, NodeInfo **parent, NodeInfo **grandparent)
 

Macro Definition Documentation

◆ MaxSplayTreeDepth

#define MaxSplayTreeDepth   1024

Definition at line 63 of file splay-tree.c.

Typedef Documentation

◆ NodeInfo

typedef struct _NodeInfo NodeInfo

Function Documentation

◆ AddValueToSplayTree()

◆ BalanceSplayTree()

◆ CloneSplayTree()

◆ CompareSplayTreeString()

WizardExport int CompareSplayTreeString ( const void *  target,
const void *  source 
)

Definition at line 410 of file splay-tree.c.

References LocaleCompare().

Referenced by AcquireLocaleSplayTree(), and AcquireUniqueFileResource().

◆ CompareSplayTreeStringInfo()

WizardExport int CompareSplayTreeStringInfo ( const void *  target,
const void *  source 
)

Definition at line 446 of file splay-tree.c.

References CompareStringInfo().

Referenced by AcquireKeyInfo().

◆ DeleteNodeByValueFromSplayTree()

◆ DeleteNodeFromSplayTree()

◆ DestroySplayTree()

◆ GetFirstSplayTreeNode()

static void * GetFirstSplayTreeNode ( SplayTreeInfo splay_tree)
inlinestatic

◆ GetNextKeyInSplayTree()

◆ GetNextValueInSplayTree()

◆ GetNumberOfNodesInSplayTree()

◆ GetValueFromSplayTree()

◆ IterateOverSplayTree()

static int IterateOverSplayTree ( SplayTreeInfo splay_tree,
int(*)(NodeInfo *, const void *)  method,
const void *  value 
)
static

◆ LinkSplayTreeNodes()

static NodeInfo * LinkSplayTreeNodes ( NodeInfo **  nodes,
const size_t  low,
const size_t  high 
)
static

Definition at line 245 of file splay-tree.c.

References _NodeInfo::left, LinkSplayTreeNodes(), and _NodeInfo::right.

Referenced by BalanceSplayTree(), and LinkSplayTreeNodes().

◆ NewSplayTree()

◆ RemoveNodeByValueFromSplayTree()

◆ RemoveNodeFromSplayTree()

◆ ResetSplayTree()

◆ ResetSplayTreeIterator()

◆ Splay()

static NodeInfo * Splay ( SplayTreeInfo splay_tree,
const size_t  depth,
const void *  key,
NodeInfo **  node,
NodeInfo **  parent,
NodeInfo **  grandparent 
)
static

◆ SplaySplayTree()

◆ SplayTreeToNodeArray()

static int SplayTreeToNodeArray ( NodeInfo node,
const void *  nodes 
)
inlinestatic

Definition at line 267 of file splay-tree.c.

Referenced by BalanceSplayTree().