libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
clod_tree Struct Reference

#include <tree.h>

Public Attributes

struct clod_tree_noderoot
 Pointer to the root node.
unsigned char key_size
 Size of keys in the tree.
unsigned char val_size
 Size of values in the tree.
bool disable_checksum
 Disables the checksum used to validate each node.
unsigned short node_size
 Size of each node in the tree.
void * compare_user
 User variable passed to invocations of compare.
int(* compare )(const void *key1, const void *key2, void *user)
 Comparison function.
clod_allocator allocator

Detailed Description

Configuration options and handle to a tree structure. Must not be modified after creation.

Keys and values are aligned to the maximum of 32 or the largest factor of their sizes, whichever is smaller. E.g. a size of 8 results in an alignment of 8, while 1, 3, or 31 result in no alignment. In addition, values inherit the key's alignment.

The caller always retains ownership of memory passed as keys and values, as the tree implementation always copies to its own memory.

Definition at line 23 of file tree.h.

Member Data Documentation

◆ root

struct clod_tree_node* clod_tree::root

Pointer to the root node.

Definition at line 25 of file tree.h.

◆ key_size

unsigned char clod_tree::key_size

Size of keys in the tree.

Definition at line 28 of file tree.h.

◆ val_size

unsigned char clod_tree::val_size

Size of values in the tree.

Definition at line 31 of file tree.h.

◆ disable_checksum

bool clod_tree::disable_checksum

Disables the checksum used to validate each node.

Definition at line 34 of file tree.h.

◆ node_size

unsigned short clod_tree::node_size

Size of each node in the tree.

Definition at line 37 of file tree.h.

◆ compare_user

void* clod_tree::compare_user

User variable passed to invocations of compare.

Definition at line 40 of file tree.h.

◆ compare

int(* clod_tree::compare) (const void *key1, const void *key2, void *user)

Comparison function.

Definition at line 43 of file tree.h.

◆ allocator

clod_allocator clod_tree::allocator

Allocator used to allocate and free nodes in the tree.

Definition at line 47 of file tree.h.


The documentation for this struct was generated from the following file:
  • include/clod/structures/tree.h