contrib/gdb-7/gdb/cp-namespace.c
static struct type *
cp_lookup_transparent_type_loop (const char *name,
				 const char *scope,
				 int length)
{
  int scope_length = length + cp_find_first_component (scope + length);
  char *full_name;

  /* If the current scope is followed by "::", look in the next
     component.  */
  if (scope[scope_length] == ':')
    {
      struct type *retval
	= cp_lookup_transparent_type_loop (name, scope,
					   scope_length + 2);

      if (retval != NULL)
	return retval;
    }

  full_name = alloca (scope_length + 2 + strlen (name) + 1);
  strncpy (full_name, scope, scope_length);
  strncpy (full_name + scope_length, "::", 2);
  strcpy (full_name + scope_length + 2, name);

  return basic_lookup_transparent_type (full_name);
}
/* Lookup the type definition associated to NAME in namespaces/classes
   containing SCOPE whose name is strictly longer than LENGTH.  LENGTH
   must be the index of the start of a component of SCOPE.  */
Lookup the type definition associated to NAME in namespaces/classes
containing SCOPE whose name is strictly longer than LENGTH.  LENGTH
must be the index of the start of a component of SCOPE.
Lookup the type definition associated to NAME in namespaces / classes containing SCOPE whose name is strictly longer than LENGTH . LENGTH must be the index of the start of a component of SCOPE .
static struct type *
cp_lookup_transparent_type_loop (const char *name,
				 const char *scope,
				 int length)
{
  int scope_length = length + cp_find_first_component (scope + length);
  char *full_name;
  if (scope[scope_length] == ':')
    {
      struct type *retval
	= cp_lookup_transparent_type_loop (name, scope,
					   scope_length + 2);
      if (retval != NULL)
	return retval;
    }
  full_name = alloca (scope_length + 2 + strlen (name) + 1);
  strncpy (full_name, scope, scope_length);
  strncpy (full_name + scope_length, "::", 2);
  strcpy (full_name + scope_length + 2, name);
  return basic_lookup_transparent_type (full_name);
}
static struct type * cp_lookup_transparent_type_loop ( const char * name , const char * scope , int length ) { int scope_length = length + cp_find_first_component ( scope + length ) ; char * full_name ; if ( scope [ scope_length ] == ' ' ) { struct type * retval = cp_lookup_transparent_type_loop ( name , scope , scope_length + 2 ) ; if ( retval != NULL ) return retval ; } full_name = alloca ( scope_length + 2 + strlen ( name ) + 1 ) ; strncpy ( full_name , scope , scope_length ) ; strncpy ( full_name + scope_length , " " , 2 ) ; strcpy ( full_name + scope_length + 2 , name ) ; return basic_lookup_transparent_type ( full_name ) ; }
Lookup the type definition associated to NAME in namespaces/classes
containing SCOPE whose name is strictly longer than LENGTH.
Lookup the type definition associated to NAME in namespaces / classes containing SCOPE whose name is strictly longer than LENGTH .
/* If the current scope is followed by "::", look in the next
     component.  */