From c30ed6369aa4b2017ede44e41529554cc6cf0917 Mon Sep 17 00:00:00 2001 From: Scott R Charlton Date: Tue, 18 May 2010 04:35:20 +0000 Subject: [PATCH] resorted renamed methods git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@4413 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- IPhreeqc.cpp | 1015 +++++++++++++++++++++++------------------------ IPhreeqcF.f | 176 ++++---- IPhreeqcLib.cpp | 154 +++---- fwrap.cpp | 80 ++-- fwrap2.cpp | 26 +- fwrap3.cpp | 28 +- 6 files changed, 756 insertions(+), 723 deletions(-) diff --git a/IPhreeqc.cpp b/IPhreeqc.cpp index baf787c2..3bb16849 100644 --- a/IPhreeqc.cpp +++ b/IPhreeqc.cpp @@ -62,6 +62,513 @@ IPhreeqc::~IPhreeqc(void) delete this->PhreeqcPtr; } +VRESULT IPhreeqc::AccumulateLine(const char *line) +{ + try + { + if (this->ClearAccumulatedLinesOnNextAccumulate) + { + this->ClearAccumulatedLines(); + this->ClearAccumulatedLinesOnNextAccumulate = false; + } + + this->ErrorReporter->Clear(); + this->WarningReporter->Clear(); + this->StringInput.append(line); + this->StringInput.append("\n"); + return VR_OK; + } + catch (...) + { + this->AddError("AccumulateLine: An unhandled exception occured.\n"); + } + return VR_OUTOFMEMORY; +} + +size_t IPhreeqc::AddError(const char* error_msg) +{ + return this->ErrorReporter->AddError(error_msg); +} + +size_t IPhreeqc::AddWarning(const char* warn_msg) +{ + return this->WarningReporter->AddError(warn_msg); +} + +void IPhreeqc::ClearAccumulatedLines(void) +{ + this->StringInput.erase(); +} + +const std::string& IPhreeqc::GetAccumulatedLines(void) +{ + return this->StringInput; +} + +const char* IPhreeqc::GetComponent(int n) +{ + static const char empty[] = ""; + this->Components = this->ListComponents(); + if (n < 0 || n >= (int)this->Components.size()) + { + return empty; + } + std::list< std::string >::iterator it = this->Components.begin(); + for(int i = 0; i < n; ++i) + { + ++it; + } + return (*it).c_str(); +} + +size_t IPhreeqc::GetComponentCount(void) +{ + std::list< std::string > comps; + this->PhreeqcPtr->list_components(comps); + return comps.size(); +} + +bool IPhreeqc::GetDumpFileOn(void)const +{ + return this->DumpOn; +} + +const char* IPhreeqc::GetDumpString(void) +{ + static const char err_msg[] = "GetDumpString: DumpStringOn not set.\n"; + if (!this->DumpStringOn) + { + return err_msg; + } + return this->DumpString.c_str(); +} + +const char* IPhreeqc::GetDumpStringLine(int n) +{ + static const char empty[] = ""; + if (n < 0 || n >= this->GetDumpStringLineCount()) + { + return empty; + } + return this->DumpLines[n].c_str(); +} + +int IPhreeqc::GetDumpStringLineCount(void)const +{ + return (int)this->DumpLines.size(); +} + +bool IPhreeqc::GetDumpStringOn(void)const +{ + return this->DumpStringOn; +} + +bool IPhreeqc::GetErrorFileOn(void)const +{ + return this->ErrorOn; +} + +const char* IPhreeqc::GetErrorString(void) +{ + this->ErrorString = ((CErrorReporter*)this->ErrorReporter)->GetOS()->str(); + return this->ErrorString.c_str(); +} + +const char* IPhreeqc::GetErrorStringLine(int n) +{ + static const char empty[] = ""; + if (n < 0 || n >= this->GetErrorStringLineCount()) + { + return empty; + } + return this->ErrorLines[n].c_str(); +} + +int IPhreeqc::GetErrorStringLineCount(void)const +{ + return (int)this->ErrorLines.size(); +} + +bool IPhreeqc::GetLogFileOn(void)const +{ + return this->LogOn; +} + +bool IPhreeqc::GetOutputFileOn(void)const +{ + return this->OutputOn; +} + +int IPhreeqc::GetSelectedOutputColumnCount(void)const +{ + return (int)this->SelectedOutput->GetColCount(); +} + +bool IPhreeqc::GetSelectedOutputFileOn(void)const +{ + return this->SelectedOutputOn; +} + +int IPhreeqc::GetSelectedOutputRowCount(void)const +{ + return (int)this->SelectedOutput->GetRowCount(); +} + +VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR) +{ + this->ErrorReporter->Clear(); + if (!pVAR) + { + this->AddError("GetSelectedOutputValue: VR_INVALIDARG pVAR is NULL.\n"); + this->update_errors(); + return VR_INVALIDARG; + } + + VRESULT v = this->SelectedOutput->Get(row, col, pVAR); + switch (v) + { + case VR_OK: + break; + case VR_OUTOFMEMORY: + this->AddError("GetSelectedOutputValue: VR_OUTOFMEMORY Out of memory.\n"); + break; + case VR_BADVARTYPE: + this->AddError("GetSelectedOutputValue: VR_BADVARTYPE pVar must be initialized(VarInit) and/or cleared(VarClear).\n"); + break; + case VR_INVALIDARG: + // not possible + break; + case VR_INVALIDROW: + this->AddError("GetSelectedOutputValue: VR_INVALIDROW Row index out of range.\n"); + break; + case VR_INVALIDCOL: + this->AddError("GetSelectedOutputValue: VR_INVALIDCOL Column index out of range.\n"); + break; + } + this->update_errors(); + return v; +} + +const char* IPhreeqc::GetWarningString(void) +{ + this->WarningString = ((CErrorReporter*)this->WarningReporter)->GetOS()->str(); + return this->WarningString.c_str(); +} + +const char* IPhreeqc::GetWarningStringLine(int n) +{ + static const char empty[] = ""; + if (n < 0 || n >= this->GetWarningStringLineCount()) + { + return empty; + } + return this->WarningLines[n].c_str(); +} + +int IPhreeqc::GetWarningStringLineCount(void)const +{ + return (int)this->WarningLines.size(); +} + +std::list< std::string > IPhreeqc::ListComponents(void) +{ + std::list< std::string > comps; + this->PhreeqcPtr->list_components(comps); + return comps; +} + +int IPhreeqc::LoadDatabase(const char* filename) +{ + try + { + // cleanup + // + this->UnLoadDatabase(); + this->SelectedOutput->Clear(); + + // open file + // + std::ifstream ifs; + ifs.open(filename); + + if (!ifs.is_open()) + { + std::ostringstream oss; + oss << "LoadDatabase: Unable to open:" << "\"" << filename << "\"."; + this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws + } + + // read input + // + this->PhreeqcPtr->read_database(istream_getc, &ifs); + } + catch (IPhreeqcStop) + { + this->PhreeqcPtr->close_input_files(); + } + catch (...) + { + const char *errmsg = "LoadDatabase: An unhandled exception occured.\n"; + try + { + this->PhreeqcPtr->error_msg(errmsg, STOP); // throws IPhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + } + + this->DatabaseLoaded = (this->PhreeqcPtr->input_error == 0); + return this->PhreeqcPtr->input_error; +} + +int IPhreeqc::LoadDatabaseString(const char* input) +{ + try + { + // cleanup + // + this->UnLoadDatabase(); + + this->SelectedOutput->Clear(); + + std::string s(input); + std::istringstream iss(s); + + // read input + // + this->PhreeqcPtr->read_database(istream_getc, &iss); + } + catch (IPhreeqcStop) + { + this->PhreeqcPtr->close_input_files(); + } + catch(...) + { + const char *errmsg = "LoadDatabaseString: An unhandled exception occured.\n"; + try + { + this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + } + + this->DatabaseLoaded = (this->PhreeqcPtr->input_error == 0); + return this->PhreeqcPtr->input_error; +} + +void IPhreeqc::OutputAccumulatedLines(void) +{ + std::cout << this->StringInput.c_str() << std::endl; +} + +void IPhreeqc::OutputErrorString(void) +{ + std::cout << this->GetErrorString() << std::endl; +} + +void IPhreeqc::OutputWarningString(void) +{ + std::cout << this->GetWarningString() << std::endl; +} + +int IPhreeqc::RunAccumulated(void) +{ + static const char *sz_routine = "RunAccumulated"; + try + { + // this may throw + this->check_database(sz_routine); + + this->PhreeqcPtr->input_error = 0; + + // create input stream + std::istringstream iss(this->GetAccumulatedLines()); + + // this may throw + this->do_run(sz_routine, &iss, NULL, NULL, NULL, NULL); + } + catch (IPhreeqcStop) + { + // do nothing + } + catch(...) + { + const char *errmsg = "RunAccumulated: An unhandled exception occured.\n"; + try + { + this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + } + + this->ClearAccumulatedLinesOnNextAccumulate = true; + this->PhreeqcPtr->close_output_files(); + this->update_errors(); + + return this->PhreeqcPtr->input_error; +} + +int IPhreeqc::RunFile(const char* filename) +{ + static const char *sz_routine = "RunFile"; + try + { + // this may throw + this->check_database(sz_routine); + + this->PhreeqcPtr->input_error = 0; + + // open file + // + std::ifstream ifs; + ifs.open(filename); + if (!ifs.is_open()) + { + std::ostringstream oss; + oss << "RunFile: Unable to open:" << "\"" << filename << "\"."; + this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws + } + + // this may throw + this->do_run(sz_routine, &ifs, NULL, NULL, NULL, NULL); + } + catch (IPhreeqcStop) + { + this->PhreeqcPtr->close_input_files(); + } + catch(...) + { + const char *errmsg = "RunFile: An unhandled exception occured.\n"; + try + { + this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + } + + this->PhreeqcPtr->close_output_files(); + this->update_errors(); + + return this->PhreeqcPtr->input_error; +} + +int IPhreeqc::RunString(const char* input) +{ + static const char *sz_routine = "RunString"; + try + { + // this may throw + this->check_database(sz_routine); + + this->PhreeqcPtr->input_error = 0; + + // create input stream + std::string s(input); + std::istringstream iss(s); + + // this may throw + this->do_run(sz_routine, &iss, NULL, NULL, NULL, NULL); + } + catch (IPhreeqcStop) + { + this->PhreeqcPtr->close_input_files(); + } + catch(...) + { + const char *errmsg = "RunString: An unhandled exception occured.\n"; + try + { + this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + } + + this->PhreeqcPtr->close_output_files(); + this->update_errors(); + + return this->PhreeqcPtr->input_error; +} + +void IPhreeqc::SetDumpFileOn(bool bValue) +{ + this->DumpOn = bValue; +} + +void IPhreeqc::SetDumpStringOn(bool bValue) +{ + this->DumpStringOn = bValue; +} + +void IPhreeqc::SetErrorFileOn(bool bValue) +{ + this->ErrorOn = bValue; +} + +void IPhreeqc::SetLogFileOn(bool bValue) +{ + this->LogOn = bValue; +} + +void IPhreeqc::SetOutputFileOn(bool bValue) +{ + this->OutputOn = bValue; +} + +void IPhreeqc::SetSelectedOutputFileOn(bool bValue) +{ + this->SelectedOutputOn = bValue; +} + +void IPhreeqc::UnLoadDatabase(void) +{ + // init IPhreeqc + // + this->DatabaseLoaded = false; + + // clear error state + // + ASSERT(this->ErrorReporter); + this->ErrorReporter->Clear(); + this->ErrorString.clear(); + + // clear warning state + // + ASSERT(this->WarningReporter); + this->WarningReporter->Clear(); + this->WarningString.clear(); + + // clear selectedoutput + // + ASSERT(this->SelectedOutput); + this->SelectedOutput->Clear(); + + // clear dump string + // + this->DumpString.clear(); + this->DumpLines.clear(); + + // initialize phreeqc + // + this->PhreeqcPtr->clean_up(); + this->PhreeqcPtr->add_output_callback(IPhreeqc::handler, this); + this->PhreeqcPtr->do_initialize(); + this->PhreeqcPtr->input_error = 0; +} + int IPhreeqc::handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args) { int n = OK; @@ -263,222 +770,6 @@ int IPhreeqc::EndRow(void) return this->SelectedOutput->EndRow(); } -void IPhreeqc::ClearAccumulatedLines(void) -{ - this->StringInput.erase(); -} - -size_t IPhreeqc::AddError(const char* error_msg) -{ - return this->ErrorReporter->AddError(error_msg); -} - -size_t IPhreeqc::AddWarning(const char* warn_msg) -{ - return this->WarningReporter->AddError(warn_msg); -} - -const std::string& IPhreeqc::GetAccumulatedLines(void) -{ - return this->StringInput; -} - -void IPhreeqc::OutputErrorString(void) -{ - std::cout << this->GetErrorString() << std::endl; -} - -void IPhreeqc::OutputWarningString(void) -{ - std::cout << this->GetWarningString() << std::endl; -} - -void IPhreeqc::OutputAccumulatedLines(void) -{ - std::cout << this->StringInput.c_str() << std::endl; -} - - -int IPhreeqc::LoadDatabase(const char* filename) -{ - try - { - // cleanup - // - this->UnLoadDatabase(); - this->SelectedOutput->Clear(); - - // open file - // - std::ifstream ifs; - ifs.open(filename); - - if (!ifs.is_open()) - { - std::ostringstream oss; - oss << "LoadDatabase: Unable to open:" << "\"" << filename << "\"."; - this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws - } - - // read input - // - this->PhreeqcPtr->read_database(istream_getc, &ifs); - } - catch (IPhreeqcStop) - { - this->PhreeqcPtr->close_input_files(); - } - catch (...) - { - const char *errmsg = "LoadDatabase: An unhandled exception occured.\n"; - try - { - this->PhreeqcPtr->error_msg(errmsg, STOP); // throws IPhreeqcStop - } - catch (IPhreeqcStop) - { - // do nothing - } - } - - this->DatabaseLoaded = (this->PhreeqcPtr->input_error == 0); - return this->PhreeqcPtr->input_error; -} - -int IPhreeqc::LoadDatabaseString(const char* input) -{ - try - { - // cleanup - // - this->UnLoadDatabase(); - - this->SelectedOutput->Clear(); - - std::string s(input); - std::istringstream iss(s); - - // read input - // - this->PhreeqcPtr->read_database(istream_getc, &iss); - } - catch (IPhreeqcStop) - { - this->PhreeqcPtr->close_input_files(); - } - catch(...) - { - const char *errmsg = "LoadDatabaseString: An unhandled exception occured.\n"; - try - { - this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop - } - catch (IPhreeqcStop) - { - // do nothing - } - } - - this->DatabaseLoaded = (this->PhreeqcPtr->input_error == 0); - return this->PhreeqcPtr->input_error; -} - -void IPhreeqc::UnLoadDatabase(void) -{ - // init IPhreeqc - // - this->DatabaseLoaded = false; - - // clear error state - // - ASSERT(this->ErrorReporter); - this->ErrorReporter->Clear(); - this->ErrorString.clear(); - - // clear warning state - // - ASSERT(this->WarningReporter); - this->WarningReporter->Clear(); - this->WarningString.clear(); - - // clear selectedoutput - // - ASSERT(this->SelectedOutput); - this->SelectedOutput->Clear(); - - // clear dump string - // - this->DumpString.clear(); - this->DumpLines.clear(); - - // initialize phreeqc - // - this->PhreeqcPtr->clean_up(); - this->PhreeqcPtr->add_output_callback(IPhreeqc::handler, this); - this->PhreeqcPtr->do_initialize(); - this->PhreeqcPtr->input_error = 0; -} - -bool IPhreeqc::GetOutputFileOn(void)const -{ - return this->OutputOn; -} - -void IPhreeqc::SetOutputFileOn(bool bValue) -{ - this->OutputOn = bValue; -} - -bool IPhreeqc::GetSelectedOutputFileOn(void)const -{ - return this->SelectedOutputOn; -} - -void IPhreeqc::SetSelectedOutputFileOn(bool bValue) -{ - this->SelectedOutputOn = bValue; -} - -bool IPhreeqc::GetLogFileOn(void)const -{ - return this->LogOn; -} - -void IPhreeqc::SetLogFileOn(bool bValue) -{ - this->LogOn = bValue; -} - -bool IPhreeqc::GetDumpFileOn(void)const -{ - return this->DumpOn; -} - -void IPhreeqc::SetDumpFileOn(bool bValue) -{ - this->DumpOn = bValue; -} - -bool IPhreeqc::GetDumpStringOn(void)const -{ - return this->DumpStringOn; -} - -void IPhreeqc::SetDumpStringOn(bool bValue) -{ - this->DumpStringOn = bValue; -} - -bool IPhreeqc::GetErrorFileOn(void)const -{ - return this->ErrorOn; -} - -void IPhreeqc::SetErrorFileOn(bool bValue) -{ - this->ErrorOn = bValue; -} - void IPhreeqc::AddSelectedOutput(const char* name, const char* format, va_list argptr) { int bInt; @@ -653,29 +944,6 @@ void IPhreeqc::AddSelectedOutput(const char* name, const char* format, va_list a } } -const char* IPhreeqc::GetErrorString(void) -{ - this->ErrorString = ((CErrorReporter*)this->ErrorReporter)->GetOS()->str(); - return this->ErrorString.c_str(); -} - -const char* IPhreeqc::GetWarningString(void) -{ - this->WarningString = ((CErrorReporter*)this->WarningReporter)->GetOS()->str(); - return this->WarningString.c_str(); -} - -const char* IPhreeqc::GetDumpString(void) -{ - static const char err_msg[] = "GetDumpString: DumpStringOn not set.\n"; - if (!this->DumpStringOn) - { - return err_msg; - } - return this->DumpString.c_str(); -} - - void IPhreeqc::check_database(const char* sz_routine) { this->ErrorReporter->Clear(); @@ -1022,246 +1290,6 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, FILE* fp, PFN_P this->update_errors(); } -VRESULT IPhreeqc::AccumulateLine(const char *line) -{ - try - { - if (this->ClearAccumulatedLinesOnNextAccumulate) - { - this->ClearAccumulatedLines(); - this->ClearAccumulatedLinesOnNextAccumulate = false; - } - - this->ErrorReporter->Clear(); - this->WarningReporter->Clear(); - this->StringInput.append(line); - this->StringInput.append("\n"); - return VR_OK; - } - catch (...) - { - this->AddError("AccumulateLine: An unhandled exception occured.\n"); - } - return VR_OUTOFMEMORY; -} - -int IPhreeqc::RunAccumulated(void) -{ - static const char *sz_routine = "RunAccumulated"; - try - { - // this may throw - this->check_database(sz_routine); - - this->PhreeqcPtr->input_error = 0; - - // create input stream - std::istringstream iss(this->GetAccumulatedLines()); - - // this may throw - this->do_run(sz_routine, &iss, NULL, NULL, NULL, NULL); - } - catch (IPhreeqcStop) - { - // do nothing - } - catch(...) - { - const char *errmsg = "RunAccumulated: An unhandled exception occured.\n"; - try - { - this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop - } - catch (IPhreeqcStop) - { - // do nothing - } - } - - this->ClearAccumulatedLinesOnNextAccumulate = true; - this->PhreeqcPtr->close_output_files(); - this->update_errors(); - - return this->PhreeqcPtr->input_error; -} - -int IPhreeqc::RunFile(const char* filename) -{ - static const char *sz_routine = "RunFile"; - try - { - // this may throw - this->check_database(sz_routine); - - this->PhreeqcPtr->input_error = 0; - - // open file - // - std::ifstream ifs; - ifs.open(filename); - if (!ifs.is_open()) - { - std::ostringstream oss; - oss << "RunFile: Unable to open:" << "\"" << filename << "\"."; - this->PhreeqcPtr->error_msg(oss.str().c_str(), STOP); // throws - } - - // this may throw - this->do_run(sz_routine, &ifs, NULL, NULL, NULL, NULL); - } - catch (IPhreeqcStop) - { - this->PhreeqcPtr->close_input_files(); - } - catch(...) - { - const char *errmsg = "RunFile: An unhandled exception occured.\n"; - try - { - this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop - } - catch (IPhreeqcStop) - { - // do nothing - } - } - - this->PhreeqcPtr->close_output_files(); - this->update_errors(); - - return this->PhreeqcPtr->input_error; -} - -int IPhreeqc::RunString(const char* input) -{ - static const char *sz_routine = "RunString"; - try - { - // this may throw - this->check_database(sz_routine); - - this->PhreeqcPtr->input_error = 0; - - // create input stream - std::string s(input); - std::istringstream iss(s); - - // this may throw - this->do_run(sz_routine, &iss, NULL, NULL, NULL, NULL); - } - catch (IPhreeqcStop) - { - this->PhreeqcPtr->close_input_files(); - } - catch(...) - { - const char *errmsg = "RunString: An unhandled exception occured.\n"; - try - { - this->PhreeqcPtr->error_msg(errmsg, STOP); // throws PhreeqcStop - } - catch (IPhreeqcStop) - { - // do nothing - } - } - - this->PhreeqcPtr->close_output_files(); - this->update_errors(); - - return this->PhreeqcPtr->input_error; -} - -int IPhreeqc::GetSelectedOutputRowCount(void)const -{ - return (int)this->SelectedOutput->GetRowCount(); -} - -int IPhreeqc::GetSelectedOutputColumnCount(void)const -{ - return (int)this->SelectedOutput->GetColCount(); -} - -VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR) -{ - this->ErrorReporter->Clear(); - if (!pVAR) - { - this->AddError("GetSelectedOutputValue: VR_INVALIDARG pVAR is NULL.\n"); - this->update_errors(); - return VR_INVALIDARG; - } - - VRESULT v = this->SelectedOutput->Get(row, col, pVAR); - switch (v) - { - case VR_OK: - break; - case VR_OUTOFMEMORY: - this->AddError("GetSelectedOutputValue: VR_OUTOFMEMORY Out of memory.\n"); - break; - case VR_BADVARTYPE: - this->AddError("GetSelectedOutputValue: VR_BADVARTYPE pVar must be initialized(VarInit) and/or cleared(VarClear).\n"); - break; - case VR_INVALIDARG: - // not possible - break; - case VR_INVALIDROW: - this->AddError("GetSelectedOutputValue: VR_INVALIDROW Row index out of range.\n"); - break; - case VR_INVALIDCOL: - this->AddError("GetSelectedOutputValue: VR_INVALIDCOL Column index out of range.\n"); - break; - } - this->update_errors(); - return v; -} - -int IPhreeqc::GetDumpStringLineCount(void)const -{ - return (int)this->DumpLines.size(); -} - -const char* IPhreeqc::GetDumpStringLine(int n) -{ - static const char empty[] = ""; - if (n < 0 || n >= this->GetDumpStringLineCount()) - { - return empty; - } - return this->DumpLines[n].c_str(); -} - -int IPhreeqc::GetErrorStringLineCount(void)const -{ - return (int)this->ErrorLines.size(); -} - -const char* IPhreeqc::GetErrorStringLine(int n) -{ - static const char empty[] = ""; - if (n < 0 || n >= this->GetErrorStringLineCount()) - { - return empty; - } - return this->ErrorLines[n].c_str(); -} - -int IPhreeqc::GetWarningStringLineCount(void)const -{ - return (int)this->WarningLines.size(); -} - -const char* IPhreeqc::GetWarningStringLine(int n) -{ - static const char empty[] = ""; - if (n < 0 || n >= this->GetWarningStringLineCount()) - { - return empty; - } - return this->WarningLines[n].c_str(); -} - void IPhreeqc::update_errors(void) { this->ErrorLines.clear(); @@ -1289,32 +1317,3 @@ void IPhreeqc::update_errors(void) } } -std::list< std::string > IPhreeqc::ListComponents(void) -{ - std::list< std::string > comps; - this->PhreeqcPtr->list_components(comps); - return comps; -} - -size_t IPhreeqc::GetComponentCount(void) -{ - std::list< std::string > comps; - this->PhreeqcPtr->list_components(comps); - return comps.size(); -} - -const char* IPhreeqc::GetComponent(int n) -{ - static const char empty[] = ""; - this->Components = this->ListComponents(); - if (n < 0 || n >= (int)this->Components.size()) - { - return empty; - } - std::list< std::string >::iterator it = this->Components.begin(); - for(int i = 0; i < n; ++i) - { - ++it; - } - return (*it).c_str(); -} diff --git a/IPhreeqcF.f b/IPhreeqcF.f index a08350ef..aaa61f9a 100644 --- a/IPhreeqcF.f +++ b/IPhreeqcF.f @@ -7,6 +7,8 @@ INTEGER(KIND=4) :: AccumulateLineF AccumulateLine = AccumulateLineF(ID,LINE) END FUNCTION AccumulateLine +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! AddError !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION ClearAccumulatedLines(ID) IMPLICIT NONE @@ -48,6 +50,20 @@ INTEGER(KIND=4) :: GetComponentCountF GetComponentCount = GetComponentCountF(ID) END FUNCTION GetComponentCount +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION GetDumpFileOn(ID) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: GetDumpFileOn + INTEGER(KIND=4) :: GetDumpFileOnF + IF (GetDumpFileOnF(ID).EQ.0) THEN + GetDumpFileOn = .FALSE. + ELSE + GetDumpFileOn = .TRUE. + ENDIF + END FUNCTION GetDumpFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! GetDumpString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetDumpStringLine(ID,N,LINE) IMPLICIT NONE @@ -66,18 +82,6 @@ INTEGER(KIND=4) :: GetDumpStringLineCountF GetDumpStringLineCount = GetDumpStringLineCountF(ID) END FUNCTION GetDumpStringLineCount -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetDumpFileOn(ID) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetDumpFileOn - INTEGER(KIND=4) :: GetDumpFileOnF - IF (GetDumpFileOnF(ID).EQ.0) THEN - GetDumpFileOn = .FALSE. - ELSE - GetDumpFileOn = .TRUE. - ENDIF - END FUNCTION GetDumpFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetDumpStringOn(ID) IMPLICIT NONE @@ -90,6 +94,20 @@ GetDumpStringOn = .TRUE. ENDIF END FUNCTION GetDumpStringOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION GetErrorFileOn(ID) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: GetErrorFileOn + INTEGER(KIND=4) :: GetErrorFileOnF + IF (GetErrorFileOnF(ID).EQ.0) THEN + GetErrorFileOn = .FALSE. + ELSE + GetErrorFileOn = .TRUE. + ENDIF + END FUNCTION GetErrorFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! GetErrorString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetErrorStringLine(ID,N,LINE) IMPLICIT NONE @@ -108,18 +126,6 @@ INTEGER(KIND=4) :: GetErrorStringLineCountF GetErrorStringLineCount = GetErrorStringLineCountF(ID) END FUNCTION GetErrorStringLineCount -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetErrorFileOn(ID) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetErrorFileOn - INTEGER(KIND=4) :: GetErrorFileOnF - IF (GetErrorFileOnF(ID).EQ.0) THEN - GetErrorFileOn = .FALSE. - ELSE - GetErrorFileOn = .TRUE. - ENDIF - END FUNCTION GetErrorFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetLogFileOn(ID) IMPLICIT NONE @@ -186,6 +192,8 @@ GetSelectedOutputValue = GetSelectedOutputValueF(ID,ROW, & COL,VTYPE,DVALUE,SVALUE) END FUNCTION GetSelectedOutputValue +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! GetWarningString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetWarningStringLine(ID,N,LINE) IMPLICIT NONE @@ -222,78 +230,24 @@ INTEGER(KIND=4) :: LoadDatabaseStringF LoadDatabaseString = LoadDatabaseStringF(ID,INPUT) END FUNCTION LoadDatabaseString -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - SUBROUTINE OutputErrorString(ID) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - CALL OutputErrorStringF(ID) - END SUBROUTINE OutputErrorString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SUBROUTINE OutputAccumulatedLines(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID CALL OutputAccumulatedLinesF(ID) END SUBROUTINE OutputAccumulatedLines +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + SUBROUTINE OutputErrorString(ID) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + CALL OutputErrorStringF(ID) + END SUBROUTINE OutputErrorString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SUBROUTINE OutputWarningString(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID CALL OutputWarningStringF(ID) END SUBROUTINE OutputWarningString -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetSelectedOutputFileOn(ID,SELECTED_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: SELECTED_ON - INTEGER(KIND=4) :: SetSelectedOutputFileOn - INTEGER(KIND=4) :: SetSelOutFileOnF - SetSelectedOutputFileOn = SetSelOutFileOnF(ID,SELECTED_ON) - END FUNCTION SetSelectedOutputFileOn -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetOutputFileOn(ID,OUTPUT_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: OUTPUT_ON - INTEGER(KIND=4) :: SetOutputFileOn - INTEGER(KIND=4) :: SetOutputFileOnF - SetOutputFileOn = SetOutputFileOnF(ID,OUTPUT_ON) - END FUNCTION SetOutputFileOn -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetErrorFileOn(ID,ERROR_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: ERROR_ON - INTEGER(KIND=4) :: SetErrorFileOn - INTEGER(KIND=4) :: SetErrorFileOnF - SetErrorFileOn = SetErrorFileOnF(ID,ERROR_ON) - END FUNCTION SetErrorFileOn -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetLogFileOn(ID,LOG_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: LOG_ON - INTEGER(KIND=4) :: SetLogFileOn - INTEGER(KIND=4) :: SetLogFileOnF - SetLogFileOn = SetLogFileOnF(ID,LOG_ON) - END FUNCTION SetLogFileOn -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetDumpFileOn(ID,DUMP_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: DUMP_ON - INTEGER(KIND=4) :: SetDumpFileOn - INTEGER(KIND=4) :: SetDumpFileOnF - SetDumpFileOn = SetDumpFileOnF(ID,DUMP_ON) - END FUNCTION SetDumpFileOn -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetDumpStringOn(ID,DUMP_STRING_ON) - IMPLICIT NONE - INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: DUMP_STRING_ON - INTEGER(KIND=4) :: SetDumpStringOn - INTEGER(KIND=4) :: SetDumpStringOnF - SetDumpStringOn = SetDumpStringOnF(ID,DUMP_STRING_ON) - END FUNCTION SetDumpStringOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION RunAccumulated(ID) IMPLICIT NONE @@ -320,6 +274,60 @@ INTEGER(KIND=4) :: RunStringF RunString = RunStringF(ID,INPUT) END FUNCTION RunString +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetDumpFileOn(ID,DUMP_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: DUMP_ON + INTEGER(KIND=4) :: SetDumpFileOn + INTEGER(KIND=4) :: SetDumpFileOnF + SetDumpFileOn = SetDumpFileOnF(ID,DUMP_ON) + END FUNCTION SetDumpFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetDumpStringOn(ID,DUMP_STRING_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: DUMP_STRING_ON + INTEGER(KIND=4) :: SetDumpStringOn + INTEGER(KIND=4) :: SetDumpStringOnF + SetDumpStringOn = SetDumpStringOnF(ID,DUMP_STRING_ON) + END FUNCTION SetDumpStringOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetErrorFileOn(ID,ERROR_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: ERROR_ON + INTEGER(KIND=4) :: SetErrorFileOn + INTEGER(KIND=4) :: SetErrorFileOnF + SetErrorFileOn = SetErrorFileOnF(ID,ERROR_ON) + END FUNCTION SetErrorFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetLogFileOn(ID,LOG_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: LOG_ON + INTEGER(KIND=4) :: SetLogFileOn + INTEGER(KIND=4) :: SetLogFileOnF + SetLogFileOn = SetLogFileOnF(ID,LOG_ON) + END FUNCTION SetLogFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetOutputFileOn(ID,OUTPUT_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: OUTPUT_ON + INTEGER(KIND=4) :: SetOutputFileOn + INTEGER(KIND=4) :: SetOutputFileOnF + SetOutputFileOn = SetOutputFileOnF(ID,OUTPUT_ON) + END FUNCTION SetOutputFileOn +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + FUNCTION SetSelectedOutputFileOn(ID,SELECTED_ON) + IMPLICIT NONE + INTEGER(KIND=4) :: ID + LOGICAL(KIND=4) :: SELECTED_ON + INTEGER(KIND=4) :: SetSelectedOutputFileOn + INTEGER(KIND=4) :: SetSelOutFileOnF + SetSelectedOutputFileOn = SetSelOutFileOnF(ID,SELECTED_ON) + END FUNCTION SetSelectedOutputFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION UnLoadDatabase(ID) IMPLICIT NONE diff --git a/IPhreeqcLib.cpp b/IPhreeqcLib.cpp index 7fd7f715..790964cc 100644 --- a/IPhreeqcLib.cpp +++ b/IPhreeqcLib.cpp @@ -49,12 +49,6 @@ AddError(int id, const char* error_msg) // TODO AddWarning -int -CreateIPhreeqc(void) -{ - return IPhreeqcLib::CreateIPhreeqc(); -} - IPQ_RESULT ClearAccumulatedLines(int id) { @@ -67,6 +61,12 @@ ClearAccumulatedLines(int id) return IPQ_BADINSTANCE; } +int +CreateIPhreeqc(void) +{ + return IPhreeqcLib::CreateIPhreeqc(); +} + IPQ_RESULT DestroyIPhreeqc(int id) { @@ -112,29 +112,6 @@ GetComponentCount(int id) return IPQ_BADINSTANCE; } -const char* -GetDumpStringLine(int id, int n) -{ - static const char err_msg[] = "GetDumpStringLine: Invalid instance id.\n"; - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - return IPhreeqcPtr->GetDumpStringLine(n); - } - return err_msg; -} - -int -GetDumpStringLineCount(int id) -{ - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - return IPhreeqcPtr->GetDumpStringLineCount(); - } - return 0; -} - int GetDumpFileOn(int id) { @@ -165,6 +142,29 @@ GetDumpString(int id) return empty; } +const char* +GetDumpStringLine(int id, int n) +{ + static const char err_msg[] = "GetDumpStringLine: Invalid instance id.\n"; + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + return IPhreeqcPtr->GetDumpStringLine(n); + } + return err_msg; +} + +int +GetDumpStringLineCount(int id) +{ + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + return IPhreeqcPtr->GetDumpStringLineCount(); + } + return 0; +} + int GetDumpStringOn(int id) { @@ -183,29 +183,6 @@ GetDumpStringOn(int id) return IPQ_BADINSTANCE; } -const char* -GetErrorStringLine(int id, int n) -{ - static const char err_msg[] = "GetErrorStringLine: Invalid instance id.\n"; - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - return IPhreeqcPtr->GetErrorStringLine(n); - } - return err_msg; -} - -int -GetErrorStringLineCount(int id) -{ - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - return (int)IPhreeqcPtr->GetErrorStringLineCount(); - } - return IPQ_BADINSTANCE; -} - int GetErrorFileOn(int id) { @@ -236,6 +213,29 @@ GetErrorString(int id) return err_msg; } +const char* +GetErrorStringLine(int id, int n) +{ + static const char err_msg[] = "GetErrorStringLine: Invalid instance id.\n"; + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + return IPhreeqcPtr->GetErrorStringLine(n); + } + return err_msg; +} + +int +GetErrorStringLineCount(int id) +{ + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + return (int)IPhreeqcPtr->GetErrorStringLineCount(); + } + return IPQ_BADINSTANCE; +} + int GetLogFileOn(int id) { @@ -333,6 +333,18 @@ GetSelectedOutputValue(int id, int row, int col, VAR* pVAR) return IPQ_BADINSTANCE; } +const char* +GetWarningString(int id) +{ + static const char err_msg[] = "GetWarningString: Invalid instance id.\n"; + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + return IPhreeqcPtr->GetWarningString(); + } + return err_msg; +} + const char* GetWarningStringLine(int id, int n) { @@ -356,18 +368,6 @@ GetWarningStringLineCount(int id) return IPQ_BADINSTANCE; } -const char* -GetWarningString(int id) -{ - static const char err_msg[] = "GetWarningString: Invalid instance id.\n"; - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - return IPhreeqcPtr->GetWarningString(); - } - return err_msg; -} - int LoadDatabase(int id, const char* filename) { @@ -390,19 +390,6 @@ LoadDatabaseString(int id, const char* input) return IPQ_BADINSTANCE; } -void -OutputErrorString(int id) -{ - static const char err_msg[] = "OutputErrorString: Invalid instance id.\n"; - IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); - if (IPhreeqcPtr) - { - IPhreeqcPtr->OutputErrorString(); - return; - } - std::cout << err_msg << std::endl; -} - void OutputAccumulatedLines(int id) { @@ -416,6 +403,19 @@ OutputAccumulatedLines(int id) std::cout << err_msg << std::endl; } +void +OutputErrorString(int id) +{ + static const char err_msg[] = "OutputErrorString: Invalid instance id.\n"; + IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); + if (IPhreeqcPtr) + { + IPhreeqcPtr->OutputErrorString(); + return; + } + std::cout << err_msg << std::endl; +} + void OutputWarningString(int id) { diff --git a/fwrap.cpp b/fwrap.cpp index b32da940..f472d74c 100644 --- a/fwrap.cpp +++ b/fwrap.cpp @@ -54,6 +54,10 @@ AccumulateLineF(int *id, char *line, unsigned int line_length) return n; } +/* +AddErrorF +*/ + IPQ_RESULT ClearAccumulatedLinesF(int *id) { @@ -84,6 +88,16 @@ GetComponentF(int *id, int *n, char* comp, unsigned int line_length) padfstring(comp, ::GetComponent(*id, (*n) - 1), line_length); } +int +GetDumpFileOnF(int *id) +{ + return ::GetDumpFileOn(*id); +} + +/* +GetDumpStringF +*/ + int GetDumpStringLineCountF(int *id) { @@ -96,18 +110,22 @@ GetDumpStringLineF(int *id, int* n, char* line, unsigned int line_length) padfstring(line, ::GetDumpStringLine(*id, (*n) - 1), line_length); } -int -GetDumpFileOnF(int *id) -{ - return ::GetDumpFileOn(*id); -} - int GetDumpStringOnF(int *id) { return ::GetDumpStringOn(*id); } +int +GetErrorFileOnF(int *id) +{ + return ::GetErrorFileOn(*id); +} + +/* +GetErrorStringF +*/ + int GetErrorStringLineCountF(int *id) { @@ -120,12 +138,6 @@ GetErrorStringLineF(int *id, int* n, char* line, unsigned int line_length) padfstring(line, ::GetErrorStringLine(*id, (*n) - 1), line_length); } -int -GetErrorFileOnF(int *id) -{ - return ::GetErrorFileOn(*id); -} - int GetLogFileOnF(int *id) { @@ -203,6 +215,10 @@ GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, return result; } +/* +GetWarningStringF +*/ + int GetWarningStringLineCountF(int *id) { @@ -249,18 +265,18 @@ LoadDatabaseStringF(int *id, char* input, unsigned int input_length) return n; } -void -OutputErrorStringF(int *id) -{ - ::OutputErrorString(*id); -} - void OutputAccumulatedLinesF(int *id) { ::OutputAccumulatedLines(*id); } +void +OutputErrorStringF(int *id) +{ + ::OutputErrorString(*id); +} + void OutputWarningStringF(int *id) { @@ -363,6 +379,7 @@ DLL_EXPORT int __stdcall ACCUMULATELINE(int *id, char *line, unsigned int len) { return AccumulateLineF(id, line, len); } +// AddError DLL_EXPORT int __stdcall CLEARACCUMULATEDLINES(int *id) { return ClearAccumulatedLinesF(id); @@ -383,6 +400,11 @@ DLL_EXPORT int __stdcall GETCOMPONENTCOUNT(int *id) { return GetComponentCountF(id); } +DLL_EXPORT int __stdcall GETDUMPFILEON(int *id) +{ + return GetDumpFileOnF(id); +} +// GetDumpString DLL_EXPORT void __stdcall GETDUMPSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { GetDumpStringLineF(id, n, line, line_length); @@ -391,14 +413,15 @@ DLL_EXPORT int __stdcall GETDUMPSTRINGLINECOUNT(int *id) { return GetDumpStringLineCountF(id); } -DLL_EXPORT int __stdcall GETDUMPFILEON(int *id) -{ - return GetDumpFileOnF(id); -} DLL_EXPORT int __stdcall GETDUMPSTRINGON(int *id) { return GetDumpStringOnF(id); } +DLL_EXPORT int __stdcall GETERRORFILEON(int *id) +{ + return GetErrorFileOnF(id); +} +// GetErrorString DLL_EXPORT void __stdcall GETERRORSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { GetErrorStringLineF(id, n, line, line_length); @@ -407,10 +430,6 @@ DLL_EXPORT int __stdcall GETERRORSTRINGLINECOUNT(int *id) { return GetErrorStringLineCountF(id); } -DLL_EXPORT int __stdcall GETERRORFILEON(int *id) -{ - return GetErrorFileOnF(id); -} DLL_EXPORT int __stdcall GETLOGFILEON(int *id) { return GetLogFileOnF(id); @@ -435,6 +454,7 @@ DLL_EXPORT int __stdcall GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col, in { return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length); } +// GetWarningString DLL_EXPORT void __stdcall GETWARNINGSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { GetWarningStringLineF(id, n, line, line_length); @@ -451,14 +471,14 @@ DLL_EXPORT int __stdcall LOADDATABASESTRING(int *id, char *input, unsigned int { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void __stdcall OUTPUTERRORSTRING(int *id) -{ - OutputErrorStringF(id); -} DLL_EXPORT void __stdcall OUTPUTACCUMULATEDLINES(int *id) { OutputAccumulatedLinesF(id); } +DLL_EXPORT void __stdcall OUTPUTERRORSTRING(int *id) +{ + OutputErrorStringF(id); +} DLL_EXPORT void __stdcall OUTPUTWARNINGSTRING(int *id) { OutputWarningStringF(id); diff --git a/fwrap2.cpp b/fwrap2.cpp index 041e24da..1a195978 100644 --- a/fwrap2.cpp +++ b/fwrap2.cpp @@ -15,6 +15,7 @@ DLL_EXPORT int ACCUMULATELINE(int *id, char *line, unsigned int len) { return AccumulateLineF(id, line, len); } +// AddError DLL_EXPORT int CLEARACCUMULATEDLINES(int *id) { return ClearAccumulatedLinesF(id); @@ -35,6 +36,11 @@ DLL_EXPORT int GETCOMPONENTCOUNT(int *id) { return GetComponentCountF(id); } +DLL_EXPORT int GETDUMPFILEON(int *id) +{ + return GetDumpFileOnF(id); +} +// GetDumpString DLL_EXPORT void GETDUMPSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { GetDumpStringLineF(id, n, line, line_length); @@ -43,14 +49,14 @@ DLL_EXPORT int GETDUMPSTRINGLINECOUNT(int *id) { return GetDumpStringLineCountF(id); } -DLL_EXPORT int GETDUMPFILEON(int *id) -{ - return GetDumpFileOnF(id); -} DLL_EXPORT int GETDUMPSTRINGON(int *id) { return GetDumpStringOnF(id); } +DLL_EXPORT int GETERRORFILEON(int *id) +{ + return GetErrorFileOnF(id); +} DLL_EXPORT void GETERRORSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { GetErrorStringLineF(id, n, line, line_length); @@ -59,10 +65,6 @@ DLL_EXPORT int GETERRORSTRINGLINECOUNT(int *id) { return GetErrorStringLineCountF(id); } -DLL_EXPORT int GETERRORFILEON(int *id) -{ - return GetErrorFileOnF(id); -} DLL_EXPORT int GETLOGFILEON(int *id) { return GetLogFileOnF(id); @@ -103,14 +105,14 @@ DLL_EXPORT int LOADDATABASESTRING(int *id, char *input, unsigned int len) { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void OUTPUTERRORSTRING(int *id) -{ - OutputErrorStringF(id); -} DLL_EXPORT void OUTPUTACCUMULATEDLINES(int *id) { OutputAccumulatedLinesF(id); } +DLL_EXPORT void OUTPUTERRORSTRING(int *id) +{ + OutputErrorStringF(id); +} DLL_EXPORT void OUTPUTWARNINGSTRING(int *id) { OutputWarningStringF(id); diff --git a/fwrap3.cpp b/fwrap3.cpp index 9e918bfb..7417aa1f 100644 --- a/fwrap3.cpp +++ b/fwrap3.cpp @@ -14,6 +14,7 @@ DLL_EXPORT int accumulateline_(int *id, char *line, unsigned int len) { return AccumulateLineF(id, line, len); } +// AddError DLL_EXPORT int clearaccumulatedlines_(int *id) { return ClearAccumulatedLinesF(id); @@ -34,6 +35,11 @@ DLL_EXPORT int getcomponentcount_(int *id) { return GetComponentCountF(id); } +DLL_EXPORT int getdumpfileon_(int *id) +{ + return GetDumpFileOnF(id); +} +// GetDumpString DLL_EXPORT void getdumpstringline_(int *id, int *n, char* line, unsigned int line_length) { GetDumpStringLineF(id, n, line, line_length); @@ -42,14 +48,15 @@ DLL_EXPORT int getdumpstringlinecount_(int *id) { return GetDumpStringLineCountF(id); } -DLL_EXPORT int getdumpfileon_(int *id) -{ - return GetDumpFileOnF(id); -} DLL_EXPORT int getdumpstringon_(int *id) { return GetDumpStringOnF(id); } +DLL_EXPORT int geterrorfileon_(int *id) +{ + return GetErrorFileOnF(id); +} +// GetErrorString DLL_EXPORT void geterrorstringline_(int *id, int *n, char* line, unsigned int line_length) { GetErrorStringLineF(id, n, line, line_length); @@ -58,10 +65,6 @@ DLL_EXPORT int geterrorstringlinecount_(int *id) { return GetErrorStringLineCountF(id); } -DLL_EXPORT int geterrorfileon_(int *id) -{ - return GetErrorFileOnF(id); -} DLL_EXPORT int getlogfileon_(int *id) { return GetLogFileOnF(id); @@ -86,6 +89,7 @@ DLL_EXPORT int getselectedoutputvalue_(int *id, int *row, int *col, int *vtype, { return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length); } +// GetWarningString DLL_EXPORT void getwarningstringline_(int *id, int *n, char* line, unsigned int line_length) { GetWarningStringLineF(id, n, line, line_length); @@ -102,14 +106,14 @@ DLL_EXPORT int loaddatabasestring_(int *id, char *input, unsigned int len) { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void outputerrorstring_(int *id) -{ - OutputErrorStringF(id); -} DLL_EXPORT void outputaccumulatedlines_(int *id) { OutputAccumulatedLinesF(id); } +DLL_EXPORT void outputerrorstring_(int *id) +{ + OutputErrorStringF(id); +} DLL_EXPORT void outputwarningstring_(int *id) { OutputWarningStringF(id);