本文整理汇总了C++中DICT_ITERATOR_DICT函数的典型用法代码示例。如果您正苦于以下问题:C++ DICT_ITERATOR_DICT函数的具体用法?C++ DICT_ITERATOR_DICT怎么用?C++ DICT_ITERATOR_DICT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DICT_ITERATOR_DICT函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter_match_first_hashed
static struct symbol *
iter_match_first_hashed (const struct dictionary *dict, const char *name,
symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
unsigned int hash_index = dict_hash (name) % DICT_HASHED_NBUCKETS (dict);
struct symbol *sym;
DICT_ITERATOR_DICT (iterator) = dict;
/* Loop through the symbols in the given bucket, breaking when SYM
first matches. If SYM never matches, it will be set to NULL;
either way, we have the right return value. */
for (sym = DICT_HASHED_BUCKET (dict, hash_index);
sym != NULL;
sym = sym->hash_next)
{
/* Warning: the order of arguments to compare matters! */
if (compare (SYMBOL_SEARCH_NAME (sym), name) == 0)
{
break;
}
}
DICT_ITERATOR_CURRENT (iterator) = sym;
return sym;
}
示例2: iter_name_next_linear
static struct symbol *
iter_name_next_linear (const char *name, struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
int i, nsyms = DICT_LINEAR_NSYMS (dict);
struct symbol *sym, *retval = NULL;
for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nsyms; ++i)
{
sym = DICT_LINEAR_SYM (dict, i);
/* APPLE LOCAL begin psym equivalences */
if ((strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
|| (psym_equivalences
&& psym_name_match (SYMBOL_SEARCH_NAME (sym), name)))
/* APPLE LOCAL end psym equivalences */
{
retval = sym;
break;
}
}
DICT_ITERATOR_INDEX (iterator) = i;
return retval;
}
示例3: 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);
}
示例4: iter_name_first_hashed
static struct symbol *
iter_name_first_hashed (const struct dictionary *dict,
const char *name,
struct dict_iterator *iterator)
{
unsigned int hash_index
= msymbol_hash_iw (name) % DICT_HASHED_NBUCKETS (dict);
struct symbol *sym;
DICT_ITERATOR_DICT (iterator) = dict;
/* Loop through the symbols in the given bucket, breaking when SYM
first matches. If SYM never matches, it will be set to NULL;
either way, we have the right return value. */
for (sym = DICT_HASHED_BUCKET (dict, hash_index);
sym != NULL;
sym = sym->hash_next)
{
/* Warning: the order of arguments to strcmp_iw matters! */
/* APPLE LOCAL begin psym equivalences */
if ((strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
|| (psym_equivalences
&& psym_name_match (SYMBOL_SEARCH_NAME (sym), name)))
/* APPLE LOCAL end psym equivalences */
{
break;
}
}
DICT_ITERATOR_CURRENT (iterator) = sym;
return sym;
}
示例5: iterator_first_linear
static struct symbol *
iterator_first_linear (const struct dictionary *dict,
struct dict_iterator *iterator)
{
DICT_ITERATOR_DICT (iterator) = dict;
DICT_ITERATOR_INDEX (iterator) = 0;
return DICT_LINEAR_NSYMS (dict) ? DICT_LINEAR_SYM (dict, 0) : NULL;
}
示例6: iterator_first_hashed
static struct symbol *
iterator_first_hashed (const struct dictionary *dict,
struct dict_iterator *iterator)
{
DICT_ITERATOR_DICT (iterator) = dict;
DICT_ITERATOR_INDEX (iterator) = -1;
return iterator_hashed_advance (iterator);
}
示例7: iter_match_first_linear
static struct symbol *
iter_match_first_linear (const struct dictionary *dict,
const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
DICT_ITERATOR_DICT (iterator) = dict;
DICT_ITERATOR_INDEX (iterator) = -1;
return iter_match_next_linear (name, compare, iterator);
}
示例8: iterator_next_linear
static struct symbol *
iterator_next_linear (struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
if (++DICT_ITERATOR_INDEX (iterator) >= DICT_LINEAR_NSYMS (dict))
return NULL;
else
return DICT_LINEAR_SYM (dict, DICT_ITERATOR_INDEX (iterator));
}
示例9: iterator_next_hashed
static struct symbol *
iterator_next_hashed (struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
struct symbol *next;
next = DICT_ITERATOR_CURRENT (iterator)->hash_next;
if (next == NULL)
return iterator_hashed_advance (iterator);
else
{
DICT_ITERATOR_CURRENT (iterator) = next;
return next;
}
}
示例10: iterator_hashed_advance
static struct symbol *
iterator_hashed_advance (struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
int nbuckets = DICT_HASHED_NBUCKETS (dict);
int i;
for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nbuckets; ++i)
{
struct symbol *sym = DICT_HASHED_BUCKET (dict, i);
if (sym != NULL)
{
DICT_ITERATOR_INDEX (iterator) = i;
DICT_ITERATOR_CURRENT (iterator) = sym;
return sym;
}
}
return NULL;
}
示例11: iter_name_next_linear
static struct symbol *
iter_name_next_linear (const char *name, struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
int i, nsyms = DICT_LINEAR_NSYMS (dict);
struct symbol *sym, *retval = NULL;
for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nsyms; ++i)
{
sym = DICT_LINEAR_SYM (dict, i);
if (strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
{
retval = sym;
break;
}
}
DICT_ITERATOR_INDEX (iterator) = i;
return retval;
}
示例12: dict_iterator_next
struct symbol *
dict_iterator_next (struct dict_iterator *iterator)
{
return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
->iterator_next (iterator);
}
示例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);
}