tree.h File Reference


Detailed Description

A tree container.

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file tree.h.

Go to the source code of this file.

Functions

void * av_tree_find (const struct AVTreeNode *root, void *key, int(*cmp)(void *key, const void *b), void *next[2])
 Finds an element.
void * av_tree_insert (struct AVTreeNode **rootp, void *key, int(*cmp)(void *key, const void *b))
 Finds a element for which cmp(key, elem)==0, if no such element is found key is inserted into the tree.
void av_tree_destroy (struct AVTreeNode *t)


Function Documentation

void* av_tree_find ( const struct AVTreeNode root,
void *  key,
int(*)(void *key, const void *b cmp,
void *  next[2] 
)

Finds an element.

Parameters:
root a pointer to the root node of the tree
next If next is not NULL then next[0] will contain the previous element and next[1] the next element if either does not exist then the corresponding entry in next is unchanged.
Returns:
An element with cmp(key, elem)==0 or NULL if no such element exists in the tree.

void* av_tree_insert ( struct AVTreeNode **  rootp,
void *  key,
int(*)(void *key, const void *b cmp 
)

Finds a element for which cmp(key, elem)==0, if no such element is found key is inserted into the tree.

Parameters:
rootp A pointer to a pointer to the root node of the tree. Note that the root node can change during insertions, this is required to keep the tree balanced.
Returns:
If no insertion happened, the found element. If an insertion happened, then either key or NULL will be returned. Which one it is depends on the tree state and the implementation. You should make no assumptions that it's one or the other in the code.

Definition at line 44 of file tree.c.

Referenced by av_tree_insert(), ff_nut_add_sp(), and main().

void av_tree_destroy ( struct AVTreeNode t  ) 

Definition at line 88 of file tree.c.

Referenced by av_tree_destroy().


Generated on Sat Dec 18 05:15:56 2010 for MythTV by  doxygen 1.5.5