本文整理汇总了C++中DICT_VECTOR函数的典型用法代码示例。如果您正苦于以下问题:C++ DICT_VECTOR函数的具体用法?C++ DICT_VECTOR怎么用?C++ DICT_VECTOR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DICT_VECTOR函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dict_iter_match_next
struct symbol *
dict_iter_match_next (const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
->iter_match_next (name, compare, iterator);
}
示例2: dict_iter_name_first
struct symbol *
dict_iter_name_first (const struct dictionary *dict,
const char *name,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (dict))->iter_name_first (dict, name, iterator);
}
示例3: dict_iter_match_first
struct symbol *
dict_iter_match_first (const struct dictionary *dict,
const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (dict))->iter_match_first (dict, name,
compare, iterator);
}
示例4: dict_create_hashed_expandable
extern struct dictionary *
dict_create_hashed_expandable (void)
{
struct dictionary *retval;
retval = xmalloc (sizeof (struct dictionary));
DICT_VECTOR (retval) = &dict_hashed_expandable_vector;
DICT_HASHED_NBUCKETS (retval) = DICT_EXPANDABLE_INITIAL_CAPACITY;
DICT_HASHED_BUCKETS (retval) = xcalloc (DICT_EXPANDABLE_INITIAL_CAPACITY,
sizeof (struct symbol *));
DICT_HASHED_EXPANDABLE_NSYMS (retval) = 0;
return retval;
}
示例5: dict_create_linear_expandable
struct dictionary *
dict_create_linear_expandable (void)
{
struct dictionary *retval;
retval = xmalloc (sizeof (struct dictionary));
DICT_VECTOR (retval) = &dict_linear_expandable_vector;
DICT_LINEAR_NSYMS (retval) = 0;
DICT_LINEAR_EXPANDABLE_CAPACITY (retval)
= DICT_EXPANDABLE_INITIAL_CAPACITY;
DICT_LINEAR_SYMS (retval)
= xmalloc (DICT_LINEAR_EXPANDABLE_CAPACITY (retval)
* sizeof (struct symbol *));
return retval;
}
示例6: dict_create_linear
struct dictionary *
dict_create_linear (struct obstack *obstack,
const struct pending *symbol_list)
{
struct dictionary *retval;
int nsyms = 0, i, j;
struct symbol **syms;
const struct pending *list_counter;
retval = obstack_alloc (obstack, sizeof (struct dictionary));
DICT_VECTOR (retval) = &dict_linear_vector;
/* Calculate the number of symbols, and allocate space for them. */
for (list_counter = symbol_list;
list_counter != NULL;
list_counter = list_counter->next)
{
nsyms += list_counter->nsyms;
}
DICT_LINEAR_NSYMS (retval) = nsyms;
syms = obstack_alloc (obstack, nsyms * sizeof (struct symbol *));
DICT_LINEAR_SYMS (retval) = syms;
/* Now fill in the symbols. Start filling in from the back, so as
to preserve the original order of the symbols. */
for (list_counter = symbol_list, j = nsyms - 1;
list_counter != NULL;
list_counter = list_counter->next)
{
for (i = list_counter->nsyms - 1;
i >= 0;
--i, --j)
{
syms[j] = list_counter->symbol[i];
}
}
return retval;
}
示例7: dict_create_hashed
struct dictionary *
dict_create_hashed (struct obstack *obstack,
const struct pending *symbol_list)
{
struct dictionary *retval;
int nsyms = 0, nbuckets, i;
struct symbol **buckets;
const struct pending *list_counter;
retval = obstack_alloc (obstack, sizeof (struct dictionary));
DICT_VECTOR (retval) = &dict_hashed_vector;
/* Calculate the number of symbols, and allocate space for them. */
for (list_counter = symbol_list;
list_counter != NULL;
list_counter = list_counter->next)
{
nsyms += list_counter->nsyms;
}
nbuckets = DICT_HASHTABLE_SIZE (nsyms);
DICT_HASHED_NBUCKETS (retval) = nbuckets;
buckets = obstack_alloc (obstack, nbuckets * sizeof (struct symbol *));
memset (buckets, 0, nbuckets * sizeof (struct symbol *));
DICT_HASHED_BUCKETS (retval) = buckets;
/* Now fill the buckets. */
for (list_counter = symbol_list;
list_counter != NULL;
list_counter = list_counter->next)
{
for (i = list_counter->nsyms - 1; i >= 0; --i)
{
insert_symbol_hashed (retval, list_counter->symbol[i]);
}
}
return retval;
}
示例8: dict_size
int
dict_size (const struct dictionary *dict)
{
return (DICT_VECTOR (dict))->size (dict);
}
示例9: dict_iterator_next
struct symbol *
dict_iterator_next (struct dict_iterator *iterator)
{
return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
->iterator_next (iterator);
}
示例10: dict_iterator_first
struct symbol *
dict_iterator_first (const struct dictionary *dict,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (dict))->iterator_first (dict, iterator);
}
示例11: dict_add_symbol
void
dict_add_symbol (struct dictionary *dict, struct symbol *sym)
{
(DICT_VECTOR (dict))->add_symbol (dict, sym);
}
示例12: dict_free
void
dict_free (struct dictionary *dict)
{
(DICT_VECTOR (dict))->free (dict);
}
示例13: dict_iter_name_next
struct symbol *
dict_iter_name_next (const char *name, struct dict_iterator *iterator)
{
return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
->iter_name_next (name, iterator);
}