ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
avl.h
Go to the documentation of this file.
1/*
2 * Revision Control Information
3 *
4 * $Source: /vol/opua/opua2/sis/sis-1.2/common/src/sis/avl/RCS/avl.h,v $
5 * $Author: sis $
6 * $Revision: 1.3 $
7 * $Date: 1994/07/15 23:00:40 $
8 *
9 */
10#ifndef ABC__misc__avl__avl_h
11#define ABC__misc__avl__avl_h
12
13
15
16
17#define EXTERN
18
19#ifndef ARGS
20#define ARGS(protos) protos
21#endif
22
23#define MAX(a,b) ((a) > (b) ? (a) : (b))
24
25#define NIL(type) \
26 ((type *) 0)
27#define ALLOC(type, num) \
28 ((type *) malloc(sizeof(type) * (num)))
29#define REALLOC(type, obj, num) \
30 ((type *) realloc((char *) obj, sizeof(type) * (num)))
31#define FREE(obj) \
32 free((char *) (obj))
33
34
35
39 char *key;
40 char *value;
41 int height;
42};
43
44
52
53
60
61
62#define AVL_FORWARD 0
63#define AVL_BACKWARD 1
64
65
67EXTERN int avl_delete ARGS((avl_tree *, char **, char **));
68EXTERN int avl_insert ARGS((avl_tree *, char *, char *));
69EXTERN int avl_lookup ARGS((avl_tree *, char *, char **));
70EXTERN int avl_first ARGS((avl_tree *, char **, char **));
71EXTERN int avl_last ARGS((avl_tree *, char **, char **));
72EXTERN int avl_find_or_add ARGS((avl_tree *, char *, char ***));
74EXTERN int avl_numcmp ARGS((char *, char *));
75EXTERN int avl_gen ARGS((avl_generator *, char **, char **));
76EXTERN void avl_foreach ARGS((avl_tree *, void (*)(), int));
77EXTERN void avl_free_table ARGS((avl_tree *, void (*)(), void (*)()));
80
81#define avl_is_member(tree, key) avl_lookup(tree, key, (char **) 0)
82
83#define avl_foreach_item(table, gen, dir, key_p, value_p) \
84 for(gen = avl_init_gen(table, dir); \
85 avl_gen(gen, key_p, value_p) || (avl_free_gen(gen),0);)
86
87
88
90
91#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
avl_insert(avl_tree *tree, char *key, char *value)
Definition avl.c:136
void avl_foreach(avl_tree *tree, void *func, int direction)
Definition avl.c:483
int avl_numcmp(char *x, char *y)
Definition avl.c:553
avl_lookup(avl_tree *tree, char *key, char **value_p)
Definition avl.c:61
avl_gen(avl_generator *gen, char **key_p, char **value_p)
Definition avl.c:314
avl_generator * avl_init_gen(avl_tree *tree, int dir)
Definition avl.c:287
void avl_free_table(avl_tree *tree, void *key_free, void *value_free)
Definition avl.c:519
void avl_free_gen(avl_generator *gen)
Definition avl.c:338
avl_find_or_add(avl_tree *tree, char *key, char ***slot_p)
Definition avl.c:170
avl_delete(avl_tree *tree, char **key_p, char **value_p)
Definition avl.c:207
avl_tree * avl_init_table(int *compar)
Definition avl.c:47
avl_first(avl_tree *tree, char **key_p, char **value_p)
Definition avl.c:85
int avl_count(avl_tree *tree)
Definition avl.c:530
avl_last(avl_tree *tree, char **key_p, char **value_p)
Definition avl.c:111
struct avl_generator_struct avl_generator
Definition avl.h:54
struct avl_tree_struct avl_tree
Definition avl.h:45
struct avl_node_struct avl_node
Definition avl.h:36
#define EXTERN
Definition avl.h:17
#define ARGS(protos)
Definition avl.h:20
avl_node ** nodelist
Definition avl.h:57
avl_tree * tree
Definition avl.h:56
char * key
Definition avl.h:39
int height
Definition avl.h:41
char * value
Definition avl.h:40
avl_node * left
Definition avl.h:38
avl_node * right
Definition avl.h:38
avl_node * root
Definition avl.h:47
int num_entries
Definition avl.h:49
int modified
Definition avl.h:50
int(* compar)()
Definition avl.h:48