GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
tavl.h File Reference
#include <stddef.h>
Include dependency graph for tavl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  libavl_allocator
 
struct  tavl_table
 
struct  tavl_node
 
struct  tavl_traverser
 

Macros

#define LIBAVL_ALLOCATOR
 
#define TAVL_MAX_HEIGHT   92
 
#define tavl_count(table)   ((size_t)(table)->tavl_count)
 

Typedefs

typedef int tavl_comparison_func(const void *tavl_a, const void *tavl_b, void *tavl_param)
 
typedef void tavl_item_func(void *tavl_item, void *tavl_param)
 
typedef void * tavl_copy_func(void *tavl_item, void *tavl_param)
 

Enumerations

enum  tavl_tag { TAVL_CHILD , TAVL_THREAD }
 

Functions

void * tavl_malloc (struct libavl_allocator *, size_t)
 
void tavl_free (struct libavl_allocator *, void *)
 
struct tavl_tabletavl_create (tavl_comparison_func *, void *, struct libavl_allocator *)
 
struct tavl_tabletavl_copy (const struct tavl_table *, tavl_copy_func *, tavl_item_func *, struct libavl_allocator *)
 
void tavl_destroy (struct tavl_table *, tavl_item_func *)
 
void ** tavl_probe (struct tavl_table *, void *)
 
void * tavl_insert (struct tavl_table *, void *)
 
void * tavl_replace (struct tavl_table *, void *)
 
void * tavl_delete (struct tavl_table *, const void *)
 
void * tavl_find (const struct tavl_table *, const void *)
 
void tavl_assert_insert (struct tavl_table *, void *)
 
void * tavl_assert_delete (struct tavl_table *, void *)
 
void tavl_t_init (struct tavl_traverser *, struct tavl_table *)
 
void * tavl_t_first (struct tavl_traverser *, struct tavl_table *)
 
void * tavl_t_last (struct tavl_traverser *, struct tavl_table *)
 
void * tavl_t_find (struct tavl_traverser *, struct tavl_table *, void *)
 
void * tavl_t_insert (struct tavl_traverser *, struct tavl_table *, void *)
 
void * tavl_t_copy (struct tavl_traverser *, const struct tavl_traverser *)
 
void * tavl_t_next (struct tavl_traverser *)
 
void * tavl_t_prev (struct tavl_traverser *)
 
void * tavl_t_cur (struct tavl_traverser *)
 
void * tavl_t_replace (struct tavl_traverser *, void *)
 

Variables

struct libavl_allocator tavl_allocator_default
 

Macro Definition Documentation

◆ LIBAVL_ALLOCATOR

#define LIBAVL_ALLOCATOR

Definition at line 35 of file tavl.h.

◆ tavl_count

#define tavl_count (   table)    ((size_t)(table)->tavl_count)

Definition at line 96 of file tavl.h.

◆ TAVL_MAX_HEIGHT

#define TAVL_MAX_HEIGHT   92

Definition at line 50 of file tavl.h.

Typedef Documentation

◆ tavl_comparison_func

typedef int tavl_comparison_func(const void *tavl_a, const void *tavl_b, void *tavl_param)

Definition at line 29 of file tavl.h.

◆ tavl_copy_func

typedef void* tavl_copy_func(void *tavl_item, void *tavl_param)

Definition at line 32 of file tavl.h.

◆ tavl_item_func

typedef void tavl_item_func(void *tavl_item, void *tavl_param)

Definition at line 31 of file tavl.h.

Enumeration Type Documentation

◆ tavl_tag

enum tavl_tag
Enumerator
TAVL_CHILD 
TAVL_THREAD 

Definition at line 63 of file tavl.h.

Function Documentation

◆ tavl_assert_delete()

void* tavl_assert_delete ( struct tavl_table table,
void *  item 
)

Definition at line 911 of file tavl.c.

◆ tavl_assert_insert()

void tavl_assert_insert ( struct tavl_table table,
void *  item 
)

Definition at line 902 of file tavl.c.

◆ tavl_copy()

◆ tavl_create()

struct tavl_table* tavl_create ( tavl_comparison_func compare,
void *  param,
struct libavl_allocator allocator 
)

Definition at line 37 of file tavl.c.

Referenced by tavl_copy().

◆ tavl_delete()

void* tavl_delete ( struct tavl_table tree,
const void *  item 
)

Definition at line 305 of file tavl.c.

◆ tavl_destroy()

◆ tavl_find()

void* tavl_find ( const struct tavl_table tree,
const void *  item 
)

Definition at line 62 of file tavl.c.

References assert, NULL, and tavl_table::tavl_root.

◆ tavl_free()

void tavl_free ( struct libavl_allocator allocator,
void *  block 
)

Definition at line 889 of file tavl.c.

◆ tavl_insert()

void* tavl_insert ( struct tavl_table table,
void *  item 
)

Definition at line 243 of file tavl.c.

◆ tavl_malloc()

void* tavl_malloc ( struct libavl_allocator allocator,
size_t  size 
)

Definition at line 882 of file tavl.c.

References assert, malloc(), and NULL.

◆ tavl_probe()

void** tavl_probe ( struct tavl_table tree,
void *  item 
)

Definition at line 90 of file tavl.c.

References assert, NULL, TAVL_MAX_HEIGHT, and tavl_table::tavl_root.

Referenced by tavl_t_insert().

◆ tavl_replace()

void* tavl_replace ( struct tavl_table table,
void *  item 
)

Definition at line 254 of file tavl.c.

◆ tavl_t_copy()

void* tavl_t_copy ( struct tavl_traverser trav,
const struct tavl_traverser src 
)

◆ tavl_t_cur()

void* tavl_t_cur ( struct tavl_traverser trav)

Definition at line 709 of file tavl.c.

References assert, NULL, tavl_node::tavl_data, and tavl_traverser::tavl_node.

◆ tavl_t_find()

void* tavl_t_find ( struct tavl_traverser trav,
struct tavl_table tree,
void *  item 
)

◆ tavl_t_first()

void* tavl_t_first ( struct tavl_traverser trav,
struct tavl_table tree 
)

◆ tavl_t_init()

void tavl_t_init ( struct tavl_traverser trav,
struct tavl_table tree 
)

Definition at line 546 of file tavl.c.

References NULL, tavl_traverser::tavl_node, and tavl_traverser::tavl_table.

Referenced by tavl_t_insert().

◆ tavl_t_insert()

void* tavl_t_insert ( struct tavl_traverser trav,
struct tavl_table tree,
void *  item 
)

◆ tavl_t_last()

void* tavl_t_last ( struct tavl_traverser trav,
struct tavl_table tree 
)

◆ tavl_t_next()

◆ tavl_t_prev()

◆ tavl_t_replace()

void* tavl_t_replace ( struct tavl_traverser trav,
void *  new 
)

Definition at line 719 of file tavl.c.

References assert, NULL, tavl_node::tavl_data, and tavl_traverser::tavl_node.

Variable Documentation

◆ tavl_allocator_default

struct libavl_allocator tavl_allocator_default
extern

Definition at line 889 of file tavl.c.