Added isopen_handler

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5662 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-09-29 20:32:05 +00:00
parent 9fe532eaaf
commit 9201846ce1
2 changed files with 44 additions and 1 deletions

View File

@ -475,6 +475,49 @@ open_handler(const int type, const char *file_name)
return 1;
}
/* ---------------------------------------------------------------------- */
bool PHRQ_io::
isopen_handler(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;
case OUTPUT_STDERR:
return (stderr != NULL);
break;
case OUTPUT_CHECKLINE:
case OUTPUT_GUI_ERROR:
case OUTPUT_BASIC:
case OUTPUT_CVODE:
case OUTPUT_SEND_MESSAGE:
case OUTPUT_ECHO:
case OUTPUT_PUNCH_END_ROW:
return (output_file != NULL);
break;
}
return false;
}
/* ---------------------------------------------------------------------- */
int PHRQ_io::
fileop_handler(const int type, int (*PFN) (FILE *))

View File

@ -42,7 +42,7 @@ typedef enum
int phreeqc_handler(const int action, const int type, const char *err_str, const bool stop, const char *, va_list args);
int open_handler(const int type, const char *file_name);
bool isopen_handler(const int type);
int fileop_handler(const int type, int (*PFN) (FILE *));
int output_handler(const int type, const char *err_str,
const bool stop, const char *format,