mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
added GetVersionString
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8153 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
9d18ae8811
commit
81009f8570
12
IPhreeqc.cpp
12
IPhreeqc.cpp
@ -5,6 +5,7 @@
|
||||
#include "IPhreeqc.hpp" // IPhreeqc
|
||||
#include "Phreeqc.h" // Phreeqc
|
||||
#include "thread.h"
|
||||
#include "Version.h"
|
||||
|
||||
#include "Debug.h" // ASSERT
|
||||
#include "ErrorReporter.hxx" // CErrorReporter
|
||||
@ -22,6 +23,8 @@ const char DUMP_FILENAME_FORMAT[] = "dump.%d.out";
|
||||
std::map<size_t, IPhreeqc*> IPhreeqc::Instances;
|
||||
size_t IPhreeqc::InstancesIndex = 0;
|
||||
|
||||
std::string IPhreeqc::Version(VERSION_STRING);
|
||||
|
||||
static const char empty[] = "";
|
||||
|
||||
|
||||
@ -510,6 +513,11 @@ VRESULT IPhreeqc::GetSelectedOutputValue2(int row, int col, int *vtype, double*
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* IPhreeqc::GetVersionString(void)
|
||||
{
|
||||
return IPhreeqc::Version.c_str();
|
||||
}
|
||||
|
||||
const char* IPhreeqc::GetWarningString(void)
|
||||
{
|
||||
this->WarningString = ((CErrorReporter<std::ostringstream>*)this->WarningReporter)->GetOS()->str();
|
||||
@ -1101,6 +1109,7 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL
|
||||
{
|
||||
ASSERT(this->SelectedOutputMap[(*mit).first] == this->CurrentSelectedOutputMap[&(*mit).second]);
|
||||
}
|
||||
/**
|
||||
if (this->PhreeqcPtr->simulation > 1 && save_punch_in && (*mit).second.Get_new_def() && !bWarning)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -1108,13 +1117,16 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL
|
||||
this->PhreeqcPtr->warning_msg(oss.str().c_str());
|
||||
bWarning = true;
|
||||
}
|
||||
**/
|
||||
}
|
||||
/**
|
||||
if (this->PhreeqcPtr->simulation > 1 && this->PhreeqcPtr->keycount[Keywords::KEY_USER_PUNCH] > 0)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << sz_routine << ": Warning USER_PUNCH has been redefined.\n";
|
||||
this->PhreeqcPtr->warning_msg(oss.str().c_str());
|
||||
}
|
||||
**/
|
||||
|
||||
if (this->PhreeqcPtr->title_x != NULL)
|
||||
{
|
||||
|
||||
22
IPhreeqc.h
22
IPhreeqc.h
@ -1329,6 +1329,28 @@ Headings
|
||||
IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue2(int id, int row, int col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the string buffer containing the version in the form of X.X.X-XXXX.
|
||||
* @return A null terminated string containing the IPhreeqc version number.
|
||||
* @par Fortran90 Interface:
|
||||
* @htmlonly
|
||||
* <CODE>
|
||||
* <PRE>
|
||||
* SUBROUTINE GetVersionString(VERSION)
|
||||
* CHARACTER(LEN=*), INTENT(OUT) :: VERSION
|
||||
* END SUBROUTINE GetVersionString
|
||||
* </PRE>
|
||||
* </CODE>
|
||||
* @endhtmlonly
|
||||
*
|
||||
* @par C Example:
|
||||
* @include GetVersionString.c
|
||||
*
|
||||
* @par Fortran90 Example:
|
||||
* @include GetVersionString.f90
|
||||
*/
|
||||
IPQ_DLL_EXPORT const char* GetVersionString(void);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the warning messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString.
|
||||
|
||||
@ -584,6 +584,12 @@ public:
|
||||
*/
|
||||
VRESULT GetSelectedOutputValue2(int row, int col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length);
|
||||
|
||||
/**
|
||||
* Retrieves the string buffer containing the version in the form of X.X.X-XXXX.
|
||||
* @return A null terminated string containing the IPhreeqc version number.
|
||||
*/
|
||||
static const char* GetVersionString(void);
|
||||
|
||||
/**
|
||||
* Retrieves the warning messages from the last call to @ref RunAccumulated, @ref RunFile, @ref RunString, @ref LoadDatabase, or @ref LoadDatabaseString.
|
||||
* @return A null terminated string containing warning messages.
|
||||
@ -945,6 +951,8 @@ protected:
|
||||
static size_t InstancesIndex;
|
||||
size_t Index;
|
||||
|
||||
static std::string Version;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
/* reset warning C4251 */
|
||||
#pragma warning(default:4251)
|
||||
|
||||
@ -378,6 +378,12 @@
|
||||
GetSelectedOutputValue = GetSelectedOutputValueF(ID,ROW,
|
||||
& COL,VTYPE,DVALUE,SVALUE)
|
||||
END FUNCTION GetSelectedOutputValue
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
SUBROUTINE GetVersionString(VERSION)
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=*) :: VERSION
|
||||
CALL GetVersionStringF(VERSION)
|
||||
END SUBROUTINE GetVersionString
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! GetWarningString
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
@ -629,6 +629,12 @@ GetSelectedOutputValue2(int id, int row, int col, int *vtype, double* dvalue, ch
|
||||
return IPQ_BADINSTANCE;
|
||||
}
|
||||
|
||||
const char*
|
||||
GetVersionString(void)
|
||||
{
|
||||
return IPhreeqc::GetVersionString();
|
||||
}
|
||||
|
||||
const char*
|
||||
GetWarningString(int id)
|
||||
{
|
||||
|
||||
35
Version.h
Normal file
35
Version.h
Normal file
@ -0,0 +1,35 @@
|
||||
#define NAME "IPhreeqc"
|
||||
#define VER_MAJOR 3
|
||||
#define VER_MINOR 0
|
||||
#define VER_PATCH 0
|
||||
#define VER_REVISION 0
|
||||
|
||||
#define RELEASE_DATE "@RELEASE_DATE@"
|
||||
|
||||
#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
|
||||
#define APR_STRINGIFY_HELPER(n) #n
|
||||
|
||||
/** Version number */
|
||||
#define VER_NUM APR_STRINGIFY(VER_MAJOR) \
|
||||
"." APR_STRINGIFY(VER_MINOR) \
|
||||
"." APR_STRINGIFY(VER_PATCH) \
|
||||
"." APR_STRINGIFY(VER_REVISION)
|
||||
|
||||
|
||||
|
||||
#define PRODUCT_NAME NAME \
|
||||
"-" APR_STRINGIFY(VER_MAJOR) \
|
||||
"." APR_STRINGIFY(VER_MINOR)
|
||||
|
||||
#if defined(_WIN64)
|
||||
#define VERSION_STRING APR_STRINGIFY(VER_MAJOR) \
|
||||
"." APR_STRINGIFY(VER_MINOR) \
|
||||
"." APR_STRINGIFY(VER_PATCH) \
|
||||
"-" APR_STRINGIFY(VER_REVISION) \
|
||||
"-x64"
|
||||
#else
|
||||
#define VERSION_STRING APR_STRINGIFY(VER_MAJOR) \
|
||||
"." APR_STRINGIFY(VER_MINOR) \
|
||||
"." APR_STRINGIFY(VER_PATCH) \
|
||||
"-" APR_STRINGIFY(VER_REVISION)
|
||||
#endif
|
||||
10
fwrap.cpp
10
fwrap.cpp
@ -359,6 +359,12 @@ GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue,
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
GetVersionStringF(char* version, unsigned int version_length)
|
||||
{
|
||||
padfstring(version, ::GetVersionString(), version_length);
|
||||
}
|
||||
|
||||
/*
|
||||
GetWarningStringF
|
||||
*/
|
||||
@ -794,6 +800,10 @@ IPQ_DLL_EXPORT int __stdcall GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void __stdcall GETVERSIONSTRING(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void __stdcall GETWARNINGSTRINGLINE(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
2
fwrap.h
2
fwrap.h
@ -47,6 +47,7 @@
|
||||
#define GetSelectedOutputStringLineF FC_FUNC (getselectedoutputstringlinef, GETSELECTEDOUTPUTSTRINGLINEF)
|
||||
#define GetSelectedOutputStringOnF FC_FUNC (getselectedoutputstringonf, GETSELECTEDOUTPUTSTRINGONF)
|
||||
#define GetSelectedOutputValueF FC_FUNC (getselectedoutputvaluef, GETSELECTEDOUTPUTVALUEF)
|
||||
#define GetVersionStringF FC_FUNC (getversionstringf, GETVERSIONSTRINGF)
|
||||
#define GetWarningStringLineCountF FC_FUNC (getwarningstringlinecountf, GETWARNINGSTRINGLINECOUNTF)
|
||||
#define GetWarningStringLineF FC_FUNC (getwarningstringlinef, GETWARNINGSTRINGLINEF)
|
||||
#define LoadDatabaseF FC_FUNC (loaddatabasef, LOADDATABASEF)
|
||||
@ -119,6 +120,7 @@ extern "C" {
|
||||
void GetSelectedOutputStringLineF(int *id, int* n, char* line, unsigned int line_length);
|
||||
int GetSelectedOutputStringOnF(int *id);
|
||||
IPQ_RESULT GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length);
|
||||
void GetVersionStringF(char* version, unsigned int version_length);
|
||||
int GetWarningStringLineCountF(int *id);
|
||||
void GetWarningStringLineF(int *id, int* n, char* line, unsigned int line_length);
|
||||
int LoadDatabaseF(int *id, char* filename, unsigned int filename_length);
|
||||
|
||||
@ -171,6 +171,10 @@ IPQ_DLL_EXPORT int GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col, int *vty
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void GETVERSIONSTRING(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void GETWARNINGSTRINGLINE(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
GetWarningStringLineF(id, n, line, line_length);
|
||||
|
||||
@ -171,6 +171,10 @@ IPQ_DLL_EXPORT int getselectedoutputvalue_(int *id, int *row, int *col, int *vt
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void getversionstring_(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void getwarningstringline_(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
@ -171,6 +171,10 @@ IPQ_DLL_EXPORT int getselectedoutputvalue(int *id, int *row, int *col, int *vty
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void getversionstring(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void getwarningstringline(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
@ -172,6 +172,10 @@ IPQ_DLL_EXPORT int GETSELECTEDOUTPUTVALUE_(int *id, int *row, int *col, int *vt
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void GETVERSIONSTRING_(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void GETWARNINGSTRINGLINE_(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
@ -172,6 +172,10 @@ IPQ_DLL_EXPORT int __stdcall GETSELECTEDOUTPUTVALUE_(int *id, int *row, int *co
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void __stdcall GETVERSIONSTRING_(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void __stdcall GETWARNINGSTRINGLINE_(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
@ -171,6 +171,10 @@ IPQ_DLL_EXPORT int __stdcall getselectedoutputvalue_(int *id, int *row, int *co
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void __stdcall getversionstring_(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void __stdcall getwarningstringline_(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
@ -171,6 +171,10 @@ IPQ_DLL_EXPORT int __stdcall getselectedoutputvalue(int *id, int *row, int *col
|
||||
{
|
||||
return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length);
|
||||
}
|
||||
IPQ_DLL_EXPORT void __stdcall getversionstring(char* version, unsigned int version_length)
|
||||
{
|
||||
GetVersionStringF(version, version_length);
|
||||
}
|
||||
// GetWarningString
|
||||
IPQ_DLL_EXPORT void __stdcall getwarningstringline(int *id, int *n, char* line, unsigned int line_length)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user