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:
Scott R Charlton 2015-09-24 06:10:03 +00:00
parent fbaeb7dcbd
commit 6e752e26c4
3 changed files with 25 additions and 11 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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) */