abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
avl.h File Reference

Go to the source code of this file.

Data Structures

struct  avl_node_struct
 
struct  avl_tree_struct
 
struct  avl_generator_struct
 

Macros

#define EXTERN
 
#define ARGS(protos)   protos
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define NIL(type)   ((type *) 0)
 
#define ALLOC(type, num)   ((type *) malloc(sizeof(type) * (num)))
 
#define REALLOC(type, obj, num)   ((type *) realloc((char *) obj, sizeof(type) * (num)))
 
#define FREE(obj)   free((char *) (obj))
 
#define AVL_FORWARD   0
 
#define AVL_BACKWARD   1
 
#define avl_is_member(tree, key)   avl_lookup(tree, key, (char **) 0)
 
#define avl_foreach_item(table, gen, dir, key_p, value_p)
 

Typedefs

typedef struct avl_node_struct avl_node
 
typedef struct avl_tree_struct avl_tree
 
typedef struct avl_generator_struct avl_generator
 

Functions

EXTERN avl_tree *avl_init_table ARGS ((int(*)()))
 
EXTERN int avl_delete ARGS ((avl_tree *, char **, char **))
 
EXTERN int avl_insert ARGS ((avl_tree *, char *, char *))
 
EXTERN int avl_lookup ARGS ((avl_tree *, char *, char **))
 
EXTERN int avl_find_or_add ARGS ((avl_tree *, char *, char ***))
 
EXTERN int avl_count ARGS ((avl_tree *))
 
EXTERN int avl_numcmp ARGS ((char *, char *))
 
EXTERN int avl_gen ARGS ((avl_generator *, char **, char **))
 
EXTERN void avl_foreach ARGS ((avl_tree *, void(*)(), int))
 
EXTERN void avl_free_table ARGS ((avl_tree *, void(*)(), void(*)()))
 
EXTERN void avl_free_gen ARGS ((avl_generator *))
 
EXTERN avl_generator *avl_init_gen ARGS ((avl_tree *, int))
 

Macro Definition Documentation

#define ALLOC (   type,
  num 
)    ((type *) malloc(sizeof(type) * (num)))

Definition at line 27 of file avl.h.

#define ARGS (   protos)    protos

Definition at line 20 of file avl.h.

#define AVL_BACKWARD   1

Definition at line 63 of file avl.h.

#define avl_foreach_item (   table,
  gen,
  dir,
  key_p,
  value_p 
)
Value:
for(gen = avl_init_gen(table, dir); \
avl_gen(gen, key_p, value_p) || (avl_free_gen(gen),0);)
void avl_free_gen(avl_generator *gen)
Definition: avl.c:338
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

Definition at line 83 of file avl.h.

#define AVL_FORWARD   0

Definition at line 62 of file avl.h.

#define avl_is_member (   tree,
  key 
)    avl_lookup(tree, key, (char **) 0)

Definition at line 81 of file avl.h.

#define EXTERN

Definition at line 17 of file avl.h.

#define FREE (   obj)    free((char *) (obj))

Definition at line 31 of file avl.h.

#define MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 23 of file avl.h.

#define NIL (   type)    ((type *) 0)

Definition at line 25 of file avl.h.

#define REALLOC (   type,
  obj,
  num 
)    ((type *) realloc((char *) obj, sizeof(type) * (num)))

Definition at line 29 of file avl.h.

Typedef Documentation

Definition at line 54 of file avl.h.

typedef struct avl_node_struct avl_node

Definition at line 36 of file avl.h.

typedef struct avl_tree_struct avl_tree

Definition at line 45 of file avl.h.

Function Documentation

EXTERN avl_tree* avl_init_table ARGS ( (int(*)())  )
EXTERN int avl_last ARGS ( (avl_tree *, char **, char **)  )
EXTERN int avl_insert ARGS ( (avl_tree *, char *, char *)  )
EXTERN int avl_lookup ARGS ( (avl_tree *, char *, char **)  )
EXTERN int avl_find_or_add ARGS ( (avl_tree *, char *, char ***)  )
EXTERN int avl_count ARGS ( (avl_tree *)  )
EXTERN char *util_tempnam ARGS ( (char *, char *)  )
EXTERN int avl_gen ARGS ( (avl_generator *, char **, char **)  )
EXTERN void avl_foreach ARGS ( (avl_tree *, void(*)(), int)  )
EXTERN void avl_free_table ARGS ( (avl_tree *, void(*)(), void(*)())  )
EXTERN void avl_free_gen ARGS ( (avl_generator *)  )
EXTERN avl_generator* avl_init_gen ARGS ( (avl_tree *, int)  )