Lines Matching refs:hash

3 BFD provides a simple set of hash table functions.  Routines
4 are provided to initialize a hash table, to free a hash table,
5 to look up a string in a hash table and optionally create an
6 entry for it, and to traverse a hash table. There is
7 currently no routine to delete an string from a hash table.
9 The basic hash table does not permit any data to be stored
10 with a string. However, a hash table is designed to present a
11 base class from which other types of hash tables may be
14 rather than simply providing a data pointer in a hash table
16 ends. The linker may create thousands of hash table entries,
20 The basic hash table code is in @code{hash.c}.
30 @subsection Creating and freeing a hash table
33 To create a hash table, create an instance of a @code{struct
43 function to use to create new entries. For a basic hash
55 been allocated for a hash table. This will not free up the
60 hash table to use.
66 string in the hash table and to create a new entry.
76 entered into the hash table if it is not already there.
84 copy the string onto the hash table objalloc or not. If
86 deallocate or modify the string as long as the hash table
90 @subsection Traversing a hash table
93 hash table, calling a function on each element. The traversal
98 hash table entry (a @code{struct bfd_hash_entry *}) and the
101 continue traversing the hash table. If the function returns
106 @subsection Deriving a new hash table type
107 Many uses of hash tables want to store additional information
108 which each entry in the hash table. Some also find it
109 convenient to store additional information with the hash table
110 itself. This may be done using a derived hash table.
113 hash table requires sticking together some boilerplate
114 routines with a few differences specific to the type of hash
117 An example of a derived hash table is the linker hash table.
121 You may also derive a hash table from an already derived hash
122 table. For example, the a.out linker backend code uses a hash
123 table derived from the linker hash table.
133 You must define a structure for an entry in the hash table,
134 and a structure for the hash table itself.
136 The first field in the structure for an entry in the hash
137 table must be of the type used for an entry in the hash table
138 you are deriving from. If you are deriving from a basic hash
140 @code{bfd.h}. The first field in the structure for the hash
141 table itself must be of the type of the hash table you are
142 deriving from itself. If you are deriving from a basic hash
145 For example, the linker hash table defines @code{struct
154 entry in the hash table. This routine is passed as the
157 In order to permit other hash tables to be derived from the
158 hash table you are creating, this routine must be written in a
162 hash table entry. This may be @code{NULL}, in which case the
164 the space has already been allocated by a hash table type
168 creation routine of the hash table type it is derived from,
170 will initialize any fields used by the base hash table.
173 for the new hash table type.
177 @var{entry_type} is the type of an entry in the hash table you
179 routine of the hash table type your hash table is derived
210 The creation routine for the linker hash table, which is in
215 routine for a basic hash table.
218 in a linker hash table entry: @code{type}, @code{written} and
223 You will want to write other routines for your new hash table,
227 initialization routine of the hash table you are deriving from
228 and initializes any other local fields. For the linker hash
232 of the hash table you are deriving from and casts the result.
233 The linker hash table uses @code{bfd_link_hash_lookup} in
238 traversal routine of the hash table you are deriving from with
239 appropriate casts. The linker hash table uses
243 the a.out backend linker hash table, which is derived from the
244 linker hash table, uses macros for the lookup and traversal