aboutsummaryrefslogtreecommitdiff
path: root/shared/hammer/tree.h
diff options
context:
space:
mode:
authorN.N. <krzyszcz@users.sourceforge.net>2003-05-23 12:29:55 +0000
committerN.N. <krzyszcz@users.sourceforge.net>2003-05-23 12:29:55 +0000
commitfaada59567f8cb252f4a909116595ce309ff5828 (patch)
tree5874954c6f2d5392d921208e49a45ef266beeb7f /shared/hammer/tree.h
This commit was generated by cvs2svn to compensate for changes in r647,svn2git-root
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/miXed/; revision=648
Diffstat (limited to 'shared/hammer/tree.h')
-rw-r--r--shared/hammer/tree.h37
1 files changed, 37 insertions, 0 deletions
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