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

Go to the source code of this file.

Data Structures

struct  sp_node
 
struct  sp_tree
 
struct  sp_itor
 

Typedefs

typedef struct sp_node sp_node
 

Functions

sp_treesp_tree_new (dict_compare_func cmp_func)
 
dictsp_dict_new (dict_compare_func cmp_func)
 
size_t sp_tree_free (sp_tree *tree, dict_delete_func delete_func)
 
size_t sp_tree_clear (sp_tree *tree, dict_delete_func delete_func)
 
dict_insert_result sp_tree_insert (sp_tree *tree, void *key)
 
void ** sp_tree_search (sp_tree *tree, const void *key)
 
void ** sp_tree_search_le (sp_tree *tree, const void *key)
 
void ** sp_tree_search_lt (sp_tree *tree, const void *key)
 
void ** sp_tree_search_ge (sp_tree *tree, const void *key)
 
void ** sp_tree_search_gt (sp_tree *tree, const void *key)
 
dict_remove_result sp_tree_remove (sp_tree *tree, const void *key)
 
size_t sp_tree_traverse (sp_tree *tree, dict_visit_func visit, void *user_data)
 
bool sp_tree_select (sp_tree *tree, size_t n, const void **key, void **datum)
 
size_t sp_tree_count (const sp_tree *tree)
 
size_t sp_tree_min_path_length (const sp_tree *tree)
 
size_t sp_tree_max_path_length (const sp_tree *tree)
 
size_t sp_tree_total_path_length (const sp_tree *tree)
 
bool sp_tree_verify (const sp_tree *tree)
 
sp_itorsp_itor_new (sp_tree *tree)
 
dict_itorsp_dict_itor_new (sp_tree *tree)
 
void sp_itor_free (sp_itor *itor)
 
bool sp_itor_valid (const sp_itor *itor)
 
void sp_itor_invalidate (sp_itor *itor)
 
bool sp_itor_next (sp_itor *itor)
 
bool sp_itor_prev (sp_itor *itor)
 
bool sp_itor_nextn (sp_itor *itor, size_t count)
 
bool sp_itor_prevn (sp_itor *itor, size_t count)
 
bool sp_itor_first (sp_itor *itor)
 
bool sp_itor_last (sp_itor *itor)
 
bool sp_itor_search (sp_itor *itor, const void *key)
 
bool sp_itor_search_le (sp_itor *itor, const void *key)
 
bool sp_itor_search_lt (sp_itor *itor, const void *key)
 
bool sp_itor_search_ge (sp_itor *itor, const void *key)
 
bool sp_itor_search_gt (sp_itor *itor, const void *key)
 
const void * sp_itor_key (const sp_itor *itor)
 
void ** sp_itor_datum (sp_itor *itor)
 
int sp_itor_compare (const sp_itor *i1, const sp_itor *i2)
 
bool sp_itor_remove (sp_itor *itor)
 

Typedef Documentation

◆ sp_node

typedef struct sp_node sp_node

Definition at line 53 of file sp_tree.c.

Function Documentation

◆ sp_dict_itor_new()

dict_itor * sp_dict_itor_new ( sp_tree * tree)

Definition at line 454 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_dict_new()

dict * sp_dict_new ( dict_compare_func cmp_func)

Definition at line 124 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_compare()

int sp_itor_compare ( const sp_itor * i1,
const sp_itor * i2 )

Definition at line 486 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_datum()

void ** sp_itor_datum ( sp_itor * itor)

Definition at line 483 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_first()

bool sp_itor_first ( sp_itor * itor)

Definition at line 474 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_free()

void sp_itor_free ( sp_itor * itor)

Definition at line 467 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_invalidate()

void sp_itor_invalidate ( sp_itor * itor)

Definition at line 469 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_key()

const void * sp_itor_key ( const sp_itor * itor)

Definition at line 482 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_last()

bool sp_itor_last ( sp_itor * itor)

Definition at line 475 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_new()

sp_itor * sp_itor_new ( sp_tree * tree)

Definition at line 443 of file sp_tree.c.

◆ sp_itor_next()

bool sp_itor_next ( sp_itor * itor)

Definition at line 470 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_nextn()

bool sp_itor_nextn ( sp_itor * itor,
size_t count )

Definition at line 472 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_prev()

bool sp_itor_prev ( sp_itor * itor)

Definition at line 471 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_prevn()

bool sp_itor_prevn ( sp_itor * itor,
size_t count )

Definition at line 473 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_remove()

bool sp_itor_remove ( sp_itor * itor)

Definition at line 492 of file sp_tree.c.

◆ sp_itor_search()

bool sp_itor_search ( sp_itor * itor,
const void * key )

Definition at line 477 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_search_ge()

bool sp_itor_search_ge ( sp_itor * itor,
const void * key )

Definition at line 480 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_search_gt()

bool sp_itor_search_gt ( sp_itor * itor,
const void * key )

Definition at line 481 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_search_le()

bool sp_itor_search_le ( sp_itor * itor,
const void * key )

Definition at line 478 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_search_lt()

bool sp_itor_search_lt ( sp_itor * itor,
const void * key )

Definition at line 479 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_itor_valid()

bool sp_itor_valid ( const sp_itor * itor)

Definition at line 468 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_clear()

size_t sp_tree_clear ( sp_tree * tree,
dict_delete_func delete_func )

Definition at line 138 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_count()

size_t sp_tree_count ( const sp_tree * tree)

Definition at line 387 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_free()

size_t sp_tree_free ( sp_tree * tree,
dict_delete_func delete_func )

Definition at line 137 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_insert()

dict_insert_result sp_tree_insert ( sp_tree * tree,
void * key )

Definition at line 244 of file sp_tree.c.

◆ sp_tree_max_path_length()

size_t sp_tree_max_path_length ( const sp_tree * tree)

Definition at line 389 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_min_path_length()

size_t sp_tree_min_path_length ( const sp_tree * tree)

Definition at line 388 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_new()

sp_tree * sp_tree_new ( dict_compare_func cmp_func)

Definition at line 109 of file sp_tree.c.

◆ sp_tree_remove()

dict_remove_result sp_tree_remove ( sp_tree * tree,
const void * key )

Definition at line 375 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_search()

void ** sp_tree_search ( sp_tree * tree,
const void * key )

Definition at line 280 of file sp_tree.c.

◆ sp_tree_search_ge()

void ** sp_tree_search_ge ( sp_tree * tree,
const void * key )

Definition at line 326 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_search_gt()

void ** sp_tree_search_gt ( sp_tree * tree,
const void * key )

Definition at line 338 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_search_le()

void ** sp_tree_search_le ( sp_tree * tree,
const void * key )

Definition at line 302 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_search_lt()

void ** sp_tree_search_lt ( sp_tree * tree,
const void * key )

Definition at line 314 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_select()

bool sp_tree_select ( sp_tree * tree,
size_t n,
const void ** key,
void ** datum )

Definition at line 386 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_total_path_length()

size_t sp_tree_total_path_length ( const sp_tree * tree)

Definition at line 390 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_traverse()

size_t sp_tree_traverse ( sp_tree * tree,
dict_visit_func visit,
void * user_data )

Definition at line 385 of file sp_tree.c.

Here is the call graph for this function:

◆ sp_tree_verify()

bool sp_tree_verify ( const sp_tree * tree)

Definition at line 432 of file sp_tree.c.