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

Go to the source code of this file.

Data Structures

struct  stmm_table_entry
 
struct  stmm_table
 
struct  stmm_generator
 

Macros

#define EXTERN   extern
 
#define ARGS(protos)   protos
 
#define stmm_is_member(table, key)   stmm_lookup(table,key,(char **) 0)
 
#define stmm_count(table)   ((table)->num_entries)
 
#define STMM_DEFAULT_MAX_DENSITY   5
 
#define STMM_DEFAULT_INIT_TABLE_SIZE   11
 
#define STMM_DEFAULT_GROW_FACTOR   2.0
 
#define STMM_DEFAULT_REORDER_FLAG   0
 
#define stmm_foreach_item2(tb, gen, key, value)
 
#define stmm_foreach_item(table, gen, key, value)   for(gen=stmm_init_gen(table); stmm_gen(gen,key,value) || (stmm_free_gen(gen),0);)
 
#define stmm_foreach_item_int(table, gen, key, value)   for(gen=stmm_init_gen(table); stmm_gen_int(gen,key,value) || (stmm_free_gen(gen),0);)
 
#define STMM_OUT_OF_MEM   -10000
 

Typedefs

typedef int(* stmm_compare_func_type )(const char *, const char *)
 
typedef int(* stmm_hash_func_type )(const char *, int)
 
typedef struct stmm_table_entry stmm_table_entry
 
typedef struct stmm_table stmm_table
 
typedef struct stmm_generator stmm_generator
 
typedef enum stmm_retval(* STMM_PFSR )(char *, char *, char *)
 

Enumerations

enum  stmm_retval { STMM_CONTINUE, STMM_STOP, STMM_DELETE }
 

Functions

EXTERN stmm_table
*stmm_init_table_with_params 
ARGS ((stmm_compare_func_type compare, stmm_hash_func_type hash, int size, int density, double grow_factor, int reorder_flag))
 
EXTERN stmm_table *stmm_init_table ARGS ((stmm_compare_func_type, stmm_hash_func_type))
 
EXTERN void stmm_free_table ARGS ((stmm_table *))
 
EXTERN int stmm_lookup ARGS ((stmm_table *, char *, char **))
 
EXTERN int stmm_lookup_int ARGS ((stmm_table *, char *, int *))
 
EXTERN int stmm_insert ARGS ((stmm_table *, char *, char *))
 
EXTERN int stmm_find_or_add ARGS ((stmm_table *, char *, char ***))
 
EXTERN int stmm_delete ARGS ((stmm_table *, char **, char **))
 
EXTERN int stmm_delete_int ARGS ((stmm_table *, long *, char **))
 
EXTERN int stmm_foreach ARGS ((stmm_table *, STMM_PFSR, char *))
 
EXTERN int stmm_strhash ARGS ((const char *, int))
 
EXTERN int stmm_numcmp ARGS ((const char *, const char *))
 
EXTERN int stmm_gen ARGS ((stmm_generator *, char **, char **))
 
EXTERN int stmm_gen_int ARGS ((stmm_generator *, char **, long *))
 
EXTERN void stmm_free_gen ARGS ((stmm_generator *))
 

Macro Definition Documentation

#define ARGS (   protos)    protos

Definition at line 36 of file stmm.h.

#define EXTERN   extern

Definition at line 31 of file stmm.h.

#define stmm_count (   table)    ((table)->num_entries)

Definition at line 76 of file stmm.h.

#define STMM_DEFAULT_GROW_FACTOR   2.0

Definition at line 113 of file stmm.h.

#define STMM_DEFAULT_INIT_TABLE_SIZE   11

Definition at line 112 of file stmm.h.

#define STMM_DEFAULT_MAX_DENSITY   5

Definition at line 111 of file stmm.h.

#define STMM_DEFAULT_REORDER_FLAG   0

Definition at line 114 of file stmm.h.

#define stmm_foreach_item (   table,
  gen,
  key,
  value 
)    for(gen=stmm_init_gen(table); stmm_gen(gen,key,value) || (stmm_free_gen(gen),0);)

Definition at line 121 of file stmm.h.

#define stmm_foreach_item2 (   tb,
  gen,
  key,
  value 
)
Value:
for(gen.table=(tb), gen.entry=NULL, gen.index=0; \
stmm_gen(&(gen),key,value);)
int stmm_gen(stmm_generator *gen, char **key_p, char **value_p)
Definition: stmm.c:567
enum keys key
int value

Definition at line 117 of file stmm.h.

#define stmm_foreach_item_int (   table,
  gen,
  key,
  value 
)    for(gen=stmm_init_gen(table); stmm_gen_int(gen,key,value) || (stmm_free_gen(gen),0);)

Definition at line 124 of file stmm.h.

#define stmm_is_member (   table,
  key 
)    stmm_lookup(table,key,(char **) 0)

Definition at line 75 of file stmm.h.

#define STMM_OUT_OF_MEM   -10000

Definition at line 127 of file stmm.h.

Typedef Documentation

typedef int(* stmm_compare_func_type)(const char *, const char *)

Definition at line 39 of file stmm.h.

Definition at line 44 of file stmm.h.

typedef int(* stmm_hash_func_type)(const char *, int)

Definition at line 40 of file stmm.h.

typedef enum stmm_retval(* STMM_PFSR)(char *, char *, char *)

Definition at line 81 of file stmm.h.

typedef struct stmm_table stmm_table

Definition at line 43 of file stmm.h.

Definition at line 42 of file stmm.h.

Enumeration Type Documentation

Enumerator
STMM_CONTINUE 
STMM_STOP 
STMM_DELETE 

Definition at line 78 of file stmm.h.

Function Documentation

EXTERN stmm_table* stmm_init_table_with_params ARGS ( (stmm_compare_func_type compare, stmm_hash_func_type hash, int size, int density, double grow_factor, int reorder_flag)  )
EXTERN void stmm_clean ARGS ( (stmm_table *)  )
EXTERN int stmm_lookup ARGS ( (stmm_table *, char *, char **)  )
EXTERN int stmm_lookup_int ARGS ( (stmm_table *, char *, int *)  )
EXTERN int stmm_add_direct ARGS ( (stmm_table *, char *, char *)  )
EXTERN int stmm_find ARGS ( (stmm_table *, char *, char ***)  )
EXTERN int stmm_delete ARGS ( (stmm_table *, char **, char **)  )
EXTERN int stmm_delete_int ARGS ( (stmm_table *, long *, char **)  )
EXTERN int stmm_foreach ARGS ( (stmm_table *, STMM_PFSR, char *)  )
EXTERN int stmm_ptrhash ARGS ( (const char *, int)  )
EXTERN int stmm_ptrcmp ARGS ( (const char *, const char *)  )
EXTERN int stmm_gen ARGS ( (stmm_generator *, char **, char **)  )
EXTERN int stmm_gen_int ARGS ( (stmm_generator *, char **, long *)  )
EXTERN void stmm_free_gen ARGS ( (stmm_generator *)  )