opdis/tree.c File Reference

Binary (AVL) tree implementation. More...

#include <stdlib.h>
#include <opdis/tree.h>

Functions

opdis_tree_t LIBCALL opdis_tree_init (OPDIS_TREE_KEY_FN key_fn, OPDIS_TREE_CMP_FN cmp_fn, OPDIS_TREE_FREE_FN free_fn)
 Allocate and initialize for an AVL tree.
int LIBCALL opdis_tree_add (opdis_tree_t tree, void *data)
 Insert a node into the tree.
int LIBCALL opdis_tree_update (opdis_tree_t tree, void *data)
 Insert or overwrite a node in the tree.
int LIBCALL opdis_tree_delete (opdis_tree_t tree, void *key)
 Remove an item from the tree.
int LIBCALL opdis_tree_contains (opdis_tree_t tree, void *key)
 Determine if tree contains data.
void *LIBCALL opdis_tree_find (opdis_tree_t tree, void *key)
 Find data in a tree.
void * opdis_tree_closest (opdis_tree_t tree, void *key)
 Find closest match to data in a tree. This returns the item that matches the key, or the item that is closest to (but less than) the key, or NULL if there is no item less than or equal to the key.
void * opdis_tree_next (opdis_tree_t tree, void *key)
 Find the data succeeding the key in a tree. This returns the item that occurs immediately after key in the tree, or immediately after where key would be if it were in the tree. If there are no items greater than key in the tree, this returns NULL.
void LIBCALL opdis_tree_foreach (opdis_tree_t tree, OPDIS_TREE_FOREACH_FN fn, void *arg)
 Iterate over the tree, invoking a callback for each item.
size_t LIBCALL opdis_tree_count (opdis_tree_t tree)
 Return the number of items in the tree.
void LIBCALL opdis_tree_free (opdis_tree_t tree)
 Free an AVL tree.
opdis_vma_tree_t LIBCALL opdis_vma_tree_init (void)
 Allocate an Address Tree.
int LIBCALL opdis_vma_tree_add (opdis_vma_tree_t tree, opdis_vma_t addr)
 Insert an address into the tree.
int LIBCALL opdis_vma_tree_delete (opdis_vma_tree_t tree, opdis_vma_t addr)
 Delete an address from the tree.
int LIBCALL opdis_vma_tree_contains (opdis_vma_tree_t tree, opdis_vma_t addr)
 Determine if an address is in the tree.
opdis_vma_t LIBCALL opdis_vma_tree_find (opdis_vma_tree_t tree, opdis_vma_t addr)
 Find an address in the tree.
void LIBCALL opdis_vma_tree_foreach (opdis_vma_tree_t tree, OPDIS_ADDR_TREE_FOREACH_FN fn, void *arg)
 Invoke a callback for every item in the tree.
void LIBCALL opdis_vma_tree_free (opdis_vma_tree_t tree)
 Free the address tree.
opdis_insn_tree_t LIBCALL opdis_insn_tree_init (int manage)
 Allocate an Instruction Tree.
int LIBCALL opdis_insn_tree_add (opdis_insn_tree_t tree, opdis_insn_t *insn)
 Insert an instruction into the tree.
int LIBCALL opdis_insn_tree_delete (opdis_insn_tree_t tree, opdis_vma_t addr)
 Delete an instruction from the tree.
int LIBCALL opdis_insn_tree_contains (opdis_insn_tree_t tree, opdis_vma_t addr)
 Determine if an instruction is in the tree.
opdis_insn_t *LIBCALL opdis_insn_tree_find (opdis_insn_tree_t tree, opdis_vma_t addr)
 Find an instruction in the tree.
void LIBCALL opdis_insn_tree_foreach (opdis_insn_tree_t tree, OPDIS_INSN_TREE_FOREACH_FN fn, void *arg)
 Invoke a callback for every item in the tree.
void LIBCALL opdis_insn_tree_free (opdis_insn_tree_t tree)
 Free the instruction tree.

Detailed Description

Binary (AVL) tree implementation.

Author:
TG Community Developers <community@thoughtgang.org>
Note:
Copyright (c) 2010 ThoughtGang. Released under the GNU Public License, version 3. See http://www.gnu.org/licenses/gpl.txt for details.

Generated on Wed Mar 10 14:30:45 2010 for Opdis Disassembly Library by  doxygen 1.6.1