VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
hash.h
Go to the documentation of this file.
1 #define HASHSIZE 5000001
2 
3 struct s_hash {
4  char *name;
5  int index;
6  int count;
7  struct s_hash *next;
8 };
9 
10 /* name: The string referred to by this hash entry. *
11  * index: The integer identifier for this entry. *
12  * count: Number of times an element with this name has been inserted into *
13  * the table. EXCEPTION: For the structure for blif parsing/reading, *
14  * blif_hash, value of count is the number of pins on this vpack_net *
15  * so far. *
16  * next: A pointer to the next (string,index) entry that mapped to the *
17  * same hash value, or NULL if there are no more entries. */
18 
20  int i;
21  struct s_hash *h_ptr;
22 };
23 
24 /* i: current "line" of the hash table. That is, hash_table[i] is the *
25  * start of the hash linked list for this hash value. *
26  * h_ptr: Pointer to the next hash structure to be examined in the *
27  * iteration. */
28 
29 struct s_hash **alloc_hash_table(void);
30 void free_hash_table(struct s_hash **hash_table);
32 struct s_hash *get_next_hash(struct s_hash **hash_table,
33  struct s_hash_iterator *hash_iterator);
34 struct s_hash *insert_in_hash_table(struct s_hash **hash_table, char *name,
35  int next_free_index);
36 struct s_hash *get_hash_entry(struct s_hash **hash_table, char *name);
37 int hash_value(char *name);
38 void get_hash_stats(struct s_hash **hash_table, char *hash_table_name);
int count
Definition: hash.h:6
int index
Definition: hash.h:5
struct s_hash * insert_in_hash_table(struct s_hash **hash_table, char *name, int next_free_index)
Definition: hash.c:76
void free_hash_table(struct s_hash **hash_table)
Definition: hash.c:18
void get_hash_stats(struct s_hash **hash_table, char *hash_table_name)
Definition: hash.c:160
char * name
Definition: hash.h:4
struct s_hash * get_hash_entry(struct s_hash **hash_table, char *name)
Definition: hash.c:119
int hash_value(char *name)
Definition: hash.c:140
struct s_hash ** alloc_hash_table(void)
Definition: hash.c:7
struct s_hash * next
Definition: hash.h:7
struct s_hash_iterator start_hash_table_iterator(void)
Definition: hash.c:38
Definition: hash.h:3
struct s_hash * get_next_hash(struct s_hash **hash_table, struct s_hash_iterator *hash_iterator)
Definition: hash.c:51
struct s_hash * h_ptr
Definition: hash.h:21