~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_tree.h

  • Committer: Monty Taylor
  • Date: 2009-10-06 19:14:39 UTC
  • mfrom: (1130.2.18 plugin-base-class)
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20091006191439-fd1vvlp22654l3k3
Merged latest plugin-base-class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
typedef struct st_tree {
53
53
  TREE_ELEMENT *root,null_element;
54
54
  TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
55
 
  uint32_t offset_to_key,elements_in_tree,size_of_element;
56
 
  uint32_t memory_limit, allocated;
 
55
  uint32_t offset_to_key, elements_in_tree, size_of_element;
 
56
  size_t memory_limit;
 
57
  size_t allocated;
57
58
  qsort_cmp2 compare;
58
59
  void *custom_arg;
59
60
  MEM_ROOT mem_root;
62
63
  uint32_t flag;
63
64
} TREE;
64
65
 
65
 
        /* Functions on whole tree */
 
66
/* Functions on whole tree */
66
67
void init_tree(TREE *tree, uint32_t default_alloc_size, uint32_t memory_limit,
67
 
               int size, qsort_cmp2 compare, bool with_delete,
 
68
               uint32_t size, qsort_cmp2 compare, bool with_delete,
68
69
               tree_element_free free_element, void *custom_arg);
69
70
void delete_tree(TREE*);
70
71
void reset_tree(TREE*);
71
 
  /* similar to delete tree, except we do not free() blocks in mem_root
72
 
   */
 
72
 
 
73
/* 
 
74
  similar to delete tree, except we do not free() blocks in mem_root
 
75
*/
73
76
#define is_tree_inited(tree) ((tree)->root != 0)
74
77
 
75
 
        /* Functions on leafs */
 
78
/* Functions on leafs */
76
79
TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint32_t key_size,
77
80
                          void *custom_arg);
78
81
void *tree_search(TREE *tree, void *key, void *custom_arg);
87
90
void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs,
88
91
                       int r_offs);
89
92
ha_rows tree_record_pos(TREE *tree, const void *key,
90
 
                     enum ha_rkey_function search_flag, void *custom_arg);
 
93
                        enum ha_rkey_function search_flag, void *custom_arg);
91
94
 
92
95
#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*))
93
96