libdict
Data Structure C Library
Loading...
Searching...
No Matches
tr_tree.c File Reference
#include "tr_tree.h"
#include <limits.h>
#include "dict_private.h"
#include "tree_common.h"
Include dependency graph for tr_tree.c:

Go to the source code of this file.

Data Structures

struct  tr_node
 
struct  tr_tree
 
struct  tr_itor
 

Typedefs

typedef struct tr_node tr_node
 

Functions

tr_treetr_tree_new (dict_compare_func cmp_func, dict_prio_func prio_func)
 
dicttr_dict_new (dict_compare_func cmp_func, dict_prio_func prio_func)
 
size_t tr_tree_free (tr_tree *tree, dict_delete_func delete_func)
 
size_t tr_tree_clear (tr_tree *tree, dict_delete_func delete_func)
 
dict_insert_result tr_tree_insert (tr_tree *tree, void *key)
 
dict_remove_result tr_tree_remove (tr_tree *tree, const void *key)
 
void ** tr_tree_search (tr_tree *tree, const void *key)
 
void ** tr_tree_search_le (tr_tree *tree, const void *key)
 
void ** tr_tree_search_lt (tr_tree *tree, const void *key)
 
void ** tr_tree_search_ge (tr_tree *tree, const void *key)
 
void ** tr_tree_search_gt (tr_tree *tree, const void *key)
 
size_t tr_tree_traverse (tr_tree *tree, dict_visit_func visit, void *user_data)
 
bool tr_tree_select (tr_tree *tree, size_t n, const void **key, void **datum)
 
size_t tr_tree_count (const tr_tree *tree)
 
size_t tr_tree_min_path_length (const tr_tree *tree)
 
size_t tr_tree_max_path_length (const tr_tree *tree)
 
size_t tr_tree_total_path_length (const tr_tree *tree)
 
bool tr_tree_verify (const tr_tree *tree)
 
tr_itortr_itor_new (tr_tree *tree)
 
dict_itortr_dict_itor_new (tr_tree *tree)
 
void tr_itor_free (tr_itor *itor)
 
bool tr_itor_valid (const tr_itor *itor)
 
void tr_itor_invalidate (tr_itor *itor)
 
bool tr_itor_next (tr_itor *itor)
 
bool tr_itor_prev (tr_itor *itor)
 
bool tr_itor_nextn (tr_itor *itor, size_t count)
 
bool tr_itor_prevn (tr_itor *itor, size_t count)
 
bool tr_itor_first (tr_itor *itor)
 
bool tr_itor_last (tr_itor *itor)
 
bool tr_itor_search (tr_itor *itor, const void *key)
 
bool tr_itor_search_le (tr_itor *itor, const void *key)
 
bool tr_itor_search_lt (tr_itor *itor, const void *key)
 
bool tr_itor_search_ge (tr_itor *itor, const void *key)
 
bool tr_itor_search_gt (tr_itor *itor, const void *key)
 
const void * tr_itor_key (const tr_itor *itor)
 
void ** tr_itor_datum (tr_itor *itor)
 
int tr_itor_compare (const tr_itor *i1, const tr_itor *i2)
 
bool tr_itor_remove (tr_itor *it)
 

Typedef Documentation

◆ tr_node

typedef struct tr_node tr_node

Definition at line 49 of file tr_tree.c.

Function Documentation

◆ tr_dict_itor_new()

dict_itor * tr_dict_itor_new ( tr_tree * tree)

Definition at line 293 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_dict_new()

dict * tr_dict_new ( dict_compare_func cmp_func,
dict_prio_func prio_func )

Definition at line 122 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_compare()

int tr_itor_compare ( const tr_itor * i1,
const tr_itor * i2 )

Definition at line 322 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_datum()

void ** tr_itor_datum ( tr_itor * itor)

Definition at line 321 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_first()

bool tr_itor_first ( tr_itor * itor)

Definition at line 313 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_free()

void tr_itor_free ( tr_itor * itor)

Definition at line 306 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_invalidate()

void tr_itor_invalidate ( tr_itor * itor)

Definition at line 308 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_key()

const void * tr_itor_key ( const tr_itor * itor)

Definition at line 320 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_last()

bool tr_itor_last ( tr_itor * itor)

Definition at line 314 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_new()

tr_itor * tr_itor_new ( tr_tree * tree)

Definition at line 282 of file tr_tree.c.

◆ tr_itor_next()

bool tr_itor_next ( tr_itor * itor)

Definition at line 309 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_nextn()

bool tr_itor_nextn ( tr_itor * itor,
size_t count )

Definition at line 311 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_prev()

bool tr_itor_prev ( tr_itor * itor)

Definition at line 310 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_prevn()

bool tr_itor_prevn ( tr_itor * itor,
size_t count )

Definition at line 312 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_remove()

bool tr_itor_remove ( tr_itor * it)

Definition at line 325 of file tr_tree.c.

◆ tr_itor_search()

bool tr_itor_search ( tr_itor * itor,
const void * key )

Definition at line 315 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_search_ge()

bool tr_itor_search_ge ( tr_itor * itor,
const void * key )

Definition at line 318 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_search_gt()

bool tr_itor_search_gt ( tr_itor * itor,
const void * key )

Definition at line 319 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_search_le()

bool tr_itor_search_le ( tr_itor * itor,
const void * key )

Definition at line 316 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_search_lt()

bool tr_itor_search_lt ( tr_itor * itor,
const void * key )

Definition at line 317 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_itor_valid()

bool tr_itor_valid ( const tr_itor * itor)

Definition at line 307 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_clear()

size_t tr_tree_clear ( tr_tree * tree,
dict_delete_func delete_func )

Definition at line 136 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_count()

size_t tr_tree_count ( const tr_tree * tree)

Definition at line 225 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_free()

size_t tr_tree_free ( tr_tree * tree,
dict_delete_func delete_func )

Definition at line 135 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_insert()

dict_insert_result tr_tree_insert ( tr_tree * tree,
void * key )

Definition at line 139 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_max_path_length()

size_t tr_tree_max_path_length ( const tr_tree * tree)

Definition at line 227 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_min_path_length()

size_t tr_tree_min_path_length ( const tr_tree * tree)

Definition at line 226 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_new()

tr_tree * tr_tree_new ( dict_compare_func cmp_func,
dict_prio_func prio_func )

Definition at line 106 of file tr_tree.c.

◆ tr_tree_remove()

dict_remove_result tr_tree_remove ( tr_tree * tree,
const void * key )

Definition at line 208 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_search()

void ** tr_tree_search ( tr_tree * tree,
const void * key )

Definition at line 218 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_search_ge()

void ** tr_tree_search_ge ( tr_tree * tree,
const void * key )

Definition at line 221 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_search_gt()

void ** tr_tree_search_gt ( tr_tree * tree,
const void * key )

Definition at line 222 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_search_le()

void ** tr_tree_search_le ( tr_tree * tree,
const void * key )

Definition at line 219 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_search_lt()

void ** tr_tree_search_lt ( tr_tree * tree,
const void * key )

Definition at line 220 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_select()

bool tr_tree_select ( tr_tree * tree,
size_t n,
const void ** key,
void ** datum )

Definition at line 224 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_total_path_length()

size_t tr_tree_total_path_length ( const tr_tree * tree)

Definition at line 228 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_traverse()

size_t tr_tree_traverse ( tr_tree * tree,
dict_visit_func visit,
void * user_data )

Definition at line 223 of file tr_tree.c.

Here is the call graph for this function:

◆ tr_tree_verify()

bool tr_tree_verify ( const tr_tree * tree)

Definition at line 271 of file tr_tree.c.