GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
avl.h File Reference
#include <stddef.h>
Include dependency graph for avl.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  avl_table
 
struct  avl_node
 
struct  avl_traverser
 

Macros

#define LIBAVL_ALLOCATOR
 
#define AVL_MAX_HEIGHT   92
 
#define avl_count(table)   ((size_t)(table)->avl_count)
 

Typedefs

typedef int avl_comparison_func(const void *avl_a, const void *avl_b, void *avl_param)
 
typedef void avl_item_func(void *avl_item, void *avl_param)
 
typedef voidavl_copy_func(void *avl_item, void *avl_param)
 

Functions

voidavl_malloc (struct libavl_allocator *, size_t)
 
void avl_free (struct libavl_allocator *, void *)
 
struct avl_tableavl_create (avl_comparison_func *, void *, struct libavl_allocator *)
 
struct avl_tableavl_copy (const struct avl_table *, avl_copy_func *, avl_item_func *, struct libavl_allocator *)
 
void avl_destroy (struct avl_table *, avl_item_func *)
 
void ** avl_probe (struct avl_table *, void *)
 
voidavl_insert (struct avl_table *, void *)
 
voidavl_replace (struct avl_table *, void *)
 
voidavl_delete (struct avl_table *, const void *)
 
voidavl_find (const struct avl_table *, const void *)
 
void avl_assert_insert (struct avl_table *, void *)
 
voidavl_assert_delete (struct avl_table *, void *)
 
void avl_t_init (struct avl_traverser *, struct avl_table *)
 
voidavl_t_first (struct avl_traverser *, struct avl_table *)
 
voidavl_t_last (struct avl_traverser *, struct avl_table *)
 
voidavl_t_find (struct avl_traverser *, struct avl_table *, void *)
 
voidavl_t_insert (struct avl_traverser *, struct avl_table *, void *)
 
voidavl_t_copy (struct avl_traverser *, const struct avl_traverser *)
 
voidavl_t_next (struct avl_traverser *)
 
voidavl_t_prev (struct avl_traverser *)
 
voidavl_t_cur (struct avl_traverser *)
 
voidavl_t_replace (struct avl_traverser *, void *)
 

Variables

struct libavl_allocator avl_allocator_default
 

Macro Definition Documentation

◆ avl_count

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

Definition at line 94 of file avl.h.

◆ AVL_MAX_HEIGHT

#define AVL_MAX_HEIGHT   92

Definition at line 50 of file avl.h.

◆ LIBAVL_ALLOCATOR

#define LIBAVL_ALLOCATOR

Definition at line 35 of file avl.h.

Typedef Documentation

◆ avl_comparison_func

typedef int avl_comparison_func(const void *avl_a, const void *avl_b, void *avl_param)

Definition at line 29 of file avl.h.

◆ avl_copy_func

typedef void * avl_copy_func(void *avl_item, void *avl_param)

Definition at line 32 of file avl.h.

◆ avl_item_func

typedef void avl_item_func(void *avl_item, void *avl_param)

Definition at line 31 of file avl.h.

Function Documentation

◆ avl_assert_delete()

void * avl_assert_delete ( struct avl_table table,
void item 
)

Definition at line 842 of file avl.c.

References assert, avl_delete, and NULL.

◆ avl_assert_insert()

void avl_assert_insert ( struct avl_table table,
void item 
)

Definition at line 833 of file avl.c.

References assert, avl_probe, and NULL.

◆ avl_copy()

struct avl_table * avl_copy ( const struct avl_table org,
avl_copy_func copy,
avl_item_func destroy,
struct libavl_allocator allocator 
)

◆ avl_create()

◆ avl_delete()

◆ avl_destroy()

void avl_destroy ( struct avl_table tree,
avl_item_func destroy 
)

◆ avl_find()

void * avl_find ( const struct avl_table tree,
const void item 
)

◆ avl_free()

void avl_free ( struct libavl_allocator allocator,
void block 
)

Definition at line 820 of file avl.c.

References assert, free(), and NULL.

◆ avl_insert()

void * avl_insert ( struct avl_table table,
void item 
)

Definition at line 202 of file avl.c.

References avl_probe, and NULL.

◆ avl_malloc()

void * avl_malloc ( struct libavl_allocator allocator,
size_t  size 
)

Definition at line 812 of file avl.c.

References assert, malloc(), and NULL.

◆ avl_probe()

◆ avl_replace()

void * avl_replace ( struct avl_table table,
void item 
)

Definition at line 213 of file avl.c.

References avl_probe, NULL, and r.

◆ avl_t_copy()

◆ avl_t_cur()

void * avl_t_cur ( struct avl_traverser trav)

Definition at line 655 of file avl.c.

References assert, and NULL.

◆ avl_t_find()

◆ avl_t_first()

void * avl_t_first ( struct avl_traverser trav,
struct avl_table tree 
)

Definition at line 432 of file avl.c.

References assert, avl_table::avl_generation, AVL_MAX_HEIGHT, avl_table::avl_root, NULL, and x.

◆ avl_t_init()

void avl_t_init ( struct avl_traverser trav,
struct avl_table tree 
)

Definition at line 421 of file avl.c.

References avl_table::avl_generation, and NULL.

◆ avl_t_insert()

void * avl_t_insert ( struct avl_traverser trav,
struct avl_table tree,
void item 
)

Definition at line 520 of file avl.c.

References assert, avl_node::avl_data, avl_table::avl_generation, avl_probe, avl_t_init, and NULL.

◆ avl_t_last()

void * avl_t_last ( struct avl_traverser trav,
struct avl_table tree 
)

Definition at line 457 of file avl.c.

References assert, avl_table::avl_generation, AVL_MAX_HEIGHT, avl_table::avl_root, NULL, and x.

◆ avl_t_next()

void * avl_t_next ( struct avl_traverser trav)

Definition at line 567 of file avl.c.

References assert, AVL_MAX_HEIGHT, avl_t_first, NULL, and x.

◆ avl_t_prev()

void * avl_t_prev ( struct avl_traverser trav)

Definition at line 612 of file avl.c.

References assert, AVL_MAX_HEIGHT, avl_t_last, NULL, and x.

◆ avl_t_replace()

void * avl_t_replace ( struct avl_traverser trav,
void new 
)

Definition at line 665 of file avl.c.

References assert, and NULL.

Variable Documentation

◆ avl_allocator_default

struct libavl_allocator avl_allocator_default
extern

Definition at line 827 of file avl.c.

Referenced by avl_create().