diff --git a/doc/Makefile b/doc/Makefile index a591dcb3..4ba9e074 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -17,6 +17,7 @@ EXAMPLES = \ examples/GetSelectedOutputString.c \ examples/GetSelectedOutputValue.c \ examples/GetSelectedOutputValue2.c \ + examples/SetBasicCallback.c \ examples/IPhreeqc.cpp \ examples/F90ClearAccumulatedLines.f90 \ examples/F90CreateIPhreeqc.f90 \ @@ -26,7 +27,9 @@ EXAMPLES = \ examples/F90GetLogStringLine.f90 \ examples/F90GetOutputStringLine.f90 \ examples/F90GetSelectedOutputStringLine.f90 \ - examples/F90GetSelectedOutputValue.f90 + examples/F90GetSelectedOutputValue.f90 \ + examples/F90SetBasicFortranCallback.f90 \ + examples/ic all: $(TARGET) diff --git a/doc/TOC.hhc b/doc/TOC.hhc index de68411f..123b57fa 100644 --- a/doc/TOC.hhc +++ b/doc/TOC.hhc @@ -55,6 +55,10 @@ +
  • + + +
  • @@ -127,6 +131,10 @@ +
  • + + +
  • @@ -155,6 +163,10 @@ +
  • + + +
  • @@ -235,6 +247,18 @@ +
  • + + + +
  • + + + +
  • + + +
  • diff --git a/doc/examples/SetBasicCallback.c b/doc/examples/SetBasicCallback.c index 8d071078..29e43829 100644 --- a/doc/examples/SetBasicCallback.c +++ b/doc/examples/SetBasicCallback.c @@ -12,7 +12,7 @@ const char input[] = " CO2(g) -1.5 10 \n" "EQUILIBRIUM_PHASES 2 \n" " Calcite 0 10 \n" - "SELECTED_OUTPUT \n" + "SELECTED_OUTPUT 1 \n" " -reset false \n" "USER_PUNCH \n" " -Heading pH SR(calcite) Year \n" diff --git a/doc/examples/ic b/doc/examples/ic index 266480ad..495de87d 100644 --- a/doc/examples/ic +++ b/doc/examples/ic @@ -1,11 +1,10 @@ -# File ic SOLUTION 1-2 END EQUILIBRIUM_PHASES 1 CO2(g) -1.5 10 EQUILIBRIUM_PHASES 2 Calcite 0 10 -SELECTED_OUTPUT +SELECTED_OUTPUT 1 -reset false USER_PUNCH -Heading pH SR(calcite) Year diff --git a/src/IPhreeqc.h b/src/IPhreeqc.h index 708945fb..0a397f13 100644 --- a/src/IPhreeqc.h +++ b/src/IPhreeqc.h @@ -1582,51 +1582,53 @@ Headings IPQ_DLL_EXPORT int RunString(int id, const char* input); /** - * Sets C callback function for the Basic interpreter. - * @param id The instance id returned from \ref CreateIPhreeqc. - * @param cookie The name of a double precision Fortran function with three arguments (two double precision, and one character). + * Sets a C callback function for Basic programs. The syntax for the Basic command is + * 10 result = CALLBACK(x1, x2, string$) + * The syntax for the C function is + * double my_callback(double x1, double x2, const char * string) + * @param id The instance id returned from @ref CreateIPhreeqc. + * @param fcn The name of a user-defined function. + * @param cookie1 A user defined value to be passed to the callback function. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. * @par Fortran90 Interface: - * @htmlonly - * - *
    - *  FUNCTION SetBasicCallback(ID,fcn,cookie)
    - *    INTEGER  :: ID
    - *    double (*fcn)(double x1, double x2, const char *str, void *)
    - *    void *      cookie  :: SetBasicCallback
    - *    integer     SetBasicCallback
    - *  END FUNCTION SetBasicCallback
    - *  
    - *
    - * @endhtmlonly + * see @ref SetBasicFortranCallback + * @par C Example: + * @include SetBasicCallback.c */ IPQ_DLL_EXPORT IPQ_RESULT SetBasicCallback(int id, double (*fcn)(double x1, double x2, const char *str, void *cookie), void *cookie1); /** - * Sets Fortran callback function for the Basic interpreter. - * @param id The instance id returned from \ref CreateIPhreeqc. - * @param cookie The name of a double precision Fortran function with three arguments (two double precision, and one character). + * Sets a Fortran callback function for Basic programs. The syntax for the Basic command is + * 10 result = CALLBACK(x1, x2, string$) + * The syntax for the Fortran function is + * double precision my_callback(x1, x2, string), where x1 and x2 are double precision and string is a character variable. + * @param id The instance id returned from @ref CreateIPhreeqc. + * @param fcn The name of a double precision Fortran function with three arguments (two double precision, and one character). * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. * @par Fortran90 Interface: * @htmlonly * *
    - *  FUNCTION SetBasicFortranCallback(ID,fcn)
    + *  FUNCTION SetBasicFortranCallback(ID,FCN)
      *    INTEGER(KIND=4),  INTENT(IN)  :: ID
      *    INTERFACE
    - *      DOUBLE PRECISION FUNCTION fcn(x1, x2, str)
    + *      DOUBLE PRECISION FUNCTION FCN(x1, x2, str)
      *        DOUBLE PRECISION, INTENT(in) :: x1
      *        DOUBLE PRECISION, INTENT(in) :: x2
    - *        CHARACTER(*), INTENT(in)                   :: str
    - *      END FUNCTION 
    + *        CHARACTER(*), INTENT(in)     :: str
    + *      END FUNCTION
      *    END INTERFACE
      *    INTEGER(KIND=4)               :: SetBasicFortranCallback
    - *  END FUNCTION SetBasicCallback
    + *  END FUNCTION SetBasicFortranCallback
      *  
    *
    * @endhtmlonly + * @par Fortran90 Example: + * @include F90SetBasicFortranCallback.f90 + * @par File ic : + * @include ic */ IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double (*fcn)(double *x1, double *x2, char *str, int l)); diff --git a/src/IPhreeqc.hpp b/src/IPhreeqc.hpp index fdfd894d..76f47b46 100644 --- a/src/IPhreeqc.hpp +++ b/src/IPhreeqc.hpp @@ -38,7 +38,7 @@ class IPQ_DLL_EXPORT IPhreeqcStop : std::exception /** * @class IPhreeqc * - * @brief Provides an interface to PHREEQC (Version 2)--A Computer + * @brief Provides an interface to PHREEQC (Version 3)--A Computer * Program for Speciation, Batch-Reaction, One-Dimensional Transport, * and Inverse Geochemical Calculations */ @@ -690,7 +690,8 @@ public: * 10 result = CALLBACK(x1, x2, string$) * The syntax for the C function is * double my_callback(double x1, double x2, const char * string) - * @param cookie The name of a user-defined function + * @param fcn The name of a user-defined function. + * @param cookie1 A user defined value to be passed to the callback function. * @see SetBasicFortranCallback */ void SetBasicCallback(double (*fcn)(double x1, double x2, const char *str, void *cookie), void * cookie1); @@ -700,7 +701,7 @@ public: * 10 result = CALLBACK(x1, x2, string$) * The syntax for the Fortran function is * double precision my_callback(x1, x2, string), where x1 and x2 are double precision and string is a character variable. - * @param cookie The name of a user-defined double precision function with three arguments (two double precision, one character). + * @param fcn The name of a user-defined function. * @see SetBasicCallback */ void SetBasicFortranCallback(double (*fcn)(double *x1, double *x2, char *str, int l));