* dictionary.c (dict_add_pending): New function.

* dictionary.h (dict_add_pending): Declare.
This commit is contained in:
Doug Evans 2012-07-10 20:12:49 +00:00
parent 298a9cf0ef
commit 0bfa869d53
3 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-07-10 Doug Evans <dje@google.com>
* dictionary.c (dict_add_pending): New function.
* dictionary.h (dict_add_pending): Declare.
2012-07-09 Doug Evans <dje@google.com>
* buildsym.c (start_subfile): Remove unnecessary check for

View File

@ -498,6 +498,22 @@ dict_add_symbol (struct dictionary *dict, struct symbol *sym)
(DICT_VECTOR (dict))->add_symbol (dict, sym);
}
/* Utility to add a list of symbols to a dictionary.
DICT must be an expandable dictionary. */
void
dict_add_pending (struct dictionary *dict, const struct pending *symbol_list)
{
const struct pending *list;
int i;
for (list = symbol_list; list != NULL; list = list->next)
{
for (i = 0; i < list->nsyms; ++i)
dict_add_symbol (dict, list->symbol[i]);
}
}
/* Initialize ITERATOR to point at the first symbol in DICT, and
return that first symbol, or NULL if DICT is empty. */

View File

@ -85,6 +85,11 @@ extern void dict_free (struct dictionary *dict);
extern void dict_add_symbol (struct dictionary *dict, struct symbol *sym);
/* Utility to add a list of symbols to a dictionary. */
extern void dict_add_pending (struct dictionary *dict,
const struct pending *symbol_list);
/* Is the dictionary empty? */
extern int dict_empty (struct dictionary *dict);