summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd/doc/hash.texi
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/bfd/doc/hash.texi')
-rw-r--r--contrib/binutils/bfd/doc/hash.texi25
1 files changed, 13 insertions, 12 deletions
diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi
index 4147ce4..45d63e0 100644
--- a/contrib/binutils/bfd/doc/hash.texi
+++ b/contrib/binutils/bfd/doc/hash.texi
@@ -25,7 +25,7 @@ The basic hash table code is in @code{hash.c}.
* Traversing a Hash Table::
* Deriving a New Hash Table Type::
@end menu
-@*
+
@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables
@subsection Creating and freeing a hash table
@findex bfd_hash_table_init
@@ -54,7 +54,7 @@ objalloc using @code{bfd_hash_allocate}.
Use @code{bfd_hash_table_free} to free up all the memory that has
been allocated for a hash table. This will not free up the
@code{struct bfd_hash_table} itself, which you must provide.
-@*
+
@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables
@subsection Looking up or entering a string
@findex bfd_hash_lookup
@@ -81,7 +81,7 @@ copy the string onto the hash table objalloc or not. If
@var{copy} is passed as @code{false}, you must be careful not to
deallocate or modify the string as long as the hash table
exists.
-@*
+
@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables
@subsection Traversing a hash table
@findex bfd_hash_traverse
@@ -97,7 +97,7 @@ must return a @code{boolean} value, which indicates whether to
continue traversing the hash table. If the function returns
@code{false}, @code{bfd_hash_traverse} will stop the traversal and
return immediately.
-@*
+
@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables
@subsection Deriving a new hash table type
Many uses of hash tables want to store additional information
@@ -123,7 +123,7 @@ table derived from the linker hash table.
* Write the Derived Creation Routine::
* Write Other Derived Routines::
@end menu
-@*
+
@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type
@subsubsection Define the derived structures
You must define a structure for an entry in the hash table,
@@ -143,7 +143,7 @@ bfd_link_hash_entry} (in @code{bfdlink.h}). The first field,
@code{root}, is of type @code{struct bfd_hash_entry}. Similarly,
the first field in @code{struct bfd_link_hash_table}, @code{table},
is of type @code{struct bfd_hash_table}.
-@*
+
@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type
@subsubsection Write the derived creation routine
You must write a routine which will create and initialize an
@@ -174,9 +174,10 @@ Here is a boilerplate example of a creation routine.
are creating. @var{base_newfunc} is the name of the creation
routine of the hash table type your hash table is derived
from.
-@*
-.struct bfd_hash_entry *
+
+
@example
+struct bfd_hash_entry *
@var{function_name} (entry, table, string)
struct bfd_hash_entry *entry;
struct bfd_hash_table *table;
@@ -189,14 +190,14 @@ from.
if (ret == (@var{entry_type} *) NULL)
@{
ret = ((@var{entry_type} *)
- bfd_hash_allocate (table, sizeof (@var{entry_type})));
+ bfd_hash_allocate (table, sizeof (@var{entry_type})));
if (ret == (@var{entry_type} *) NULL)
return NULL;
@}
/* Call the allocation method of the base class. */
ret = ((@var{entry_type} *)
- @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
+ @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
/* Initialize the local fields here. */
@@ -214,7 +215,7 @@ routine for a basic hash table.
@code{_bfd_link_hash_newfunc} also initializes the local fields
in a linker hash table entry: @code{type}, @code{written} and
@code{next}.
-@*
+
@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type
@subsubsection Write other derived routines
You will want to write other routines for your new hash table,
@@ -241,4 +242,4 @@ the a.out backend linker hash table, which is derived from the
linker hash table, uses macros for the lookup and traversal
routines. These are @code{aout_link_hash_lookup} and
@code{aout_link_hash_traverse} in aoutx.h.
-@*
+
OpenPOWER on IntegriCloud