當前位置: 首頁>>代碼示例>>C++>>正文


C++ DICT_ITERATOR_DICT函數代碼示例

本文整理匯總了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;
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:29,代碼來源:dictionary.c

示例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;
}
開發者ID:HoMeCracKeR,項目名稱:gdb-ng,代碼行數:25,代碼來源:dictionary.c

示例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);
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:7,代碼來源:dictionary.c

示例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;
}
開發者ID:HoMeCracKeR,項目名稱:gdb-ng,代碼行數:34,代碼來源:dictionary.c

示例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;
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:8,代碼來源:dictionary.c

示例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);
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:8,代碼來源:dictionary.c

示例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);
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:10,代碼來源:dictionary.c

示例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));
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:10,代碼來源:dictionary.c

示例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;
    }
}
開發者ID:GunioRobot,項目名稱:macgdb,代碼行數:16,代碼來源:dictionary.c

示例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;
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:21,代碼來源:dictionary.c

示例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;
}
開發者ID:GunioRobot,項目名稱:macgdb,代碼行數:21,代碼來源:dictionary.c

示例12: dict_iterator_next

struct symbol *
dict_iterator_next (struct dict_iterator *iterator)
{
  return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
    ->iterator_next (iterator);
}
開發者ID:atgreen,項目名稱:binutils-gdb,代碼行數:6,代碼來源:dictionary.c

示例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);
}
開發者ID:GunioRobot,項目名稱:macgdb,代碼行數:6,代碼來源:dictionary.c


注:本文中的DICT_ITERATOR_DICT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。