2.4.4.1 Setup — Zix 0.4.2 documentation

# 2.4.4.1 Setup

typedef struct ZixTreeImpl ZixTree

  A balanced binary search tree.

typedef int (*ZixTreeCompareFunc)(const void *a, const void *b, const void *user_data)

  Function for comparing two Tree elements.

typedef void (*ZixTreeDestroyFunc)(void *ptr, const void *user_data)

  Function to destroy a Tree element.

ZixTree *zix_tree_new(ZixAllocator *allocator, bool allow_duplicates, ZixTreeCompareFunc cmp, void *cmp_data, ZixTreeDestroyFunc destroy, const void *destroy_user_data)

  Create a new (empty) tree.

void zix_tree_free(ZixTree *t)

  Free `t`

size_t zix_tree_size(const ZixTree *t)

  Return the number of elements in `t`