Commit 9186a742 by David Llewellyn-Jones

Convert comments to doxygen format

Also bumps version to 0.34.
parent cecf353a
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
......@@ -77,18 +87,12 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(srcdir)/libsymbolic-1.pc.in \
$(dist_doc_DATA) COPYING config/ar-lib config/compile \
config/depcomp config/install-sh config/missing \
$(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
......@@ -181,6 +185,12 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/libsymbolic-1.pc.in $(top_srcdir)/config/ar-lib \
$(top_srcdir)/config/compile $(top_srcdir)/config/install-sh \
$(top_srcdir)/config/missing AUTHORS COPYING ChangeLog INSTALL \
NEWS README config/ar-lib config/compile config/depcomp \
config/install-sh config/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -306,6 +316,7 @@ pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
......@@ -340,7 +351,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -606,15 +616,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
......@@ -650,17 +660,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
......@@ -839,6 +849,8 @@ uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA
pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-dist_docDATA uninstall-pkgconfigDATA
.PRECIOUS: Makefile
ChangeLog:
touch $@
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for symbolic 0.33.
# Generated by GNU Autoconf 2.69 for symbolic 0.34.
#
# Report bugs to <david@flypig.co.uk>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='symbolic'
PACKAGE_TARNAME='symbolic'
PACKAGE_VERSION='0.33'
PACKAGE_STRING='symbolic 0.33'
PACKAGE_VERSION='0.34'
PACKAGE_STRING='symbolic 0.34'
PACKAGE_BUGREPORT='david@flypig.co.uk'
PACKAGE_URL=''
......@@ -696,6 +696,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
......@@ -769,6 +770,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
......@@ -1021,6 +1023,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
......@@ -1158,7 +1169,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
......@@ -1271,7 +1282,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures symbolic 0.33 to adapt to many kinds of systems.
\`configure' configures symbolic 0.34 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1311,6 +1322,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
......@@ -1337,7 +1349,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of symbolic 0.33:";;
short | recursive ) echo "Configuration of symbolic 0.34:";;
esac
cat <<\_ACEOF
......@@ -1434,7 +1446,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
symbolic configure 0.33
symbolic configure 0.34
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1857,7 +1869,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by symbolic $as_me 0.33, which was
It was created by symbolic $as_me 0.34, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2234,7 +2246,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
......@@ -2406,8 +2418,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
......@@ -2426,7 +2438,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
......@@ -2720,7 +2732,7 @@ fi
# Define the identity of the package.
PACKAGE='symbolic'
VERSION='0.33'
VERSION='0.34'
cat >>confdefs.h <<_ACEOF
......@@ -2754,8 +2766,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
......@@ -5621,7 +5633,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by symbolic $as_me 0.33, which was
This file was extended by symbolic $as_me 0.34, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -5687,7 +5699,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
symbolic config.status 0.33
symbolic config.status 0.34
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([symbolic], [0.33], [david@flypig.co.uk])
AC_INIT([symbolic], [0.34], [david@flypig.co.uk])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_CONFIG_SRCDIR([src/Prop.c])
......
libsymbolic (0.34.0-1) unstable; urgency=low
* Change comments to conform to doxygen format.
-- David Llewellyn-Jones <david@flypig.co.uk> Sun, 25 Sep 2016 20:05:30 +0100
libsymbolic (0.33.0-1) unstable; urgency=low
* Updated interface to return number of assignments of user-defined functions.
......
#usr/lib/*/lib*.so.*
//////////////////////////////////////////////////////////////////
// Symbolic
//
// Library for the construction of nested symbolic propositions
// The Flying Pig!
// Started 5/8/2003
// http://www.flypig.co.uk
//
//
// The MIT License
// See symbolic.h, COPYING file or website for licence
//
//////////////////////////////////////////////////////////////////
/**
* Symbolic
*
* @file
* @author David Llewellyn-Jones <david@flypig.co.uk>
* @version 1.0
*
* @section LICENSE
*
* The MIT License
* See symbolic.h, COPYING file or website for licence
*
* @section DESCRIPTION
*
* Library for the construction of nested symbolic propositions
* The Flying Pig!
* Started 5/8/2003
* http://www.flypig.co.uk?to=symbolic
*
* The Approximate functions support conversion of a symbolic expression.
* to a decimal with double precision.
*
*/
//////////////////////////////////////////////////////////////////
// Includes
......@@ -41,9 +51,12 @@
//////////////////////////////////////////////////////////////////
// Main application
// Recursively approximate an operation if possible
// psOp : the operation to evaluate recursively
// Returns: the approximated value
/**
* Recursively approximate an operation if possible.
*
* @param psOp the operation to evaluate recursively.
* @return the approximated value.
*/
double ApproximateOperation (Operation * psOp) {
double fReturn = NAN;
double fVar1;
......
//////////////////////////////////////////////////////////////////
// Symbolic
//
// Library for the construction of nested symbolic propositions
// The Flying Pig!
// Started 5/8/2003
// http://www.flypig.co.uk
//
//
// The MIT License
// See symbolic.h, COPYING file or website for licence
//
//////////////////////////////////////////////////////////////////
/**
* Symbolic
*
* @file
* @author David Llewellyn-Jones <david@flypig.co.uk>
* @version 1.0
*
* @section LICENSE
*
* The MIT License
* See symbolic.h, COPYING file or website for licence
*
* @section DESCRIPTION
*
* Library for the construction of nested symbolic propositions.
* The Flying Pig!
* Started 5/8/2003
* http://www.flypig.co.uk?to=symbolic
*
* Provide functions for differentiation of Operations. The
* processes actually perform algebraic partial differentiation
* with respect to a stipulated variable.
*
*/
//////////////////////////////////////////////////////////////////
// Includes
......@@ -39,14 +50,18 @@
//////////////////////////////////////////////////////////////////
// Main application
//////////////////////////////////////////////////////////////////
// Recursively differentiate an operation if possible
// The result will be a newly allocated set of structures
// so should be freed using FreeRecursive once it's no longer needed
// This function is recursive.
// psOp: the operation to differentiate
// psWRT: an operation represnting the variable to differentate with respect to
// returns: a new operatino, the differentiated result
/**
* Recursively differentiate an operation if possible
* The result will be a newly allocated set of structures
* so should be freed using FreeRecursive once it's no longer needed
* This function is recursive.
*
* @param psOp the operation to differentiate.
* @param psWRT an operation represnting the variable to differentate with
* respect to.
* @return a new operatino, the differentiated result.
*
*/
Operation * DifferentiateOperation (Operation * psOp, Operation * psWRT)
{
Operation * psReturn = NULL;
......
//////////////////////////////////////////////////////////////////
// Symbolic
//
// Library for the construction of nested symbolic propositions
// The Flying Pig!
// Started 5/8/2003
// http://www.flypig.co.uk
//
//
// The MIT License
// See symbolic.h, COPYING file or website for licence
//
//////////////////////////////////////////////////////////////////
/**
* Symbolic
*
* @file
* @author David Llewellyn-Jones <david@flypig.co.uk>
* @version 1.0
*
* @section LICENSE
*
* The MIT License
* See symbolic.h, COPYING file or website for licence
*
* @section DESCRIPTION
*
* Library for the construction of nested symbolic propositions.
* The Flying Pig!
* Started 5/8/2003
* http://www.flypig.co.uk?to=symbolic
*
* Implements a main function for simple testing of the library.
*
*/
//////////////////////////////////////////////////////////////////
// Includes
......@@ -43,9 +52,11 @@ Operation * TestSimplify (Operation * psOp, void * psContext);
//////////////////////////////////////////////////////////////////
// Main application
//////////////////////////////////////////////////////////////////
// Main program
// This is for testing purposes and isn't part of the libary
/**
* Main program.
* This is for testing purposes and isn't part of the libary.
*
*/
int main (int argc, char * * argv) {
Operation * psOp;
Operation * psOp2;
......@@ -375,12 +386,20 @@ int main (int argc, char * * argv) {
return 0;
}
// Test user function approximate
/**
* Test user function approximate.
* This is for testing purposes and isn't part of the libary.
*
*/
double TestApproximate (double fVar1, void * psContext) {
return fVar1 * 2;
}
// Test user function differentiate
/**
* Test user function differentiate.
* This is for testing purposes and isn't part of the libary.
*
*/
Operation * TestDifferentiate (Operation * psOp, Operation * psWRT, void * psContext) {
Operation * psReturn = NULL;
psReturn = CreateInteger (0);
......@@ -388,7 +407,11 @@ Operation * TestDifferentiate (Operation * psOp, Operation * psWRT, void * psCon
return psReturn;
}
// Test user function simplify
/**
* Test user function simplify.
* This is for testing purposes and isn't part of the libary.
*
*/
Operation * TestSimplify (Operation * psOp, void * psContext) {
Operation * psReturn = NULL;
psReturn = psOp;
......@@ -396,8 +419,3 @@ Operation * TestSimplify (Operation * psOp, void * psContext) {
return psReturn;
}
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -17,7 +17,17 @@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
......@@ -80,12 +90,12 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
noinst_PROGRAMS = ../symbolic$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/config/depcomp $(include_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
......@@ -199,6 +209,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
......@@ -283,6 +294,7 @@ pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
......@@ -314,7 +326,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -762,6 +773,8 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLIBRARIES
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-includeHEADERS uninstall-libLIBRARIES
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
//////////////////////////////////////////////////////////////////
// Symbolic
//
// Library for the construction of nested symbolic propositions
// The Flying Pig!
// Started 5/8/2003
// http://www.flypig.co.uk
//
//
// The MIT License
// See symbolic.h, COPYING file or website for licence
//
//////////////////////////////////////////////////////////////////
/**
* Symbolic
*
* @file
* @author David Llewellyn-Jones <david@flypig.co.uk>
* @version 1.0
*
* @section LICENSE
*
* The MIT License
* See symbolic.h, COPYING file or website for licence
*
* @section DESCRIPTION
*
* Library for the construction of nested symbolic propositions.
* The Flying Pig!
* Started 5/8/2003
* http://www.flypig.co.uk?to=symbolic
*
* Provides an interface for defining variables. Variables may
* be given values or left as true variables (without defined
* values).
*
*/
//////////////////////////////////////////////////////////////////
// Includes
......@@ -60,20 +71,30 @@ Variable * AddNewVariable (Variable * psVariables, char const * const szVar);
//////////////////////////////////////////////////////////////////
// Main application
// For reference counting
/**
* For reference counting.
*
*/
void IncrementVarRef (Variable * psVar) {
psVar->nReferences++;
}
// For reference counting
/**
* For reference counting.
*
*/
void DecrementVarRef (Variable * psVar) {
psVar->nReferences--;
}
// Create a new tracked variable
// psOp: the operation the variable relates to
// psVariables: the linked list of variables for this operation
// returns: the new head of the linked list
/**
* Create a new tracked variable.
*
* @param psOp the operation the variable relates to.
* @param psVariables the linked list of variables for this operation.
* @return the new head of the linked list.
*
*/
Variable * CreateVariableValue (Operation * psOp, Variable * psVariables) {
Variable * psVariable = NULL;
......@@ -89,10 +110,14 @@ Variable * CreateVariableValue (Operation * psOp, Variable * psVariables) {
return psVariable;
}
// Pull out the variables from an operation and keep track of them
// psOp: the operation to check for variables
// psVariables: the linked list of vvariables for this operation
// returns: the new head of the linked list
/**
* Pull out the variables from an operation and keep track of them.
*
* @param psOp the operation to check for variables.
* @param psVariables the linked list of vvariables for this operation.
* @return the new head of the linked list.
*
*/
Variable * CreateVariables (Operation * psOp, Variable * psVariables) {
if (psOp) {
switch (psOp->eOpType) {
......@@ -153,17 +178,25 @@ Variable * CreateVariables (Operation * psOp, Variable * psVariables) {
return psVariables;
}
// Set the value of a variable
// psVar: the variable to assign a value to
// fValue: the value to assign it
/**
* Set the value of a variable.
*
* @param psVar the variable to assign a value to.
* @param fValue the value to assign it.
*
*/
void SetVariable (Variable * psVar, double fValue) {
psVar->fValue = fValue;
psVar->boValid = TRUE;
}
// Get the valye oof a variable
// psVar: the variable to check
// returns: the value assigned to the variable, or NAN if it's unset
/**
* Get the valye oof a variable.
*
* @param psVar the variable to check.
* @return the value assigned to the variable, or NAN if it's unset.
*
*/
double GetVariable (Variable * psVar) {
double fValue = NAN;
......@@ -175,14 +208,22 @@ double GetVariable (Variable * psVar) {
return fValue;
}
// Unset the value of a variable
// psVar: the variable to clear
/**
* Unset the value of a variable
*
* @param psVar the variable to clear.
*
*/
void UnsetVariable (Variable * psVar) {
psVar->boValid = FALSE;
}
// Free up any varialbles that are no longer used in an operation
// psVariables: the linked list of variables to check
/**
* Free up any varialbles that are no longer used in an operation.
*
* @param psVariables the linked list of variables to check.
*