www.delorie.com/gnu/docs/avl/libavl_133.html   search  
 
Buy GNU books!


GNU libavl 2.0.1

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4 Creation

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

 
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-&#62;libavl_malloc (allocator, sizeof *tree); if (tree == NULL) return NULL; tree-&#62;tbst_root = NULL; tree-&#62;tbst_compare = compare; tree-&#62;tbst_param = param; tree-&#62;tbst_alloc = allocator; tree-&#62;tbst_count = 0; return tree; }
This code is included in @refalso{251


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003