Creating a TBST - GNU libavl 2.0.2
Author: Ben Pfaff

7.4 Creation |

Function tbst_create() is the same as bst_create() except that a struct tbst_table has no generation number to fill in.

    252. <TBST creation function 252> =
    struct tbst_table *
    tbst_create (tbst_comparison_func *compare, void *param,
                struct libavl_allocator *allocator)
    {
      struct tbst_table *tree;

      assert (compare != NULL);

      if (allocator == NULL)
        allocator = &tbst_allocator_default;

      tree = allocator->libavl_malloc (allocator, sizeof *tree);
      if (tree == NULL)
        return NULL;

      tree->tbst_root = NULL;
      tree->tbst_compare = compare;
      tree->tbst_param = param;
      tree->tbst_alloc = allocator;
      tree->tbst_count = 0;

      return tree;
    }

This code is included in 251, 300, 336, 375, 418, 455, 489, 522, and 554.