Removed output.h throughout.

Will svn delete output.h, output.cpp, phreeqc_files.cpp, main.cpp.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5710 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-10-20 19:26:08 +00:00
parent 53a00d4a98
commit 05495494ec
8 changed files with 11 additions and 503 deletions

View File

@ -20,7 +20,6 @@
#include "Dictionary.h"
#include "phqalloc.h"
#include "phrqproto.h"
#include "output.h"
//////////////////////////////////////////////////////////////////////

View File

@ -490,131 +490,6 @@ warning_msg(const char *err_str)
fflush(output_file);
}
}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//output_msg(int type, const char *format, va_list args)
///* ---------------------------------------------------------------------- */
//{
// int flush = 1;
//
// switch (type)
// {
//
// //case OUTPUT_ERROR:
// // io_error_count++;
// // if (error_file != NULL && error_file_on)
// // {
// // fprintf(error_file, "\nERROR: ");
// // vfprintf(error_file, format, args);
// // fflush(error_file);
// // }
// // if (output_file != NULL && output_file_on)
// // {
// // fprintf(output_file, "\nERROR: ");
// // vfprintf(output_file, format, args);
// // fflush(output_file);
// // }
// // if (log_file != NULL && log_file_on)
// // {
// // fprintf(log_file, "\nERROR: ");
// // vfprintf(log_file, format, args);
// // fflush(log_file);
// // }
// // break;
// //case OUTPUT_WARNING:
// // if (error_file != NULL && error_file_on)
// // {
// // fprintf(error_file, "\nWARNING: ");
// // vfprintf(error_file, format, args);
// // fflush(error_file);
// // }
// // if (output_file != NULL && output_file_on)
// // {
// // fprintf(output_file, "\nWARNING: ");
// // vfprintf(output_file, format, args);
// // fflush(output_file);
// // }
// // if (log_file != NULL && log_file_on)
// // {
// // fprintf(log_file, "\nWARNING: ");
// // vfprintf(log_file, format, args);
// // fflush(log_file);
// // }
// // break;
// //case OUTPUT_CHECKLINE:
// // {
// // if (output_file != NULL && output_file_on)
// // {
// // vfprintf(output_file, format, args);
// // if (flush)
// // fflush(output_file);
// // }
// // }
// // break;
// //case OUTPUT_MESSAGE:
// // if (output_file != NULL && output_file_on)
// // {
// // vfprintf(output_file, format, args);
// // if (flush)
// // fflush(output_file);
// // }
// // break;
// //case OUTPUT_PUNCH:
// // if (punch_file != NULL && punch_file_on)
// // {
// // {
// // vfprintf(punch_file, format, args);
// // if (flush)
// // fflush(punch_file);
// // }
// // }
// // break;
// //case OUTPUT_LOG:
// // if (log_file != NULL && log_file_on)
// // {
// // vfprintf(log_file, format, args);
// // if (flush)
// // fflush(log_file);
// // }
// // break;
// //case OUTPUT_SCREEN:
// // if (error_file != NULL && error_file_on)
// // {
// // vfprintf(error_file, format, args);
// // if (flush)
// // fflush(error_file);
// // }
// // break;
//
// //case OUTPUT_DUMP:
// // if (dump_file != NULL && dump_file_on)
// // {
// // vfprintf(dump_file, format, args);
// // if (flush)
// // fflush(dump_file);
// // }
// // break;
// default:
// assert(false);
// break;
// }
//}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//fpunchf(const char *name, const char *format, va_list args)
///* ---------------------------------------------------------------------- */
//{
// int flush = 1;
//
// if (punch_file != NULL && punch_file_on)
// {
// {
// vfprintf(punch_file, format, args);
// if (flush)
// fflush(punch_file);
// }
// }
//}
/* ---------------------------------------------------------------------- */
void PHRQ_io::
fpunchf(const char *name, const char *format, double d)
@ -651,77 +526,6 @@ fpunchf(const char *name, const char *format, int d)
}
}
}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//output_string(const int type, std::string str)
///* ---------------------------------------------------------------------- */
//{
//
// switch (type)
// {
//
// //case OUTPUT_ERROR:
// // //this->io_error_count++;
// // if (error_file != NULL && error_file_on)
// // {
// // fprintf(error_file, "%s", str.c_str());
// // }
// // fflush(error_file);
// // break;
//
// //case OUTPUT_WARNING:
// // if (log_file != NULL && log_file_on)
// // {
// // fprintf(log_file, "%s", str.c_str());
// // }
// // if (error_file != NULL && error_file_on)
// // {
// // fprintf(error_file, "%s", str.c_str());
// // fflush(error_file);
// // }
// // if (output_file != NULL && output_file_on)
// // {
// // fprintf(output_file, "%s", str.c_str());
// // }
// // break;
// //case OUTPUT_CHECKLINE:
// //case OUTPUT_MESSAGE:
// // if (output_file != NULL && output_file_on)
// // {
// // fprintf(output_file, "%s", str.c_str());
// // }
// // break;
// //case OUTPUT_PUNCH:
// // if (punch_file != NULL && punch_file_on)
// // {
// // fprintf(punch_file, "%s", str.c_str());
// // }
// // break;
// //case OUTPUT_LOG:
// // if (log_file != NULL && log_file_on)
// // {
// // fprintf(log_file, "%s", str.c_str());
// // }
// // break;
// //case OUTPUT_SCREEN:
// // if (error_file != NULL && error_file_on)
// // {
// // fprintf(error_file, "%s", str.c_str());
// // fflush(error_file);
// // }
// // break;
//
// //case OUTPUT_DUMP:
// // if (dump_file != NULL && dump_file_on)
// // {
// // fprintf(dump_file, "%s", str.c_str());
// // }
// // break;
// default:
// assert(false);
// }
// return;
//}
/* ---------------------------------------------------------------------- */
int PHRQ_io::
close_output_files(void)
@ -743,265 +547,6 @@ close_output_files(void)
output_file = log_file = punch_file = dump_file = NULL;
return ret;
}
///* ---------------------------------------------------------------------- */
//int PHRQ_io::
//output_open(int type, const char *file_name)
///* ---------------------------------------------------------------------- */
//{
// switch (type)
// {
//
// //case OUTPUT_PUNCH:
// // if (punch_file != NULL)
// // {
// // fclose(punch_file);
// // punch_file = NULL;
// // }
// // if ((punch_file = fopen(file_name, "w")) == NULL)
// // {
// // //return ERROR;
// // return 0;
// // }
// // break;
// //case OUTPUT_MESSAGE:
// // if (output_file != NULL)
// // {
// // safe_close(output_file);
// // output_file = NULL;
// // }
// // if ((output_file = fopen(file_name, "w")) == NULL)
// // {
// // //return ERROR;
// // return 0;
// // }
// // break;
// //case OUTPUT_DUMP:
// // if (dump_file != NULL)
// // {
// // safe_close(dump_file);
// // dump_file = NULL;
// // }
// // if ((dump_file = fopen(file_name, "w")) == NULL)
// // {
// // //return ERROR;
// // return 0;
// // }
// // break;
// //case OUTPUT_ERROR:
// // if (error_file != NULL)
// // {
// // safe_close(error_file);
// // error_file = NULL;
// // }
//
// // if (file_name != NULL)
// // {
// // if ((error_file = fopen(file_name, "w")) == NULL)
// // {
// // error_file = stderr;
// // return 0;
// // }
// // }
// // else
// // {
// // error_file = stderr;
// // }
// // break;
// //case OUTPUT_LOG:
// // if (log_file != NULL)
// // {
// // safe_close(log_file);
// // log_file = NULL;
// // }
// // if ((log_file = fopen(file_name, "w")) == NULL)
// // {
// // return 0;
// // }
// // break;
// default:
// assert(false);
// }
// return 1;
//}
///* ---------------------------------------------------------------------- */
//bool PHRQ_io::
//output_isopen(const int type)
///* ---------------------------------------------------------------------- */
//{
// switch (type)
// {
// //case OUTPUT_ERROR:
// // return (error_file != NULL);
// // break;
// //case OUTPUT_WARNING:
// // return (error_file != NULL || output_file != NULL);
// // break;
// //case OUTPUT_MESSAGE:
// // return (output_file != NULL);
// // break;
// //case OUTPUT_PUNCH:
// // return (punch_file != NULL);
// // break;
// //case OUTPUT_SCREEN:
// // return (error_file != NULL);
// // break;
// //case OUTPUT_LOG:
// // return (log_file != NULL);
// // break;
// //case OUTPUT_DUMP:
// // return (dump_file != NULL);
// // break;
// default:
// assert(false);
// return (output_file != NULL);
// break;
// }
// return false;
//}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//output_fflush(const int type)
///* ---------------------------------------------------------------------- */
//{
// switch (type)
// {
// //case OUTPUT_ERROR:
// // if (error_file)
// // fflush(error_file);
// // break;
//
// //case OUTPUT_WARNING:
// // if (error_file)
// // fflush(error_file);
// // if (output_file)
// // fflush(output_file);
// // break;
//
// //case OUTPUT_MESSAGE:
// ////case OUTPUT_CHECKLINE:
// // if (output_file)
// // fflush(output_file);
// // break;
//
// //case OUTPUT_PUNCH:
// // if (punch_file)
// // fflush(punch_file);
// // break;
//
// //case OUTPUT_SCREEN:
// // if (error_file)
// // fflush(error_file);
// // break;
//
// //case OUTPUT_LOG:
// // if (log_file)
// // fflush(log_file);
// // break;
//
// //case OUTPUT_DUMP:
// // if (dump_file)
// // fflush(dump_file);
// // break;
// default:
// assert(false);
// break;
// }
//}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//output_rewind(const int type)
///* ---------------------------------------------------------------------- */
//{
// switch (type)
// {
// //case OUTPUT_ERROR:
// // if (error_file)
// // rewind(error_file);
// // break;
//
// //case OUTPUT_WARNING:
// // if (error_file)
// // rewind(error_file);
// // if (output_file)
// // rewind(output_file);
// // break;
//
// //case OUTPUT_MESSAGE:
// ////case OUTPUT_CHECKLINE:
// // if (output_file)
// // rewind(output_file);
// // break;
//
// //case OUTPUT_PUNCH:
// // if (punch_file)
// // rewind(punch_file);
// // break;
//
// //case OUTPUT_SCREEN:
// // if (error_file)
// // rewind(error_file);
// // break;
//
// //case OUTPUT_LOG:
// // if (log_file)
// // rewind(log_file);
// // break;
//
// //case OUTPUT_DUMP:
// // if (dump_file)
// // rewind(dump_file);
// // break;
// default:
// assert(false);
// break;
// }
//}
///* ---------------------------------------------------------------------- */
//void PHRQ_io::
//output_close(const int type)
///* ---------------------------------------------------------------------- */
//{
// switch (type)
// {
// //case OUTPUT_ERROR:
// // safe_close(error_file);
// // break;
//
// //case OUTPUT_WARNING:
// // safe_close(error_file);
// // safe_close(output_file);
// // break;
//
// //case OUTPUT_MESSAGE:
// ////case OUTPUT_CHECKLINE:
// // safe_close(output_file);
// // break;
//
// //case OUTPUT_PUNCH:
// // safe_close(punch_file);
// // break;
//
// //case OUTPUT_SCREEN:
// // safe_close(error_file);
// // break;
//
// //case OUTPUT_LOG:
// // safe_close(log_file);
// // break;
//
// //case OUTPUT_DUMP:
// // safe_close(dump_file);
// // break;
//
// default:
// assert(false);
// break;
// }
//}
//safe_close is static method
/* ---------------------------------------------------------------------- */
void PHRQ_io::

View File

@ -8,41 +8,16 @@ class PhreeqcStop : std::exception
class PHRQ_io
{
public:
typedef enum
{
//OUTPUT_ERROR,
//OUTPUT_WARNING,
//OUTPUT_MESSAGE,
//OUTPUT_PUNCH,
//OUTPUT_SCREEN,
//OUTPUT_LOG,
//OUTPUT_CHECKLINE,
OUTPUT_GUI_ERROR,
//OUTPUT_DUMP,
//OUTPUT_SEND_MESSAGE,
//OUTPUT_ECHO,
OUTPUT_PUNCH_END_ROW
} output_type;
//typedef enum
//{
// ACTION_OPEN,
// ACTION_OUTPUT,
// ACTION_CLOSE,
// ACTION_REWIND,
// ACTION_FLUSH
//} action_type;
// constructors
// constructor/destructor
PHRQ_io(void);
virtual ~ PHRQ_io();
// methods
static void safe_close(FILE * file_ptr);
static int istream_getc(void *cookie);
static void safe_close(FILE * file_ptr);
int close_input_files(void);
int close_output_files(void);
static int istream_getc(void *cookie);
// output_file
bool output_temp_open(const char *file_name);
@ -75,6 +50,7 @@ typedef enum
void error_rewind(void);
bool error_isopen(void);
void error_msg(const char * str, bool stop=false);
void warning_msg(const char *err_str);
// dump_file
bool dump_open(const char *file_name);
@ -83,16 +59,8 @@ typedef enum
void dump_rewind(void);
bool dump_isopen(void);
void dump_msg(const char * str);
//int output_open(int type, const char *file_name);
void warning_msg(const char *err_str);
//void output_string(const int type, std::string str);
//void output_fflush(int type);
//void output_rewind(int type);
//void output_close(int type);
//bool output_isopen(int type);
//void output_msg(int type, const char *format, va_list args);
//void fpunchf(const char *name, const char *format, va_list args);
void fpunchf(const char *name, const char *format, double d);
void fpunchf(const char *name, const char *format, char * d);
void fpunchf(const char *name, const char *format, int d);
@ -107,7 +75,8 @@ typedef enum
void Set_punch_file(FILE * out);
void Set_dump_file(FILE * out);
void PHRQ_io::close_input(void);
// close input file
void close_input(void);
void Set_output_file_on(bool tf) {this->output_file_on = tf;};
void Set_log_file_on(bool tf) {this->log_file_on = tf;};

View File

@ -65,8 +65,6 @@ public:
#include "pitzer.h"
#include "input.h"
public:
#include "output.h"
public:
#include "global.h"
/*
@ -284,6 +282,8 @@ int process_file_names(int argc, char *argv[], void **db_cookie,
void screen_msg(const char *err_str);
void echo_msg(const char *err_str);
int warning_msg(const char *err_str);
void set_forward_output_to_log(int value);
int get_forward_output_to_log(void);
// dump_file
bool dump_open(const char *file_name);

View File

@ -28,8 +28,6 @@
#include "cxxMix.h"
#include "phqalloc.h"
#include "phrqproto.h"
#include "output.h"
#if !defined(PHREEQC_CLASS)
static int streamify_to_next_keyword(std::istringstream & lines);
@ -2775,7 +2773,7 @@ read_user_graph_handler(void)
bool success = chart_handler.Read(PHREEQC_THIS_COMMA parser);
// Need to output the next keyword
if (return_value == OPTION_KEYWORD) echo_msg(sformatf( "\t%s\n", line).c_str());
if (return_value == OPTION_KEYWORD) echo_msg(sformatf( "\t%s\n", line));
return (return_value);
}
#endif

View File

@ -36,7 +36,6 @@
#include "Temperature.h"
#include "phqalloc.h"
#include "phrqproto.h"
#include "output.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction

View File

@ -18,7 +18,6 @@
#include "Dictionary.h"
#include "phqalloc.h"
#include "phrqproto.h"
#include "output.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction

View File

@ -1,5 +1,4 @@
#include "Phreeqc.h"
#include "output.h"
#include "phrqproto.h"
#include "input.h"
#include "NameDouble.h"