renamed return values IPL_ to IPQ_

git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/class@4214 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2010-04-06 21:50:37 +00:00
parent ecaddcf49f
commit 0fa1c00856
7 changed files with 361 additions and 361 deletions

View File

@ -6,12 +6,12 @@
! ERROR RETURN TYPES
INTEGER,PARAMETER :: IPL_OK = 0
INTEGER,PARAMETER :: IPL_OUTOFMEMORY = -1
INTEGER,PARAMETER :: IPL_BADVARTYPE = -2
INTEGER,PARAMETER :: IPL_INVALIDARG = -3
INTEGER,PARAMETER :: IPL_INVALIDROW = -4
INTEGER,PARAMETER :: IPL_INVALIDCOL = -5
INTEGER,PARAMETER :: IPQ_OK = 0
INTEGER,PARAMETER :: IPQ_OUTOFMEMORY = -1
INTEGER,PARAMETER :: IPQ_BADVARTYPE = -2
INTEGER,PARAMETER :: IPQ_INVALIDARG = -3
INTEGER,PARAMETER :: IPQ_INVALIDROW = -4
INTEGER,PARAMETER :: IPQ_INVALIDCOL = -5
INTERFACE

View File

@ -8,14 +8,14 @@
/*! \brief Enumeration used to return error codes.
*/
typedef enum {
IPL_OK = 0,
IPL_OUTOFMEMORY = -1,
IPL_BADINSTANCE = -2,
IPL_BADVARTYPE = -3,
IPL_INVALIDARG = -4,
IPL_INVALIDROW = -5,
IPL_INVALIDCOL = -6,
} IPL_RESULT;
IPQ_OK = 0,
IPQ_OUTOFMEMORY = -1,
IPQ_BADINSTANCE = -2,
IPQ_BADVARTYPE = -3,
IPQ_INVALIDARG = -4,
IPQ_INVALIDROW = -5,
IPQ_INVALIDCOL = -6,
} IPQ_RESULT;
class IPhreeqc2;
@ -40,7 +40,7 @@ extern "C" {
int CreateIPhreeqc(void);
IPL_RESULT DestroyIPhreeqc(int id);
IPQ_RESULT DestroyIPhreeqc(int id);
/**
* Load the specified database file into phreeqc.
@ -133,7 +133,7 @@ extern "C" {
* </CODE>
* @endhtmlonly
*/
IPL_RESULT AccumulateLineM(int id, const char *line);
IPQ_RESULT AccumulateLineM(int id, const char *line);
/**
* Sets the selected_output flag on or off
@ -150,7 +150,7 @@ extern "C" {
* @endhtmlonly
*/
int GetSelectedOutputOnM(int id);
IPL_RESULT SetSelectedOutputOnM(int id, int value);
IPQ_RESULT SetSelectedOutputOnM(int id, int value);
/**
* Sets the output flag on or off
@ -167,7 +167,7 @@ extern "C" {
* @endhtmlonly
*/
int GetOutputOnM(int id);
IPL_RESULT SetOutputOnM(int id, int value);
IPQ_RESULT SetOutputOnM(int id, int value);
/**
* Sets the error flag on or off
@ -184,7 +184,7 @@ extern "C" {
* @endhtmlonly
*/
int GetErrorOnM(int id);
IPL_RESULT SetErrorOnM(int id, int value);
IPQ_RESULT SetErrorOnM(int id, int value);
/**
* Sets the log flag on or off
@ -201,7 +201,7 @@ extern "C" {
* @endhtmlonly
*/
int GetLogOnM(int id);
IPL_RESULT SetLogOnM(int id, int value);
IPQ_RESULT SetLogOnM(int id, int value);
/**
* Sets the dump flag on or off
@ -218,7 +218,7 @@ extern "C" {
* @endhtmlonly
*/
int GetDumpOnM(int id);
IPL_RESULT SetDumpOnM(int id, int value);
IPQ_RESULT SetDumpOnM(int id, int value);
/**
* Sets the dump string flag on or off
@ -235,7 +235,7 @@ extern "C" {
* @endhtmlonly
*/
int GetDumpStringOnM(int id);
IPL_RESULT SetDumpStringOnM(int id, int value);
IPQ_RESULT SetDumpStringOnM(int id, int value);
/**
* Runs the accumulated input sent to AccumulateLine.
@ -489,7 +489,7 @@ Headings
* </CODE>
* @endhtmlonly
*/
IPL_RESULT GetSelectedOutputValueM(int id, int row, int col, VAR* pVAR);
IPQ_RESULT GetSelectedOutputValueM(int id, int row, int col, VAR* pVAR);
/**
* TODO
@ -583,7 +583,7 @@ class IPhreeqcLib
{
public:
static int CreateIPhreeqc(void);
static IPL_RESULT DestroyIPhreeqc(int n);
static IPQ_RESULT DestroyIPhreeqc(int n);
static IPhreeqc2* GetInstance(int n);
private:

View File

@ -10,7 +10,7 @@ CreateIPhreeqc(void)
return IPhreeqcLib::CreateIPhreeqc();
}
IPL_RESULT
IPQ_RESULT
DestroyIPhreeqc(int id)
{
return IPhreeqcLib::DestroyIPhreeqc(id);
@ -24,7 +24,7 @@ LoadDatabaseM(int id, const char* filename)
{
return IPhreeqcPtr->LoadDatabase(filename);
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -35,7 +35,7 @@ LoadDatabaseStringM(int id, const char* input)
{
return IPhreeqcPtr->LoadDatabaseString(input);
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -45,9 +45,9 @@ UnLoadDatabaseM(int id)
if (IPhreeqcPtr)
{
IPhreeqcPtr->UnLoadDatabase();
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
void
@ -147,7 +147,7 @@ GetComponentM(int id, int n)
return err_msg;
}
IPL_RESULT
IPQ_RESULT
AccumulateLineM(int id, const char *line)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
@ -156,14 +156,14 @@ AccumulateLineM(int id, const char *line)
switch (IPhreeqcPtr->AccumulateLine(line))
{
case VR_OK:
return IPL_OK;
return IPQ_OK;
case VR_OUTOFMEMORY:
return IPL_OUTOFMEMORY;
return IPQ_OUTOFMEMORY;
default:
assert(false);
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -181,19 +181,19 @@ GetSelectedOutputOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetSelectedOutputOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetSelectedOutputOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -211,19 +211,19 @@ GetOutputOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetOutputOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetOutputOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -241,19 +241,19 @@ GetErrorOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetErrorOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetErrorOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -271,19 +271,19 @@ GetLogOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetLogOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetLogOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
@ -302,19 +302,19 @@ GetDumpOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetDumpOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetDumpOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -332,19 +332,19 @@ GetDumpStringOnM(int id)
return 0;
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
SetDumpStringOnM(int id, int value)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
if (IPhreeqcPtr)
{
IPhreeqcPtr->SetDumpStringOn(value != 0);
return IPL_OK;
return IPQ_OK;
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -355,7 +355,7 @@ RunAccumulatedM(int id)
{
return IPhreeqcPtr->RunAccumulated();
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -366,7 +366,7 @@ RunFileM(int id, const char* filename)
{
return IPhreeqcPtr->RunFile(filename);
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -377,7 +377,7 @@ RunStringM(int id, const char* input)
{
return IPhreeqcPtr->RunString(input);
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -388,7 +388,7 @@ GetSelectedOutputRowCountM(int id)
{
return IPhreeqcPtr->GetSelectedOutputRowCount();
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -399,11 +399,11 @@ GetSelectedOutputColumnCountM(int id)
{
return IPhreeqcPtr->GetSelectedOutputColumnCount();
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
IPL_RESULT
IPQ_RESULT
GetSelectedOutputValueM(int id, int row, int col, VAR* pVAR)
{
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
@ -411,17 +411,17 @@ GetSelectedOutputValueM(int id, int row, int col, VAR* pVAR)
{
switch(IPhreeqcPtr->GetSelectedOutputValue(row, col, pVAR))
{
case VR_OK: return IPL_OK;
case VR_OUTOFMEMORY: return IPL_OUTOFMEMORY;
case VR_BADVARTYPE: return IPL_BADVARTYPE;
case VR_INVALIDARG: return IPL_INVALIDARG;
case VR_INVALIDROW: return IPL_INVALIDROW;
case VR_INVALIDCOL: return IPL_INVALIDCOL;
case VR_OK: return IPQ_OK;
case VR_OUTOFMEMORY: return IPQ_OUTOFMEMORY;
case VR_BADVARTYPE: return IPQ_BADVARTYPE;
case VR_INVALIDARG: return IPQ_INVALIDARG;
case VR_INVALIDROW: return IPQ_INVALIDROW;
case VR_INVALIDCOL: return IPQ_INVALIDCOL;
default:
assert(false);
}
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
int
@ -432,7 +432,7 @@ AddErrorM(int id, const char* error_msg)
{
return (int)IPhreeqcPtr->AddError(error_msg);
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
void
@ -456,7 +456,7 @@ GetErrorLineCountM(int id)
{
return (int)IPhreeqcPtr->GetErrorLineCount();
}
return IPL_BADINSTANCE;
return IPQ_BADINSTANCE;
}
const char*
@ -478,7 +478,7 @@ size_t IPhreeqcLib::InstancesIndex = 0;
int
IPhreeqcLib::CreateIPhreeqc(void)
{
int n = IPL_OUTOFMEMORY;
int n = IPQ_OUTOFMEMORY;
try
{
IPhreeqc2* IPhreeqcPtr = new IPhreeqc2;
@ -495,15 +495,15 @@ IPhreeqcLib::CreateIPhreeqc(void)
}
catch(...)
{
return IPL_OUTOFMEMORY;
return IPQ_OUTOFMEMORY;
}
return n;
}
IPL_RESULT
IPQ_RESULT
IPhreeqcLib::DestroyIPhreeqc(int id)
{
IPL_RESULT retval = IPL_BADINSTANCE;
IPQ_RESULT retval = IPQ_BADINSTANCE;
if (id >= 0)
{
std::map<size_t, IPhreeqc2*>::iterator it = IPhreeqcLib::Instances.find(size_t(id));
@ -511,7 +511,7 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
{
delete (*it).second;
IPhreeqcLib::Instances.erase(it);
retval = IPL_OK;
retval = IPQ_OK;
}
}
return retval;

View File

@ -96,17 +96,17 @@ LoadDatabaseStringF(int *id, char* input, unsigned int input_length)
}
IPL_RESULT
IPQ_RESULT
AccumulateLineF(int *id, char *line, unsigned int line_length)
{
IPL_RESULT n;
IPQ_RESULT n;
char* cline;
cline = f2cstring(line, line_length);
if (!cline)
{
::AddErrorM(*id, "AccumulateLine: Out of memory.\n");
return IPL_OUTOFMEMORY;
return IPQ_OUTOFMEMORY;
}
n = ::AccumulateLineM(*id, cline);
@ -114,37 +114,37 @@ AccumulateLineF(int *id, char *line, unsigned int line_length)
return n;
}
IPL_RESULT
IPQ_RESULT
SetSelectedOutputOnF(int *id, int* sel_on)
{
return ::SetSelectedOutputOnM(*id, *sel_on);
}
IPL_RESULT
IPQ_RESULT
SetOutputOnF(int *id, int* output_on)
{
return ::SetOutputOnM(*id, *output_on);
}
IPL_RESULT
IPQ_RESULT
SetErrorOnF(int *id, int* error_on)
{
return ::SetErrorOnM(*id, *error_on);
}
IPL_RESULT
IPQ_RESULT
SetLogOnF(int *id, int* log_on)
{
return ::SetLogOnM(*id, *log_on);
}
IPL_RESULT
IPQ_RESULT
SetDumpOnF(int *id, int* dump_on)
{
return ::SetDumpOnM(*id, *dump_on);
}
IPL_RESULT
IPQ_RESULT
SetDumpStringOnF(int *id, int* dump_string_on)
{
return ::SetDumpStringOnM(*id, *dump_string_on);
@ -243,10 +243,10 @@ GetSelectedOutputColumnCountF(int *id)
return ::GetSelectedOutputColumnCountM(*id);
}
IPL_RESULT
IPQ_RESULT
GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length)
{
IPL_RESULT result;
IPQ_RESULT result;
VAR v;
VarInit(&v);
char buffer[100];

View File

@ -10,7 +10,7 @@ extern "C" {
int LoadDatabaseF(int *id, char* filename, unsigned int filename_length);
IPL_RESULT AccumulateLineF(int *id, char *line, unsigned int line_length);
IPQ_RESULT AccumulateLineF(int *id, char *line, unsigned int line_length);
int RunAccumulatedF(int *id);
@ -22,19 +22,19 @@ extern "C" {
int GetSelectedOutputColumnCountF(int *id);
IPL_RESULT GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length);
IPQ_RESULT GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length);
IPL_RESULT SetSelectedOutputOnF(int *id, int* selected_output_on);
IPQ_RESULT SetSelectedOutputOnF(int *id, int* selected_output_on);
IPL_RESULT SetOutputOnF(int *id, int* output_on);
IPQ_RESULT SetOutputOnF(int *id, int* output_on);
IPL_RESULT SetErrorOnF(int *id, int* error_on);
IPQ_RESULT SetErrorOnF(int *id, int* error_on);
IPL_RESULT SetLogOnF(int *id, int* log_on);
IPQ_RESULT SetLogOnF(int *id, int* log_on);
IPL_RESULT SetDumpOnF(int *id, int* dump_on);
IPQ_RESULT SetDumpOnF(int *id, int* dump_on);
IPL_RESULT SetDumpStringOnF(int *id, int* dump_string_on);
IPQ_RESULT SetDumpStringOnF(int *id, int* dump_string_on);
int GetDumpLineCountF(int *id);

View File

@ -67,7 +67,7 @@
DO 30 j=1,cols
iresult = GetSelectedOutputValue(id, i, j, vtype,
& dvalue, svalue)
IF (iresult.EQ.IPL_OK) THEN
IF (iresult.EQ.IPQ_OK) THEN
IF (vtype.eq.TT_EMPTY) THEN
PRINT 50, ' ', ACHAR(9)
ELSEIF(vtype.eq.TT_DOUBLE) THEN
@ -77,9 +77,9 @@
PRINT 50, svalue(1:len-1), ACHAR(9)
ENDIF
ELSE
IF (iresult.eq.IPL_INVALIDROW) THEN
IF (iresult.eq.IPQ_INVALIDROW) THEN
PRINT 50, 'INVROW', ACHAR(9)
ELSEIF (iresult.eq.IPL_INVALIDCOL) THEN
ELSEIF (iresult.eq.IPQ_INVALIDCOL) THEN
PRINT 50, 'INVCOL', ACHAR(9)
ELSE
PRINT 50, 'ERROR', ACHAR(9)

File diff suppressed because it is too large Load Diff