if_diff/src/idfReport.cxx
//============================================================================
// Given a symbol, allocate a string and fill it with the name of the symbol 
// prefaced by its type.  Returns NULL if the symbol has no name and returns 
// the symbol name if the symbol has no type or the type has no name.
//============================================================================
Given a symbol, allocate a string and fill it with the name of the symbol
prefaced by its type.  Returns NULL if the symbol has no name and returns
the symbol name if the symbol has no type or the type has no name.
Given a symbol allocate a string and fill it with the name of the symbol prefaced by its type . Returns NULL if the symbol has no name and returns the symbol name if the symbol has no type or the type has no name .
static char *name_with_type(idfSymbol &sym)
{
  char *result = NULL;
  char *temp;
  const char *sym_name = sym.getName();
  if (sym_name != NULL) {
    int length = strlen(sym_name) + 1;
    idfSymbol *type = type_of_symbol(sym);
    const char *type_name = (type != NULL) ? type->getName() : NULL;
    if (type_name != NULL) {
      length += (strlen(type->getName()) + 1);
      result = new char[length];
      temp = result;
      while (*type_name != '\0') {
        *temp = *type_name;
        temp++;
        type_name++;
      }
      *temp = ' ';
      temp++;
    }
    else {
      result = new char[length];
      temp = result;
    }
    while (*sym_name != '\0') {
      *temp = *sym_name;
      temp++;
      sym_name++;
    }
    *temp = '\0';
  }
  return result;
}
static char * name_with_type ( idfSymbol & sym ) { char * result = NULL ; char * temp ; const char * sym_name = sym . getName ( ) ; if ( sym_name != NULL ) { int length = strlen ( sym_name ) + 1 ; idfSymbol * type = type_of_symbol ( sym ) ; const char * type_name = ( type != NULL ) ? type -> getName ( ) : NULL ; if ( type_name != NULL ) { length += ( strlen ( type -> getName ( ) ) + 1 ) ; result = new char [ length ] ; temp = result ; while ( * type_name != ' \0 ' ) { * temp = * type_name ; temp ++ ; type_name ++ ; } * temp = ' ' ; temp ++ ; } else { result = new char [ length ] ; temp = result ; } while ( * sym_name != ' \0 ' ) { * temp = * sym_name ; temp ++ ; sym_name ++ ; } * temp = ' \0 ' ; } return result ; }
Given a symbol, allocate a string and fill it with the name of the symbol
prefaced by its type.
Given a symbol allocate a string and fill it with the name of the symbol prefaced by its type .