+ *
+ * FUNCTION GetErrorOn(ID)
+ * INTEGER(KIND=4), INTENT(IN) :: ID
+ * LOGICAL(KIND=4) :: GetErrorOn
+ * END FUNCTION GetErrorOn
+ *
+ *
+ * @endhtmlonly
+ */
+ IPQ_DLL_EXPORT int GetErrorOn(int id);
+
/**
* Retrieves the error messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString.
@@ -1852,6 +1871,31 @@ Headings
*/
IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileOn(int id, int error_on);
+/**
+ * Sets the error switch on or off. This switch controls whether or not
+ * error messages are generated and displayed. The initial setting after calling
+ * @ref CreateIPhreeqc is on.
+ * @param id The instance id returned from @ref CreateIPhreeqc.
+ * @param error_on If non-zero, writes errors to the error file and error string; if zero, no errors are written to the error file or stored in the error string.
+ * @retval IPQ_OK Success.
+ * @retval IPQ_BADINSTANCE The given id is invalid.
+ * @see GetErrorOn, GetErrorStringLine, GetErrorStringLineCount, OutputErrorString
+ * @par Fortran90 Interface:
+ * @htmlonly
+ *
+ *
+ * FUNCTION SetErrorOn(ID,ERR_ON)
+ * INTEGER(KIND=4), INTENT(IN) :: ID
+ * LOGICAL(KIND=4), INTENT(IN) :: ERR_ON
+ * INTEGER(KIND=4) :: SetErrorOn
+ * END FUNCTION SetErrorOn
+ *
+ *
+ * @endhtmlonly
+ */
+ IPQ_DLL_EXPORT IPQ_RESULT SetErrorOn(int id, int error_on);
+
+
/**
* Sets the error string switch on or off. This switch controls whether or not the data normally sent
* to the error file are stored in a buffer for retrieval. The initial setting after calling
diff --git a/IPhreeqc.hpp b/IPhreeqc.hpp
index c6111f30..ce668b40 100644
--- a/IPhreeqc.hpp
+++ b/IPhreeqc.hpp
@@ -193,6 +193,14 @@ public:
*/
bool GetErrorFileOn(void)const;
+ /**
+ * Retrieves the current value of the error switch.
+ * @retval true Error messages are sent to the error file and to the string buffer
+ * @retval false No errors are sent.
+ * @see SetErrorOn
+ */
+ bool GetErrorOn(void)const;
+
/**
* Retrieves the error messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString.
* @return A null terminated string containing error messages.
@@ -768,12 +776,21 @@ public:
/**
* Sets the error file switch on or off. This switch controls whether or not
* error messages are written to the phreeqc.id.err (where id is obtained from @ref GetId) file.
- * The initial setting is false.
+ * The initial setting is true.
* @param bValue If true, writes errors to the error file; if false, no errors are written to the error file.
* @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString
*/
void SetErrorFileOn(bool bValue);
+ /**
+ * Sets the error switch on or off. This switch controls whether
+ * error messages are are generated and displayed.
+ * The initial setting is true.
+ * @param bValue If true, error messages are sent to the error file and error string buffer; if false, no error messages are generated.
+ * @see GetErrorOn, GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString
+ */
+ void SetErrorOn(bool bValue);
+
/**
* Sets the error string switch on or off. This switch controls whether or not the data normally sent
* to the error file are stored in a buffer for retrieval. The initial setting is true.
diff --git a/IPhreeqcF.f b/IPhreeqcF.f
index c5586dc6..856700ba 100644
--- a/IPhreeqcF.f
+++ b/IPhreeqcF.f
@@ -145,6 +145,18 @@
GetErrorFileOn = .TRUE.
ENDIF
END FUNCTION GetErrorFileOn
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ FUNCTION GetErrorOn(ID)
+ IMPLICIT NONE
+ INTEGER(KIND=4) :: ID
+ LOGICAL(KIND=4) :: GetErrorOn
+ INTEGER(KIND=4) :: GetErrorOnF
+ IF (GetErrorOnF(ID).EQ.0) THEN
+ GetErrorOn = .FALSE.
+ ELSE
+ GetErrorOn = .TRUE.
+ ENDIF
+ END FUNCTION GetErrorOn
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! GetErrorString
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -536,6 +548,15 @@
INTEGER(KIND=4) :: SetErrorFileOnF
SetErrorFileOn = SetErrorFileOnF(ID,ERROR_ON)
END FUNCTION SetErrorFileOn
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ FUNCTION SetErrorOn(ID,ERROR_ON)
+ IMPLICIT NONE
+ INTEGER(KIND=4) :: ID
+ LOGICAL(KIND=4) :: ERROR_ON
+ INTEGER(KIND=4) :: SetErrorOn
+ INTEGER(KIND=4) :: SetErrorOnF
+ SetErrorOn = SetErrorOnF(ID,ERROR_ON)
+ END FUNCTION SetErrorOn
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FUNCTION SetErrorStringOn(ID,ERROR_STRING_ON)
IMPLICIT NONE
diff --git a/IPhreeqcLib.cpp b/IPhreeqcLib.cpp
index 2cd59d89..b57755ab 100644
--- a/IPhreeqcLib.cpp
+++ b/IPhreeqcLib.cpp
@@ -236,6 +236,24 @@ GetErrorFileOn(int id)
return IPQ_BADINSTANCE;
}
+int
+GetErrorOn(int id)
+{
+ IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
+ if (IPhreeqcPtr)
+ {
+ if (IPhreeqcPtr->GetErrorOn())
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ return IPQ_BADINSTANCE;
+}
+
const char*
GetErrorString(int id)
{
@@ -884,6 +902,18 @@ SetErrorFileOn(int id, int value)
return IPQ_BADINSTANCE;
}
+IPQ_RESULT
+SetErrorOn(int id, int value)
+{
+ IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
+ if (IPhreeqcPtr)
+ {
+ IPhreeqcPtr->SetErrorOn(value != 0);
+ return IPQ_OK;
+ }
+ return IPQ_BADINSTANCE;
+}
+
IPQ_RESULT
SetErrorStringOn(int id, int value)
{
diff --git a/IPhreeqc_interface.F90 b/IPhreeqc_interface.F90
index 96ac3cf7..6c726c83 100644
--- a/IPhreeqc_interface.F90
+++ b/IPhreeqc_interface.F90
@@ -289,6 +289,22 @@ LOGICAL FUNCTION GetErrorFileOn(id)
return
END FUNCTION GetErrorFileOn
+LOGICAL FUNCTION GetErrorOn(id)
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ INTERFACE
+ INTEGER(KIND=C_INT) FUNCTION GetErrorOnF(id) &
+ BIND(C, NAME='GetErrorOnF')
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ INTEGER(KIND=C_INT), INTENT(in) :: id
+ END FUNCTION GetErrorOnF
+ END INTERFACE
+ INTEGER, INTENT(in) :: id
+ GetErrorOn = (GetErrorOnF(id) .ne. 0)
+ return
+END FUNCTION GetErrorOn
+
INTEGER FUNCTION GetErrorStringLineCount(id)
USE ISO_C_BINDING
IMPLICIT NONE
@@ -1049,6 +1065,26 @@ INTEGER FUNCTION SetErrorFileOn(id, error_file_on)
return
END FUNCTION SetErrorFileOn
+INTEGER FUNCTION SetErrorOn(id, error_on)
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ INTERFACE
+ INTEGER(KIND=C_INT) FUNCTION SetErrorOnF(id, error_on) &
+ BIND(C, NAME='SetErrorOnF')
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ INTEGER(KIND=C_INT), INTENT(in) :: id, error_on
+ END FUNCTION SetErrorOnF
+ END INTERFACE
+ INTEGER, INTENT(in) :: id
+ LOGICAL, INTENT(in) :: error_on
+ INTEGER :: tf = 0
+ tf = 0
+ if (error_on) tf = 1
+ SetErrorOn = SetErrorOnF(id, tf)
+ return
+END FUNCTION SetErrorOn
+
INTEGER FUNCTION SetErrorStringOn(id, error_string_on)
USE ISO_C_BINDING
IMPLICIT NONE
diff --git a/IPhreeqc_interface_F.cpp b/IPhreeqc_interface_F.cpp
index 8e406e82..ab1125de 100644
--- a/IPhreeqc_interface_F.cpp
+++ b/IPhreeqc_interface_F.cpp
@@ -145,6 +145,12 @@ GetErrorFileOnF(int *id)
return ::GetErrorFileOn(*id);
}
+int
+GetErrorOnF(int *id)
+{
+ return ::GetErrorOn(*id);
+}
+
/*
GetErrorStringF
*/
@@ -457,6 +463,12 @@ SetErrorFileOnF(int *id, int* error_file_on)
return ::SetErrorFileOn(*id, *error_file_on);
}
+IPQ_RESULT
+SetErrorOnF(int *id, int* error_on)
+{
+ return ::SetErrorOn(*id, *error_on);
+}
+
IPQ_RESULT
SetErrorStringOnF(int *id, int* error_string_on)
{
diff --git a/IPhreeqc_interface_F.h b/IPhreeqc_interface_F.h
index 660dcd38..d1c3e2a3 100644
--- a/IPhreeqc_interface_F.h
+++ b/IPhreeqc_interface_F.h
@@ -25,6 +25,7 @@
#define GetDumpStringOnF FC_FUNC (getdumpstringonf, GETDUMPSTRINGONF)
#define GetErrorFileNameF FC_FUNC (geterrorfilenamef, GETERRORFILENAMEF)
#define GetErrorFileOnF FC_FUNC (geterrorfileonf, GETERRORFILEONF)
+#define GetErrorOnF FC_FUNC (geterroronf, GETERRORONF)
#define GetErrorStringLineF FC_FUNC (geterrorstringlinef, GETERRORSTRINGLINEF)
#define GetErrorStringLineCountF FC_FUNC (geterrorstringlinecountf, GETERRORSTRINGLINECOUNTF)
#define GetErrorStringOnF FC_FUNC (geterrorstringonf, GETERRORSTRINGONF)
@@ -66,6 +67,7 @@
#define SetDumpStringOnF FC_FUNC (setdumpstringonf, SETDUMPSTRINGONF)
#define SetErrorFileNameF FC_FUNC (seterrorfilenamef, SETERRORFILENAMEF)
#define SetErrorFileOnF FC_FUNC (seterrorfileonf, SETERRORFILEONF)
+#define SetErrorOnF FC_FUNC (seterroronf, SETERRORONF)
#define SetErrorStringOnF FC_FUNC (seterrorstringonf, SETERRORSTRINGONF)
#define SetLogFileNameF FC_FUNC (setlogfilenamef, SETLOGFILENAMEF)
#define SetLogFileOnF FC_FUNC (setlogfileonf, SETLOGFILEONF)
@@ -99,6 +101,7 @@ extern "C" {
IPQ_DLL_EXPORT int GetDumpStringOnF(int *id);
IPQ_DLL_EXPORT void GetErrorFileNameF(int *id, char* filename, int* filename_length);
IPQ_DLL_EXPORT int GetErrorFileOnF(int *id);
+ IPQ_DLL_EXPORT int GetErrorOnF(int *id);
IPQ_DLL_EXPORT void GetErrorStringLineF(int *id, int* n, char* line, int* line_length);
IPQ_DLL_EXPORT int GetErrorStringLineCountF(int *id);
IPQ_DLL_EXPORT int GetErrorStringOnF(int *id);
@@ -144,6 +147,7 @@ extern "C" {
IPQ_DLL_EXPORT IPQ_RESULT SetDumpStringOnF(int *id, int* dump_string_on);
IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileNameF(int *id, char* fname);
IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileOnF(int *id, int* error_file_on);
+ IPQ_DLL_EXPORT IPQ_RESULT SetErrorOnF(int *id, int* error_on);
IPQ_DLL_EXPORT IPQ_RESULT SetErrorStringOnF(int *id, int* error_string_on);
IPQ_DLL_EXPORT IPQ_RESULT SetLogFileNameF(int *id, char* fname);
IPQ_DLL_EXPORT IPQ_RESULT SetLogFileOnF(int *id, int* log_file_on);
diff --git a/fimpl.h b/fimpl.h
index e01095f6..de9eb214 100644
--- a/fimpl.h
+++ b/fimpl.h
@@ -63,6 +63,10 @@ IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(geterrorfileon, GETERRORFILEON, geterr
{
return GetErrorFileOnF(id);
}
+IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(geterroron, GETERRORON, geterroron_, GETERRORON_)(int *id)
+{
+ return GetErrorOnF(id);
+}
// GetErrorString
IPQ_DLL_EXPORT void IPQ_DECL IPQ_CASE_UND(geterrorstringline, GETERRORSTRINGLINE, geterrorstringline_, GETERRORSTRINGLINE_)(int *id, int *n, char* line, size_t line_length)
{
@@ -232,6 +236,10 @@ IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(seterrorfileon, SETERRORFILEON, seterr
{
return SetErrorFileOnF(id, error_on);
}
+IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(seterroron, SETERRORON, seterroron_, SETERRORON_)(int *id, int *error_on)
+{
+ return SetErrorOnF(id, error_on);
+}
IPQ_DLL_EXPORT int IPQ_DECL IPQ_CASE_UND(seterrorstringon, SETERRORSTRINGON, seterrorstringon_, SETERRORSTRINGON_)(int *id, int *error_string_on)
{
return SetErrorStringOnF(id, error_string_on);
diff --git a/fwrap.cpp b/fwrap.cpp
index ae23e5dd..2c096f93 100644
--- a/fwrap.cpp
+++ b/fwrap.cpp
@@ -174,6 +174,12 @@ GetErrorFileOnF(int *id)
return ::GetErrorFileOn(*id);
}
+int
+GetErrorOnF(int *id)
+{
+ return ::GetErrorOn(*id);
+}
+
/*
GetErrorStringF
*/
@@ -539,6 +545,12 @@ SetErrorFileOnF(int *id, int* error_file_on)
return ::SetErrorFileOn(*id, *error_file_on);
}
+IPQ_RESULT
+SetErrorOnF(int *id, int* error_on)
+{
+ return ::SetErrorOn(*id, *error_on);
+}
+
IPQ_RESULT
SetErrorStringOnF(int *id, int* error_string_on)
{
diff --git a/fwrap.h b/fwrap.h
index 0f2740f5..c95758d0 100644
--- a/fwrap.h
+++ b/fwrap.h
@@ -25,6 +25,7 @@
#define GetDumpStringOnF FC_FUNC (getdumpstringonf, GETDUMPSTRINGONF)
#define GetErrorFileNameF FC_FUNC (geterrorfilenamef, GETERRORFILENAMEF)
#define GetErrorFileOnF FC_FUNC (geterrorfileonf, GETERRORFILEONF)
+#define GetErrorOnF FC_FUNC (geterroronf, GETERRORONF)
#define GetErrorStringLineF FC_FUNC (geterrorstringlinef, GETERRORSTRINGLINEF)
#define GetErrorStringLineCountF FC_FUNC (geterrorstringlinecountf, GETERRORSTRINGLINECOUNTF)
#define GetErrorStringOnF FC_FUNC (geterrorstringonf, GETERRORSTRINGONF)
@@ -66,6 +67,7 @@
#define SetDumpStringOnF FC_FUNC (setdumpstringonf, SETDUMPSTRINGONF)
#define SetErrorFileNameF FC_FUNC (seterrorfilenamef, SETERRORFILENAMEF)
#define SetErrorFileOnF FC_FUNC (seterrorfileonf, SETERRORFILEONF)
+#define SetErrorOnF FC_FUNC (seterroronf, SETERRORONF)
#define SetErrorStringOnF FC_FUNC (seterrorstringonf, SETERRORSTRINGONF)
#define SetLogFileNameF FC_FUNC (setlogfilenamef, SETLOGFILENAMEF)
#define SetLogFileOnF FC_FUNC (setlogfileonf, SETLOGFILEONF)
@@ -98,6 +100,7 @@ extern "C" {
int GetDumpStringOnF(int *id);
void GetErrorFileNameF(int *id, char* filename, size_t filename_length);
int GetErrorFileOnF(int *id);
+ int GetErrorOnF(int *id);
void GetErrorStringLineF(int *id, int* n, char* line, size_t line_length);
int GetErrorStringLineCountF(int *id);
int GetErrorStringOnF(int *id);
@@ -139,6 +142,7 @@ extern "C" {
IPQ_RESULT SetDumpStringOnF(int *id, int* dump_string_on);
IPQ_RESULT SetErrorFileNameF(int *id, char* fname, size_t fname_length);
IPQ_RESULT SetErrorFileOnF(int *id, int* error_file_on);
+ IPQ_RESULT SetErrorOnF(int *id, int* error_on);
IPQ_RESULT SetErrorStringOnF(int *id, int* error_string_on);
IPQ_RESULT SetLogFileNameF(int *id, char* fname, size_t fname_length);
IPQ_RESULT SetLogFileOnF(int *id, int* log_file_on);