GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
avl.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avl.h"
Include dependency graph for avl.c:

Go to the source code of this file.

Functions

struct avl_tableavl_create (avl_comparison_func *compare, void *param, struct libavl_allocator *allocator)
 
void * avl_find (const struct avl_table *tree, const void *item)
 
void ** avl_probe (struct avl_table *tree, void *item)
 
void * avl_insert (struct avl_table *table, void *item)
 
void * avl_replace (struct avl_table *table, void *item)
 
void * avl_delete (struct avl_table *tree, const void *item)
 
void avl_t_init (struct avl_traverser *trav, struct avl_table *tree)
 
void * avl_t_first (struct avl_traverser *trav, struct avl_table *tree)
 
void * avl_t_last (struct avl_traverser *trav, struct avl_table *tree)
 
void * avl_t_find (struct avl_traverser *trav, struct avl_table *tree, void *item)
 
void * avl_t_insert (struct avl_traverser *trav, struct avl_table *tree, void *item)
 
void * avl_t_copy (struct avl_traverser *trav, const struct avl_traverser *src)
 
void * avl_t_next (struct avl_traverser *trav)
 
void * avl_t_prev (struct avl_traverser *trav)
 
void * avl_t_cur (struct avl_traverser *trav)
 
void * avl_t_replace (struct avl_traverser *trav, void *new)
 
struct avl_tableavl_copy (const struct avl_table *org, avl_copy_func *copy, avl_item_func *destroy, struct libavl_allocator *allocator)
 
void avl_destroy (struct avl_table *tree, avl_item_func *destroy)
 
void * avl_malloc (struct libavl_allocator *allocator, size_t size)
 
void avl_free (struct libavl_allocator *allocator, void *block)
 
void() avl_assert_insert (struct avl_table *table, void *item)
 
void *() avl_assert_delete (struct avl_table *table, void *item)
 

Variables

struct libavl_allocator avl_allocator_default
 

Function Documentation

◆ avl_assert_delete()

void*() avl_assert_delete ( struct avl_table table,
void *  item 
)

Definition at line 850 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 841 of file avl.c.

◆ avl_copy()

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

Definition at line 701 of file avl.c.

References AVL_MAX_HEIGHT.

◆ avl_create()

struct avl_table* avl_create ( avl_comparison_func compare,
void *  param,
struct libavl_allocator allocator 
)

Definition at line 38 of file avl.c.

◆ avl_delete()

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

Definition at line 230 of file avl.c.

References AVL_MAX_HEIGHT.

Referenced by avl_assert_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 
)

Definition at line 64 of file avl.c.

References assert, avl_table::avl_root, and NULL.

◆ avl_free()

void avl_free ( struct libavl_allocator allocator,
void *  block 
)

Definition at line 825 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.

◆ avl_malloc()

void* avl_malloc ( struct libavl_allocator allocator,
size_t  size 
)

Definition at line 817 of file avl.c.

References assert, malloc(), and NULL.

◆ avl_probe()

void** avl_probe ( struct avl_table tree,
void *  item 
)

Definition at line 87 of file avl.c.

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

Referenced by avl_t_insert().

◆ avl_replace()

void* avl_replace ( struct avl_table table,
void *  item 
)

Definition at line 213 of file avl.c.

◆ avl_t_copy()

void* avl_t_copy ( struct avl_traverser trav,
const struct avl_traverser src 
)

Definition at line 546 of file avl.c.

◆ avl_t_cur()

void* avl_t_cur ( struct avl_traverser trav)

Definition at line 657 of file avl.c.

References assert, avl_node::avl_data, avl_traverser::avl_node, and NULL.

◆ avl_t_find()

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

◆ avl_t_first()

◆ avl_t_init()

void avl_t_init ( struct avl_traverser trav,
struct avl_table tree 
)

◆ avl_t_insert()

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

◆ avl_t_last()

◆ avl_t_next()

void* avl_t_next ( struct avl_traverser trav)

◆ avl_t_prev()

void* avl_t_prev ( struct avl_traverser trav)

◆ avl_t_replace()

void* avl_t_replace ( struct avl_traverser trav,
void *  new 
)

Definition at line 667 of file avl.c.

References assert, avl_node::avl_data, avl_traverser::avl_node, and NULL.

Variable Documentation

◆ avl_allocator_default

struct libavl_allocator avl_allocator_default
Initial value:
= {
}
void avl_free(struct libavl_allocator *allocator, void *block)
Definition: avl.c:825
void * avl_malloc(struct libavl_allocator *allocator, size_t size)
Definition: avl.c:817

Definition at line 832 of file avl.c.