mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
windows java working with callback
git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@10300 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
fbaeb7dcbd
commit
6e752e26c4
@ -184,6 +184,10 @@ Phreeqc::Phreeqc(PHRQ_io *io)
|
||||
|
||||
// initialize data members
|
||||
init();
|
||||
|
||||
#if defined(SWIG) || defined(SWIG_IPHREEQC)
|
||||
basicCallback = NULL;
|
||||
#endif
|
||||
}
|
||||
void Phreeqc::init(void)
|
||||
{
|
||||
|
||||
@ -1736,6 +1736,10 @@ protected:
|
||||
#else
|
||||
double (*basic_fortran_callback_ptr) (double *x1, double *x2, const char *str, int l);
|
||||
#endif
|
||||
#if defined(SWIG) || defined(SWIG_IPHREEQC)
|
||||
class BasicCallback *basicCallback;
|
||||
void SetCallback(BasicCallback *cb) { basicCallback = cb; }
|
||||
#endif
|
||||
|
||||
/* cl1.cpp ------------------------------- */
|
||||
LDBLE *x_arg, *res_arg, *scratch;
|
||||
|
||||
@ -4033,7 +4033,22 @@ basic_free(void)
|
||||
delete this->basic_interpreter;
|
||||
}
|
||||
|
||||
#ifndef SWIG_DIRECTOR
|
||||
#if defined(SWIG) || defined(SWIG_IPHREEQC)
|
||||
|
||||
#include "BasicCallback.h"
|
||||
|
||||
double Phreeqc::
|
||||
basic_callback(double x1, double x2, const char * str)
|
||||
{
|
||||
if (this->basicCallback)
|
||||
{
|
||||
return this->basicCallback->Callback(x1, x2, str);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
#else /* defined(SWIG) || defined(SWIG_IPHREEQC) */
|
||||
|
||||
#ifdef IPHREEQC_NO_FORTRAN_MODULE
|
||||
double Phreeqc::
|
||||
basic_callback(double x1, double x2, char * str)
|
||||
@ -4081,13 +4096,4 @@ Phreeqc::register_fortran_basic_callback(double ( *fcn)(double *x1, double *x2,
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* SWIG_DIRECTOR */
|
||||
|
||||
double Phreeqc::
|
||||
basic_callback(double x1, double x2, const char * str)
|
||||
{
|
||||
return 2014.;
|
||||
}
|
||||
|
||||
|
||||
#endif /* SWIG_DIRECTOR */
|
||||
#endif /* defined(SWIG) || defined(SWIG_IPHREEQC) */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user