diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2004-05-07 01:13:29 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2004-05-07 01:13:29 -0400 |
commit | d326f24d169154673717129098ff4554a673f178 (patch) | |
tree | 7229f817b10bcdb82f8df2b6af3a3acc792a762d /WWW/Library/Implementation/HTBTree.h | |
parent | 2cd8e80bfe2792ce8999a26b34384598f58e3889 (diff) | |
download | lynx-snapshots-d326f24d169154673717129098ff4554a673f178.tar.gz |
snapshot of project "lynx", label v2-8-6dev_3
Diffstat (limited to 'WWW/Library/Implementation/HTBTree.h')
-rw-r--r-- | WWW/Library/Implementation/HTBTree.h | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/WWW/Library/Implementation/HTBTree.h b/WWW/Library/Implementation/HTBTree.h index 0bf10cf7..dc1cbc3e 100644 --- a/WWW/Library/Implementation/HTBTree.h +++ b/WWW/Library/Implementation/HTBTree.h @@ -22,48 +22,41 @@ Data structures */ typedef struct _HTBTree_element { - void *object; /* User object */ - struct _HTBTree_element *up; - struct _HTBTree_element *left; - int left_depth; - struct _HTBTree_element *right; - int right_depth; + void *object; /* User object */ + struct _HTBTree_element *up; + struct _HTBTree_element *left; + int left_depth; + struct _HTBTree_element *right; + int right_depth; } HTBTElement; -typedef int (*HTComparer) (void * a, void * b); +typedef int (*HTComparer) (void *a, void *b); typedef struct _HTBTree_top { - HTComparer compare; - struct _HTBTree_element *top; + HTComparer compare; + struct _HTBTree_element *top; } HTBTree; - /* Create a binary tree given its discrimination routine */ -extern HTBTree * HTBTree_new (HTComparer comp); - - +extern HTBTree *HTBTree_new(HTComparer comp); /* Free storage of the tree but not of the objects */ -extern void HTBTree_free (HTBTree* tree); - - +extern void HTBTree_free(HTBTree *tree); /* Free storage of the tree and of the objects */ -extern void HTBTreeAndObject_free (HTBTree* tree); - - +extern void HTBTreeAndObject_free(HTBTree *tree); /* @@ -71,8 +64,7 @@ Add an object to a binary tree */ -extern void HTBTree_add (HTBTree* tree, void * object); - +extern void HTBTree_add(HTBTree *tree, void *object); /* @@ -81,8 +73,7 @@ Search an object in a binary tree returns Pointer to equivalent object in a tree or NULL if none. */ -extern void * HTBTree_search (HTBTree* tree, void * object); - +extern void *HTBTree_search(HTBTree *tree, void *object); /* @@ -91,7 +82,6 @@ Find user object for element */ #define HTBTree_object(element) ((element)->object) - /* Find next element in depth-first order @@ -104,6 +94,6 @@ Find next element in depth-first order returns Pointer to element or NULL if none left. */ -extern HTBTElement * HTBTree_next (HTBTree* tree, HTBTElement * ele); +extern HTBTElement *HTBTree_next(HTBTree *tree, HTBTElement *ele); #endif /* HTBTREE_H */ |