simplify/src/ParserCallBacks.cxx
//set to 1 when SMT file "" is processed
set to 1 when SMT file "" is processed
set to 1 when SMT file " " is processed
int ReportSym(unsigned int id, symbolStruct* sym)
{
  int ret = 1;
  symbol* newsym = new symbol(*sym);
  if (newsym)
    {
      GetSymbols()[id] = newsym;
      if (strcmp(newsym->kind, "file") == 0)
	{
	  char* path = pdrealpath(newsym->name);
	  if (path)
	    {
	      free(newsym->name);
	      newsym->name = path;
	    }
	  else
	    {
	      Error(FILE_DOESNOT_EXIST, newsym->name);
	    }
	  if (source_id == 0) {
	      source_id = id;
	  }
	}
    }
  else
    {
      Error(OUT_OF_MEMORY);
      ret = 0;
    }
  return ret;
}
int ReportSym ( unsigned int id , symbolStruct * sym ) { int ret = 1 ; symbol * newsym = new symbol ( * sym ) ; if ( newsym ) { GetSymbols ( ) [ id ] = newsym ; if ( strcmp ( newsym -> kind , " " ) == 0 ) { char * path = pdrealpath ( newsym -> name ) ; if ( path ) { free ( newsym -> name ) ; newsym -> name = path ; } else { Error ( FILE_DOESNOT_EXIST , newsym -> name ) ; } if ( source_id == 0 ) { source_id = id ; } } } else { Error ( OUT_OF_MEMORY ) ; ret = 0 ; } return ret ; }
set to 1 when SMT file "" is processed
set to 1 when SMT file " " is processed
//get absolute path // The main source file is the first symbol // reported in the IF, but the id is not necessarily 1.