mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
working on adding examples to doxygen
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@4391 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
80708d69fd
commit
b7317dda11
@ -622,7 +622,7 @@ EXCLUDE_SYMBOLS =
|
||||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATH = examples
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
@ -1029,7 +1029,7 @@ PDF_HYPERLINKS = NO
|
||||
# plain latex in the generated Makefile. Set this option to YES to get a
|
||||
# higher quality PDF documentation.
|
||||
|
||||
USE_PDFLATEX = NO
|
||||
USE_PDFLATEX = YES
|
||||
|
||||
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
|
||||
# command to the generated LaTeX files. This will instruct LaTeX to keep
|
||||
@ -1046,7 +1046,7 @@ LATEX_HIDE_INDICES = NO
|
||||
|
||||
# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
|
||||
|
||||
LATEX_SOURCE_CODE = NO
|
||||
LATEX_SOURCE_CODE = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
|
||||
39
doc/examples/AccumulateLine.c
Normal file
39
doc/examples/AccumulateLine.c
Normal file
@ -0,0 +1,39 @@
|
||||
#include <stdlib.h>
|
||||
#include <IPhreeqc.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = CreateIPhreeqc();
|
||||
if (id < 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (LoadDatabase(id, "phreeqc.dat") != 0) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (AccumulateLine(id, "SOLUTION 1") != IPQ_OK) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (AccumulateLine(id, "END") != IPQ_OK) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (RunAccumulated(id) != 0) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (DestroyIPhreeqc(id) != IPQ_OK) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
29
doc/examples/CreateIPhreeqc.c
Normal file
29
doc/examples/CreateIPhreeqc.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include <stdlib.h>
|
||||
#include <IPhreeqc.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = CreateIPhreeqc();
|
||||
if (id < 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (LoadDatabase(id, "phreeqc.dat") != 0) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (RunFile(id, "ex2") != 0) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (DestroyIPhreeqc(id) != IPQ_OK) {
|
||||
OutputError(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
35
doc/examples/F90AccumulateLine.f90
Normal file
35
doc/examples/F90AccumulateLine.f90
Normal file
@ -0,0 +1,35 @@
|
||||
PROGRAM example
|
||||
INCLUDE "IPhreeqc.f90.inc"
|
||||
INTEGER(KIND=4) :: id
|
||||
|
||||
id = CreateIPhreeqc()
|
||||
IF (id.LT.0) THEN
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (AccumulateLine(id, "SOLUTION 1").NE.IPQ_OK) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (AccumulateLine(id, "END").NE.IPQ_OK) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (RunAccumulated(id).NE.0) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (DestroyIPhreeqc(id).NE.IPQ_OK) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
END PROGRAM example
|
||||
25
doc/examples/F90CreateIPhreeqc.f90
Normal file
25
doc/examples/F90CreateIPhreeqc.f90
Normal file
@ -0,0 +1,25 @@
|
||||
PROGRAM example
|
||||
INCLUDE "IPhreeqc.f90.inc"
|
||||
INTEGER(KIND=4) :: id
|
||||
|
||||
id = CreateIPhreeqc()
|
||||
IF (id.LT.0) THEN
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (RunFile(id, "ex2").NE.0) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
IF (DestroyIPhreeqc(id).NE.IPQ_OK) THEN
|
||||
CALL OutputError(id)
|
||||
STOP
|
||||
ENDIF
|
||||
|
||||
END PROGRAM example
|
||||
45
doc/examples/Makefile
Normal file
45
doc/examples/Makefile
Normal file
@ -0,0 +1,45 @@
|
||||
CC = gcc
|
||||
CPPFLAGS = -I../../include
|
||||
CXX = g++
|
||||
DEFS = -DNDEBUG=1 -DFC_FUNC\(name,NAME\)=name\ \#\#\ _ -DFC_FUNC_\(name,NAME\)=name\ \#\#\ _ -DFC_MAIN=MAIN__
|
||||
F77 = gfortran
|
||||
FC = gfortran
|
||||
CFLAGS = -g -O2
|
||||
FFLAGS = -I../../include -g -O2
|
||||
FCLIBS = -L/usr/lib/gcc/i586-manbo-linux-gnu/4.4.1 -L/usr/lib/gcc/i586-manbo-linux-gnu/4.4.1/../../.. -lgfortranbegin -lgfortran -lm
|
||||
LIBTOOL = /bin/sh ../../_build/libtool
|
||||
LDFLAGS =
|
||||
IPHREEQC_LA = ../../_build/src/libiphreeqc.la
|
||||
|
||||
all: AccumulateLine F90AccumulateLine CreateIPhreeqc F90CreateIPhreeqc
|
||||
|
||||
AccumulateLine: AccumulateLine.lo $(IPHREEQC_LA)
|
||||
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $< $(IPHREEQC_LA)
|
||||
|
||||
F90AccumulateLine: F90AccumulateLine.lo $(IPHREEQC_LA)
|
||||
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $< $(IPHREEQC_LA) $(FCLIBS)
|
||||
|
||||
CreateIPhreeqc: CreateIPhreeqc.lo $(IPHREEQC_LA)
|
||||
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $< $(IPHREEQC_LA)
|
||||
|
||||
F90CreateIPhreeqc: F90CreateIPhreeqc.lo $(IPHREEQC_LA)
|
||||
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $< $(IPHREEQC_LA) $(FCLIBS)
|
||||
|
||||
.SUFFIXES: .c .cxx .f .f90 .lo
|
||||
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.cxx.lo:
|
||||
$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.f.lo:
|
||||
$(LIBTOOL) --mode=compile $(F77) $(FFLAGS) -c -o $@ $<
|
||||
|
||||
.f90.lo:
|
||||
$(LIBTOOL) --mode=compile $(FC) $(FFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
clean:
|
||||
$(LIBTOOL) --mode=clean rm -f AccumulateLine AccumulateLine.lo F90AccumulateLine F90AccumulateLine.lo
|
||||
1579
doc/examples/phreeqc.dat
Normal file
1579
doc/examples/phreeqc.dat
Normal file
File diff suppressed because it is too large
Load Diff
@ -47,6 +47,12 @@ extern "C" {
|
||||
* </PRE>
|
||||
* </CODE>
|
||||
* @endhtmlonly
|
||||
*
|
||||
* @par C Example:
|
||||
* \include AccumulateLine.c
|
||||
*
|
||||
* @par Fortran90 Example:
|
||||
* \include F90AccumulateLine.f90
|
||||
*/
|
||||
DLL_EXPORT IPQ_RESULT AccumulateLine(int id, const char *line);
|
||||
|
||||
@ -79,6 +85,12 @@ extern "C" {
|
||||
* </PRE>
|
||||
* </CODE>
|
||||
* @endhtmlonly
|
||||
*
|
||||
* @par C Example:
|
||||
* \include CreateIPhreeqc.c
|
||||
*
|
||||
* @par Fortran90 Example:
|
||||
* \include F90CreateIPhreeqc.f90
|
||||
*/
|
||||
DLL_EXPORT int CreateIPhreeqc(void);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user