GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
tavl.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "tavl.h"
Include dependency graph for tavl.c:

Go to the source code of this file.

Functions

struct tavl_tabletavl_create (tavl_comparison_func *compare, void *param, struct libavl_allocator *allocator)
 
voidtavl_find (const struct tavl_table *tree, const void *item)
 
void ** tavl_probe (struct tavl_table *tree, void *item)
 
voidtavl_insert (struct tavl_table *table, void *item)
 
voidtavl_replace (struct tavl_table *table, void *item)
 
voidtavl_delete (struct tavl_table *tree, const void *item)
 
void tavl_t_init (struct tavl_traverser *trav, struct tavl_table *tree)
 
voidtavl_t_first (struct tavl_traverser *trav, struct tavl_table *tree)
 
voidtavl_t_last (struct tavl_traverser *trav, struct tavl_table *tree)
 
voidtavl_t_find (struct tavl_traverser *trav, struct tavl_table *tree, void *item)
 
voidtavl_t_insert (struct tavl_traverser *trav, struct tavl_table *tree, void *item)
 
voidtavl_t_copy (struct tavl_traverser *trav, const struct tavl_traverser *src)
 
voidtavl_t_next (struct tavl_traverser *trav)
 
voidtavl_t_prev (struct tavl_traverser *trav)
 
voidtavl_t_cur (struct tavl_traverser *trav)
 
voidtavl_t_replace (struct tavl_traverser *trav, void *new)
 
struct tavl_tabletavl_copy (const struct tavl_table *org, tavl_copy_func *copy, tavl_item_func *destroy, struct libavl_allocator *allocator)
 
void tavl_destroy (struct tavl_table *tree, tavl_item_func *destroy)
 
voidtavl_malloc (struct libavl_allocator *allocator, size_t size)
 
void tavl_free (struct libavl_allocator *allocator, void *block)
 
void() tavl_assert_insert (struct tavl_table *table, void *item)
 
void *() tavl_assert_delete (struct tavl_table *table, void *item)
 

Variables

struct libavl_allocator tavl_allocator_default = {tavl_malloc, tavl_free}
 

Function Documentation

◆ tavl_assert_delete()

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

Definition at line 911 of file tavl.c.

References assert, NULL, and tavl_delete().

◆ tavl_assert_insert()

void() tavl_assert_insert ( struct tavl_table table,
void item 
)

Definition at line 902 of file tavl.c.

References assert, NULL, and tavl_probe().

◆ tavl_copy()

struct tavl_table * tavl_copy ( const struct tavl_table org,
tavl_copy_func copy,
tavl_item_func destroy,
struct libavl_allocator allocator 
)

◆ tavl_create()

◆ tavl_delete()

◆ tavl_destroy()

◆ tavl_find()

◆ tavl_free()

void tavl_free ( struct libavl_allocator allocator,
void block 
)

Definition at line 889 of file tavl.c.

References assert, free(), and NULL.

◆ tavl_insert()

void * tavl_insert ( struct tavl_table table,
void item 
)

Definition at line 243 of file tavl.c.

References NULL, and tavl_probe().

◆ 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()

◆ tavl_replace()

void * tavl_replace ( struct tavl_table table,
void item 
)

Definition at line 254 of file tavl.c.

References NULL, r, and tavl_probe().

◆ tavl_t_copy()

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

Definition at line 656 of file tavl.c.

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

◆ tavl_t_cur()

void * tavl_t_cur ( struct tavl_traverser trav)

Definition at line 709 of file tavl.c.

References assert, and NULL.

◆ tavl_t_find()

◆ tavl_t_first()

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

Definition at line 555 of file tavl.c.

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

Referenced by tavl_t_next().

◆ 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.

Referenced by tavl_t_insert().

◆ tavl_t_insert()

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

Definition at line 633 of file tavl.c.

References assert, NULL, tavl_node::tavl_data, tavl_probe(), and tavl_t_init().

◆ tavl_t_last()

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

Definition at line 573 of file tavl.c.

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

Referenced by tavl_t_prev().

◆ tavl_t_next()

void * tavl_t_next ( struct tavl_traverser trav)

Definition at line 669 of file tavl.c.

References assert, NULL, TAVL_CHILD, tavl_t_first(), and TAVL_THREAD.

◆ tavl_t_prev()

void * tavl_t_prev ( struct tavl_traverser trav)

Definition at line 690 of file tavl.c.

References assert, NULL, TAVL_CHILD, tavl_t_last(), and TAVL_THREAD.

◆ tavl_t_replace()

void * tavl_t_replace ( struct tavl_traverser trav,
void new 
)

Definition at line 719 of file tavl.c.

References assert, and NULL.

Variable Documentation

◆ tavl_allocator_default

struct libavl_allocator tavl_allocator_default = {tavl_malloc, tavl_free}

Definition at line 896 of file tavl.c.

Referenced by tavl_create().