// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: ui.cc
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
// The above named program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License version 2 as published by the Free Software Foundation.
// The above named program is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public
// License along with this work; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
// ========== Copyright Header End ============================================
UserInterface
* ui
= new UserInterface();
FILE* UserInterface::log_file
= 0;
UserInterface::UserInterface( const char* module_name_
)/*{{{*/
module_name(module_name_
? strdup(module_name
) : 0)
void UserInterface::output( const char* format
, ... )/*{{{*/
vfprintf(stdout
,format
,ap
);
vfprintf(log_file
,format
,ap
);
void UserInterface::verbose( const char* format
, ... )/*{{{*/
vfprintf(log_file
,format
,ap
);
void UserInterface::warning( const char* format
, ... )/*{{{*/
fprintf(stdout
,"WARNING: ");
fprintf(stdout
,"%s: ",module_name
);
vfprintf(stdout
,format
,ap
);
fprintf(log_file
,"WARNING: ");
fprintf(stdout
,"%s: ",module_name
);
vfprintf(log_file
,format
,ap
);
void UserInterface::error( const char* format
, ... )/*{{{*/
fprintf(stdout
,"ERROR: ");
fprintf(stdout
,"%s: ",module_name
);
vfprintf(stdout
,format
,ap
);
fprintf(log_file
,"ERROR: ");
fprintf(stdout
,"%s: ",module_name
);
vfprintf(log_file
,format
,ap
);
void UserInterface::fatal( const char* format
, ... )/*{{{*/
fprintf(stdout
,"FATAL: ");
fprintf(stdout
,"%s: ",module_name
);
vfprintf(stdout
,format
,ap
);
fprintf(stdout
,"FATAL: forcing core dump.\n");
fprintf(log_file
,"FATAL: ");
fprintf(log_file
,"%s: ",module_name
);
vfprintf(log_file
,format
,ap
);
fprintf(log_file
,"FATAL: forcing core dump.\n");
void UserInterface::perror( const char* s
)/*{{{*/
error("s: %s",strerror(errno
));
void UserInterface::input( const char* s
)/*{{{*/
void UserInterface::flush()/*{{{*/
void UserInterface::set_log_file( FILE* log_file_
)/*{{{*/
FILE* UserInterface::get_output_file()/*{{{*/