From faada59567f8cb252f4a909116595ce309ff5828 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Fri, 23 May 2003 12:29:55 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r647, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/miXed/; revision=648 --- shared/hammer/tree.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 shared/hammer/tree.h (limited to 'shared/hammer/tree.h') diff --git a/shared/hammer/tree.h b/shared/hammer/tree.h new file mode 100644 index 0000000..fcbc036 --- /dev/null +++ b/shared/hammer/tree.h @@ -0,0 +1,37 @@ +/* Copyright (c) 2003 krzYszcz and others. + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +#ifndef __HAMMERTREE_H__ +#define __HAMMERTREE_H__ + +#define HAMMERTREE_DEBUG + +typedef struct _hammernode +{ + int n_index; + float n_value; + int n_black; + struct _hammernode *n_left; + struct _hammernode *n_right; + struct _hammernode *n_parent; + struct _hammernode *n_prev; + struct _hammernode *n_next; +} t_hammernode; + +typedef struct _hammertree +{ + t_hammernode *t_root; + t_hammernode *t_first; + t_hammernode *t_last; +} t_hammertree; + +t_hammernode *hammertree_insert(t_hammertree *tree, int ndx); +void hammertree_delete(t_hammertree *tree, t_hammernode *np); +t_hammernode *hammertree_search(t_hammertree *tree, int ndx); +t_hammernode *hammertree_closest(t_hammertree *tree, int ndx, int geqflag); +void hammertree_init(t_hammertree *tree, int freecount); +void hammertree_clear(t_hammertree *tree, int freecount); +void hammertree_debug(t_hammertree *tree, int level); + +#endif -- cgit v1.2.1