diff -Nru libsymbolic-0.33.0/aclocal.m4 libsymbolic-0.34.0/aclocal.m4 --- libsymbolic-0.33.0/aclocal.m4 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/aclocal.m4 2016-09-26 18:31:51.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,32 +20,63 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -67,18 +98,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,19 +147,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -178,16 +211,40 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -198,16 +255,18 @@ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -218,13 +277,15 @@ AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl @@ -233,9 +294,9 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR +])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -247,10 +308,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -266,12 +327,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +394,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -378,15 +439,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -417,7 +477,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -608,7 +668,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -684,7 +744,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -774,8 +834,8 @@ # # AC_SUBST([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. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -849,6 +909,9 @@ AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -878,7 +941,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -889,7 +952,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -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'" ;; @@ -899,7 +962,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -920,7 +983,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -970,7 +1033,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1009,7 +1072,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1038,7 +1101,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1085,7 +1148,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1104,7 +1167,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1185,7 +1248,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1245,7 +1308,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1273,7 +1336,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1292,7 +1355,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru libsymbolic-0.33.0/configure libsymbolic-0.34.0/configure --- libsymbolic-0.33.0/configure 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/configure 2016-09-26 18:31:51.000000000 +0000 @@ -1,6 +1,6 @@ #! /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 . # @@ -580,8 +580,8 @@ # 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 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -769,6 +770,7 @@ 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 @@ | -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 @@ 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 @@ # 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 @@ --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 @@ 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 @@ 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 @@ 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_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 @@ 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 @@ $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 @@ # Define the identity of the package. PACKAGE='symbolic' - VERSION='0.33' + VERSION='0.34' cat >>confdefs.h <<_ACEOF @@ -2754,8 +2766,8 @@ # 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 @@ # 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 @@ 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\\" diff -Nru libsymbolic-0.33.0/configure.ac libsymbolic-0.34.0/configure.ac --- libsymbolic-0.33.0/configure.ac 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/configure.ac 2016-09-26 18:31:51.000000000 +0000 @@ -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]) diff -Nru libsymbolic-0.33.0/debian/bzr-builder.manifest libsymbolic-0.34.0/debian/bzr-builder.manifest --- libsymbolic-0.33.0/debian/bzr-builder.manifest 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/debian/bzr-builder.manifest 2016-09-26 18:31:51.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~48 -lp:~flypig/functy/Symbolic revid:svn-v4:98495de3-020f-4958-9e5d-e5b408e671d5:Symbolic/trunk:238 +# bzr-builder format 0.3 deb-version {debupstream}-0~49 +lp:~flypig/libsymbolic/trunk revid:git-v1:9186a742fb817d38ec38e4d3e680697c9e921bb1 diff -Nru libsymbolic-0.33.0/debian/changelog libsymbolic-0.34.0/debian/changelog --- libsymbolic-0.33.0/debian/changelog 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/debian/changelog 2016-09-26 18:31:51.000000000 +0000 @@ -1,8 +1,13 @@ -libsymbolic (0.33.0-0~48~ubuntu15.04.1) vivid; urgency=low +libsymbolic (0.34.0-0~49~ubuntu15.04.1) vivid; urgency=low * Auto build. - -- David Llewellyn-Jones Sat, 08 Aug 2015 23:16:37 +0000 + -- David Llewellyn-Jones Mon, 26 Sep 2016 18:31:51 +0000 + +libsymbolic (0.34.0-1) unstable; urgency=low + * Change comments to conform to doxygen format. + + -- David Llewellyn-Jones 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. diff -Nru libsymbolic-0.33.0/debian/libsymbolic1.dirs libsymbolic-0.34.0/debian/libsymbolic1.dirs --- libsymbolic-0.33.0/debian/libsymbolic1.dirs 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/debian/libsymbolic1.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib diff -Nru libsymbolic-0.33.0/debian/libsymbolic1.install libsymbolic-0.34.0/debian/libsymbolic1.install --- libsymbolic-0.33.0/debian/libsymbolic1.install 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/debian/libsymbolic1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*/lib*.so.* diff -Nru libsymbolic-0.33.0/debian/libsymbolic.dirs libsymbolic-0.34.0/debian/libsymbolic.dirs --- libsymbolic-0.33.0/debian/libsymbolic.dirs 1970-01-01 00:00:00.000000000 +0000 +++ libsymbolic-0.34.0/debian/libsymbolic.dirs 2016-09-26 18:31:51.000000000 +0000 @@ -0,0 +1 @@ +usr/lib diff -Nru libsymbolic-0.33.0/debian/libsymbolic.install libsymbolic-0.34.0/debian/libsymbolic.install --- libsymbolic-0.33.0/debian/libsymbolic.install 1970-01-01 00:00:00.000000000 +0000 +++ libsymbolic-0.34.0/debian/libsymbolic.install 2016-09-26 18:31:51.000000000 +0000 @@ -0,0 +1 @@ +#usr/lib/*/lib*.so.* diff -Nru libsymbolic-0.33.0/Makefile.in libsymbolic-0.34.0/Makefile.in --- libsymbolic-0.33.0/Makefile.in 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/Makefile.in 2016-09-26 18:31:51.000000000 +0000 @@ -1,7 +1,7 @@ -# 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 @@ 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 @@ 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 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -340,7 +351,6 @@ 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 @@ $(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 @@ 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 @@ pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_docDATA uninstall-pkgconfigDATA +.PRECIOUS: Makefile + ChangeLog: touch $@ diff -Nru libsymbolic-0.33.0/src/Approximate.c libsymbolic-0.34.0/src/Approximate.c --- libsymbolic-0.33.0/src/Approximate.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Approximate.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,26 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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; diff -Nru libsymbolic-0.33.0/src/Convert.c libsymbolic-0.34.0/src/Convert.c --- libsymbolic-0.33.0/src/Convert.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Convert.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,27 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 + * + * Convert provides functions for converting between strings and + * Operations (where Operations are the internal structures of + * libsymbolic). Conversions in both directions are possible. + * + */ ////////////////////////////////////////////////////////////////// // Includes @@ -49,12 +60,14 @@ ////////////////////////////////////////////////////////////////// // Main application -////////////////////////////////////////////////////////////////// -// Turn a formula into a string -// psOp: the operaton to convert -// szString: pre-allocated buffer to store the result -// nStrLen: the length of the buffer. Use OperationToStringLength to find out how much is needed -// returns: pointer to the resulting string (which will be the start of the buffer) +/** + * Turn a formula into a string. + * + * @param psOp the operaton to convert. + * @param szString pre-allocated buffer to store the result. + * @param nStrLen the length of the buffer. Use OperationToStringLength to find out how much is needed. + * @return pointer to the resulting string (which will be the start of the buffer). + */ char * OperationToString (Operation * psOp, char * szString, int nStrLen) { char * szRecurse; @@ -71,14 +84,17 @@ return szString; } -////////////////////////////////////////////////////////////////// -// Recursively turn a formula into a string -// Internal method. Directly allocates memory for the result, -// which must be freed manually once it's no longer needed -// using PropFree -// psOp: the operation to convert -// nStrLen: the maximum length the string can take -// returns: the resulting string in allocated memory +/** + * Recursively turn a formula into a string. + * Internal method. Directly allocates memory for the result, + * which must be freed manually once it's no longer needed + * using PropFree. + * + * @param psOp the operation to convert. + * @param nStrLen the maximum length the string can take. + * @return the resulting string in allocated memory. + * + */ char * RecurseToString (Operation * psOp, int nStrLen) { char * szReturn; char * szVar1; @@ -243,10 +259,13 @@ return szReturn; } -////////////////////////////////////////////////////////////////// -// Return length of a formula turned into a string -// psOp: the operation to check -// returns: the length +/** + * Return length of a formula turned into a string. + * + * @param psOp the operation to check. + * @return the length. + * + */ int OperationToStringLength (Operation * psOp) { int nLength; @@ -257,10 +276,13 @@ return nLength; } -////////////////////////////////////////////////////////////////// -// Recursively return the length of a formula turned into a string -// psOp: the operation to check -// returns: the length +/** + * Recursively return the length of a formula turned into a string. + * + * @param psOp the operation to check. + * @return the length. + * + */ int RecurseToStringLength (Operation * psOp) { int nReturn; int nVar1; @@ -409,13 +431,16 @@ return nReturn; } -////////////////////////////////////////////////////////////////// -// Turn a formula into a string using float (0.0f) notation -// This will output a string that can be compiled into C/C++ or GLSL -// psOp: the operaton to convert -// szString: pre-allocated buffer to store the result -// nStrLen: the length of the buffer. Use OperationToStringLength to find out how much is needed -// returns: pointer to the resulting string (which will be the start of the buffer) +/** + * Turn a formula into a string using float (0.0f) notation. + * This will output a string that can be compiled into C/C++ or GLSL. + * + * @param psOp the operaton to convert. + * @param szString pre-allocated buffer to store the result. + * @param nStrLen the length of the buffer. Use OperationToStringLength to find out how much is needed. + * @return pointer to the resulting string (which will be the start of the buffer). + * + */ char * OperationToStringC (Operation * psOp, char * szString, int nStrLen) { char * szRecurse; @@ -432,15 +457,18 @@ return szString; } -////////////////////////////////////////////////////////////////// -// Recursively turn a formula into a string using float (0.0f) notation -// This will output a string that can be compiled into C/C++ or GLSL -// Internal method. Directly allocates memory for the result, -// which must be freed manually once it's no longer needed -// using PropFree -// psOp: the operation to convert -// nStrLen: the maximum length the string can take -// returns: the resulting string in allocated memory +/** + * Recursively turn a formula into a string using float (0.0f) notation + * This will output a string that can be compiled into C/C++ or GLSL + * Internal method. Directly allocates memory for the result, + * which must be freed manually once it's no longer needed + * using PropFree. + * + * @param psOp the operation to convert. + * @param nStrLen the maximum length the string can take. + * @return the resulting string in allocated memory. + * + */ char * RecurseToStringC (Operation * psOp, int nStrLen) { char * szReturn; char * szVar1; @@ -620,10 +648,13 @@ return szReturn; } -////////////////////////////////////////////////////////////////// -// Return length of a formula turned into a string using float (0.0f) notation -// psOp: the operation to check -// returns: the length +/** + * Return length of a formula turned into a string using float (0.0f) notation. + * + * @param psOp the operation to check. + * @return the length. + * + */ int OperationToStringCLength (Operation * psOp) { int nLength; @@ -634,10 +665,13 @@ return nLength; } -////////////////////////////////////////////////////////////////// -// Recursively return the length of a formula turned into a string using float (0.0f) notation -// psOp: the operation to check -// returns: the length +/** + * Recursively return the length of a formula turned into a string using float (0.0f) notation. + * + * @param psOp the operation to check. + * @return the length. + * + */ int RecurseToStringCLength (Operation * psOp) { int nReturn; int nVar1; @@ -795,16 +829,19 @@ return nReturn; } -////////////////////////////////////////////////////////////////// -// Turn a string into a formula -// The string has to be well-formed for this to work -// This will allocate memory for the operations structures -// on the heap. The result is guaranteed to be acyclyc and -// should be freed using FreeRecursive once it's no longer -// needed further. -// TODO: Tackle the case of a non-well-formed string -// szString: the null-terminated string to convert -// returns: the resulting nested operation structure +/** + * Turn a string into a formula. + * The string has to be well-formed for this to work + * This will allocate memory for the operations structures + * on the heap. The result is guaranteed to be acyclyc and + * should be freed using FreeRecursive once it's no longer + * needed further. + * TODO: Tackle the case of a non-well-formed string. + * + * @param szString: the null-terminated string to convert. + * @return the resulting nested operation structure. + * + */ Operation * StringToOperation (char const * szString) { int nStrLen; Operation * psOperation; @@ -839,13 +876,15 @@ return psOperation; } -////////////////////////////////////////////////////////////////// -// Check a string fragment to see if it's a binary operator -// Internal method -// szString: the string to check -// nStrLen: the length of the string -// The operator to compare against -// returns: TRUE if the operator and string match, FALSE otherwise +/** + * Check a string fragment to see if it's a binary operator + * Internal method. + * + * @param szString the string to check. + * @param nStrLen the length of the string. + * @return TRUE if the operator and string match, FALSE otherwise. + * + */ inline bool StringCheckBinary (char const * szString, int const nStrLen, char const * szOperator) { bool boMatch = FALSE; int nOperatorLen; @@ -861,19 +900,23 @@ return boMatch; } -////////////////////////////////////////////////////////////////// -// Recursively turn a string into a formula -// Internal method; use StringToOperation instead -// The string has to be well-formed for this to work -// This will allocate memory for the operations structures -// on the heap. The result is guaranteed to be acyclyc and -// should be freed using FreeRecursive once it's no longer -// needed further. -// Note that in this case the string may not be null-terminated -// TODO: Tackle the case of a non-well-formed string -// szString: the string to convert -// nStrLen: the length of the string still to be processed -// returns: the resulting nested operation structure +/** + * Recursively turn a string into a formula + * Internal method; use StringToOperation instead + * The string has to be well-formed for this to work + * This will allocate memory for the operations structures + * on the heap. The result is guaranteed to be acyclyc and + * should be freed using FreeRecursive once it's no longer + * needed further. + * Note that in this case the string may not be null-terminated + * TODO: Tackle the case of a non-well-formed string. + * Internal operation. + * + * @param szString the string to convert. + * @param nStrLen the length of the string still to be processed. + * @return the resulting nested operation structure. + * + */ Operation * RecurseToOperation (char const * szString, int nStrLen) { int nBrackets; int nPos = 0; @@ -1008,17 +1051,21 @@ return psReturnOp; } -////////////////////////////////////////////////////////////////// -// Convert a decimal number into a continued fraction -// Continued fractions are (I think) provably the most efficient -// representation in rational form. -// However although it's always possible to represent a decimal as -// a continued fraction, to avoid massive memory allocations in some -// cases, we stop after the fraction is within espilon of the correct -// result, where epilon = CONTINUED_FRACTION_ERROR defined above -// fDecimal: the decimal value to convert -// uMaxDepth: the maximum nesting depth of fraction to allocate -// Returns: the continued fraction as a nested set of addition and division operations + +/** + * Convert a decimal number into a continued fraction + * Continued fractions are (I think) provably the most efficient + * representation in rational form. + * However although it's always possible to represent a decimal as + * a continued fraction, to avoid massive memory allocations in some + * cases, we stop after the fraction is within espilon of the correct + * result, where epilon = CONTINUED_FRACTION_ERROR defined above. + * + * @param fDecimal the decimal value to convert. + * @param uMaxDepth the maximum nesting depth of fraction to allocate. + * @return the continued fraction as a nested set of addition and division operations. + * + */ Operation * ContinuedFraction (double fDecimal, unsigned int uMaxDepth) { double fFractional; Operation * psReturn; @@ -1043,12 +1090,16 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Try to convert a string to a double -// szString: the string to convert (may not be zero terminated) -// nStrLen: the length of the string -// pfDeciimal: return value of the decimal value if it could be converted (unchanged o/w) -// returns: TRUE if the conversion was successful, FALSE o/w +/** + * Try to convert a string to a double. + * Internal method. + * + * @param szString the string to convert (may not be zero terminated). + * @param nStrLen the length of the string. + * @param pfDeciimal return value of the decimal value if it could be converted (unchanged o/w). + * @return TRUE if the conversion was successful, FALSE o/w. + * + */ bool TryStringToDouble (char const * const szString, int const nStrLen, double * pfDecimal) { int nScanned = 0; char * szCopied; @@ -1072,6 +1123,17 @@ return (nScanned == 1); } +/** + * Try to convert a string into a user unary. + * Internal method. + * + * @param szString the string to convert (may not be zero terminated). + * @param nStrLen the length of the string. + * @param pnNameEnd return the character index of the last character of the + * unary name. Unchanged if NULL on entry or conversion fails. + * @return TRUE if the conversion was successful, FALSE o/w. + * + */ bool TryUndefinedUnary (char const * szString, int nStrLen, int * pnNameEnd) { bool boMatch; int nPos; @@ -1097,6 +1159,15 @@ return boMatch; } +/** + * Test whether the brackets in the given string expression match up. + * Internal method. + * + * @param szString the string to check (may not be zero terminated). + * @param nStrLen the length of the string. + * @return TRUE if the brackets match, FALSE o/w. + * + */ bool CheckBracketsMatch (char const * szString, int nStrLen) { bool boMatch; int nBrackets; diff -Nru libsymbolic-0.33.0/src/Differentiate.c libsymbolic-0.34.0/src/Differentiate.c --- libsymbolic-0.33.0/src/Differentiate.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Differentiate.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,27 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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; diff -Nru libsymbolic-0.33.0/src/Interface.c libsymbolic-0.34.0/src/Interface.c --- libsymbolic-0.33.0/src/Interface.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Interface.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,25 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 @@ ////////////////////////////////////////////////////////////////// // 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 @@ 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 @@ 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 @@ return psReturn; } - - - - - diff -Nru libsymbolic-0.33.0/src/Makefile.in libsymbolic-0.34.0/src/Makefile.in --- libsymbolic-0.33.0/src/Makefile.in 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Makefile.in 2016-09-26 18:31:51.000000000 +0000 @@ -1,7 +1,7 @@ -# 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 @@ 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 @@ 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 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -314,7 +326,6 @@ 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 @@ 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. diff -Nru libsymbolic-0.33.0/src/Prop.c libsymbolic-0.34.0/src/Prop.c --- libsymbolic-0.33.0/src/Prop.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Prop.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,27 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 + * + * Code for creating, manipulating and destroying propositions + * and Operations. Manipulations supported include copy, + * search, substitution and comparison. + * + */ ////////////////////////////////////////////////////////////////// // Includes @@ -53,8 +64,10 @@ //} //#endif -////////////////////////////////////////////////////////////////// -// Reset memory allocation details +/** + * Reset memory allocation details. + * + */ void PropMemReset (void) { #if defined _MEM_PROFILE printf ("Memory profiling reset\n"); @@ -64,16 +77,24 @@ #endif } -////////////////////////////////////////////////////////////////// -// Output current memory allocation details +/** + * Output current memory allocation details. + * + */ void PropMemOutput (void) { #if defined _MEM_PROFILE printf ("Total memory blocks allocated = %d\n", gnPropMemAllocated); #endif } -////////////////////////////////////////////////////////////////// -// void * malloc (size_t size) +/** + * Replacement for malloc to also profile memory usage. Replicates + * void * malloc (size_t size) + * + * @param size the amount of memory to allocate in bytes. + * @return pointer to the allocated memory. + * + */ void * PropMemMalloc (size_t size) { #if defined _MEM_PROFILE gnPropMemAllocated += 1; @@ -81,8 +102,18 @@ return malloc (size); } +/** + * Replacement for calloc to also profile memory usage. Replicates + * void * calloc (size_t n, size_t size) + * A chunk of memor of size (n * size) will be allocted on the heap + * and its contents set to all zero bytes. + * + * @param n number of blocks to allocate. + * @param size the size of each memory block to allocate in bytes. + * @return pointer to the allocated memory. + * + */ ////////////////////////////////////////////////////////////////// -// void * calloc (size_t n, size_t size) void * PropMemCalloc (size_t n, size_t size) { #if defined _MEM_PROFILE gnPropMemAllocated += 1; @@ -90,8 +121,13 @@ return calloc (n, size); } -////////////////////////////////////////////////////////////////// -// void free (void * ptr) +/** + * Replacement for free to also profile memory usage. Replicates + * void free (void * ptr) + * + * @param ptr pointer to the memory to free. + * + */ void PropMemFree (void * ptr) { #if defined _MEM_PROFILE gnPropMemAllocated -= 1; @@ -99,8 +135,12 @@ return free (ptr); } -////////////////////////////////////////////////////////////////// -// Create a memory operation +/** + * Create a 'memory' operation (used as an indirection operator). + * + * @return pointer to the created Operation. + * + */ Operation * CreateMemory (void) { Operation * psOp; @@ -110,8 +150,14 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create an integer operation + +/** + * Create an integer operation. + * + * @param nInteger the initial value of the Operation. + * @return pointer to the created Operation. + * + */ Operation * CreateInteger (int const nInteger) { Operation * psOp; @@ -122,8 +168,13 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create true/false truth value operation +/** + * Create true/false truth value operation. + * + * @param boTruth the initial value of the Operation. + * @return pointer to the created Operation. + * + */ Operation * CreateTruthValue (bool const boTruth) { Operation * psOp; @@ -134,8 +185,13 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create a variable +/** + * Create a variable. + * + * @param szVar the name of the variable. + * @return pointer to the created Operation. + * + */ Operation * CreateVariable (char const * szVar) { Operation * psOp; int nNameLen; @@ -155,8 +211,17 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create a unary operation +/** + * Create a unary operation. + * Note that psVar1 is used directly, rather than being copied. As such it will + * be freed when the resulting combined Operation is freed recursively. + * + * @param eOpType the type of the operation (see OPUNARY for the acceptable + * types). + * @param psVar1 the Operation that the unary operator will be applied to. + * @return pointer to the created Operation. + * + */ Operation * CreateUnary (OPUNARY eOpType, Operation * psVar1) { Operation * psOp; @@ -169,8 +234,19 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create a binary operation +/** + * Create a binary operation. + * Note that psVar1 and psVar2 are used directly, rather than being copied. As + * such they will be freed when the resulting combined Operation is freed + * recursively. + * + * @param eOpType the type of the operation (see OPBINARY for the acceptable + * types). + * @param psVar1 the LHS Operation that the binary operator will apply to. + * @param psVar2 the RHS Operation that the binary operator will apply to. + * @return pointer to the created Operation. + * + */ Operation * CreateBinary (OPBINARY eOpType, Operation * psVar1, Operation * psVar2) { Operation * psOp; @@ -184,8 +260,20 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Create a ternary operation +/** + * Create a ternary operation. + * Note that psVar1, psVar2 and psVar3 are used directly, rather than being + * copied. As such they will be freed when the resulting combined Operation + * is freed recursively. + * + * @param eOpType the type of the operation (see OPBINARY for the acceptable + * types). + * @param psVar1 the first Operation that the ternary operator will apply to. + * @param psVar2 the second Operation that the ternary operator will apply to. + * @param psVar3 the third Operation that the ternary operator will apply to. + * @return pointer to the created Operation. + * + */ Operation * CreateTernary (OPTERNARY eOpType, Operation * psVar1, Operation * psVar2, Operation * psVar3) { Operation * psOp; @@ -200,8 +288,15 @@ return psOp; } -////////////////////////////////////////////////////////////////// -// Recursively free up all of the memory used by a formula and its sub formulas +/** + * Recursively free up all of the memory used by a formula and its sub formulas. + * Care should be taken not to perform multiple frees, by freeing up an + * Operation that was already freed by this. + * + * @param psOp the Operation that will be freed, along with all of its + * sub-Operations. + * + */ void FreeRecursive (Operation * psOp) { if (psOp) { switch (psOp->eOpType) { @@ -261,8 +356,16 @@ } } -////////////////////////////////////////////////////////////////// -// Recursively copy a formula and all its subformulas +/** + * Recursively copy a formula and all its subformulas. Note that copies will + * also be made of all sub-Operations, so the original and copy should be + * freed separately. + * + * @param psOp the Operation that will be copied, along with all of its + * sub-Operations. + * @return the newly created copy. + * + */ Operation * CopyRecursive (Operation * psOp) { Operation * psReturn = NULL; @@ -306,8 +409,15 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Compare two formulae recursively +/** + * Compare two formulae recursively. This will return true if and only if + * the Operation and all its sub-Operations have the same content. + * + * @param psOp1 the Operation to compare against psOp2. + * @param psOp2 the Operation to compare against psOp1. + * @return true iff the two Operations have identical content. + * + */ bool CompareOperations (Operation * psOp1, Operation * psOp2) { bool boReturn = TRUE; @@ -384,8 +494,16 @@ return boReturn; } -////////////////////////////////////////////////////////////////// -// Search a formula for a given subformula +/** + * Search a formula for a given subformula. Performs a recursive comparison, + * so there will only be a match if both the psFind Operation and its + * sub-Operations match an Operation within psMain. + * + * @param psMain the Operation to search in. + * @param psFind the Operation to search for. + * @return pointer to the Operation found, or NULL o/w. + * + */ Operation * FindOperation (Operation * psMain, Operation * psFind) { Operation * psReturn = NULL; bool boSame; @@ -454,8 +572,20 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Substitute all instances of a given subformula for a formula +/** + * Substitute all instances of a given subformula for a formula. When found + * the substituted formula will be a copy of psSub (rather than a pointer to + * it). A substitution may cause the root operation to move in memory, so any + * stored instances of psMain should be replaces by whatever this function + * return. + * + * @param psMain the Operation to search in. + * @param psFind the Operation to search for. + * @param psSub the Operation to substitue instances of psFind for. + * @return new pointer to the altered Operation. This may, or may not, be the + * same as psMain depending on whether a substitution occurs. + * + */ Operation * SubstituteOperation (Operation * psMain, Operation * psFind, Operation * psSub) { bool boFind; Operation * psReturn; @@ -471,8 +601,19 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Substitute recursively all instances of a given subformula for a formula +/** + * Substitute recursively all instances of a given subformula for a formula. + * When found the substituted formula will be a copy of psSub (rather than a + * pointer to it). + * Internal operation. Use SubstituteOperation instead. + * + * @param psMain the Operation to search in. + * @param psFind the Operation to search for. + * @param psSub the Operation to substitue instances of psFind for. + * @return true iff the root Operation entirely matches psFind (and so should + * be substituted). + * + */ bool SubstituteRecursive (Operation * psMain, Operation * psFind, Operation * psSub) { bool boSubstitute = FALSE; bool boFind; @@ -550,8 +691,26 @@ return boSubstitute; } -////////////////////////////////////////////////////////////////// -// Substitute all instances of a given pair of subformula for respective formulae +/** + * Substitute all instances of a given pair of subformula for respective + * formulae. When found the substituted formulae will be a copy of psSub + * (rather than a pointer to it). A substitution may cause the root operation + * to move in memory, so any stored instances of psMain should be replaces by + * whatever this function return. + * Note that this is different from applying SubstituteOperation twice. Use + * of this function will ensure the two substitutions don't interact (for + * example, in the case where one substitution might otherwise cause a match + * for the second substitution). + * + * @param psMain the Operation to search in. + * @param psFind1 the first Operation to search for. + * @param psSub1 the first Operation to substitue instances of psFind1 for. + * @param psFind2 the second Operation to search for. + * @param psSub2 the first Operation to substitue instances of psFind2 for. + * @return new pointer to the altered Operation. This may, or may not, be the + * same as psMain depending on whether a substitution occurs. + * + */ Operation * SubstituteOperationPair (Operation * psMain, Operation * psFind1, Operation * psSub1, Operation * psFind2, Operation * psSub2) { int nFind; Operation * psReturn; @@ -574,8 +733,28 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Substitute recursively all instances of a given pair of subformula for respective formulae +/** + * Substitute recursively all instances of a given pair of subformula for + * respective formulae. When found the substituted formula will be a copy of + * psSub (rather than a pointer to it). + * Note that this is different from applying SubstituteOperation twice. Use + * of this function will ensure the two substitutions don't interact (for + * example, in the case where one substitution might otherwise cause a match + * for the second substitution). + * Internal operation. Use SubstituteOperationPair instead. + * + * @param psMain the Operation to search in. + * @param psFind1 the first Operation to search for. + * @param psSub1 the first Operation to substitue instances of psFind1 for. + * @param psFind2 the second Operation to search for. + * @param psSub2 the first Operation to substitue instances of psFind2 for. + * @return 1 if the root Operation entirely matches psFind1; + * 2 if the root Operation entirely matches psFind2; + * 0 o/w. + * In the case of 1 or 2 the root operation should be entirely + * substituted by psSub1 or psSub2 respectively. + * + */ int SubstituteRecursivePair (Operation * psMain, Operation * psFind1, Operation * psSub1, Operation * psFind2, Operation * psSub2) { int nSubstitute = 0; int nFind; @@ -718,8 +897,17 @@ return nSubstitute; } -////////////////////////////////////////////////////////////////// -// Compare a pair of formulae against a formula recursively +/** + * Compare a pair of formulae against another formula. + * + * @param psMain the Operation to compare to. + * @param psCompare1 the first Operation to compare against. + * @param psCompare2 the second Operation to compare against. + * @return 1 if psMain entirely matches psCompare1; + * 2 if psMain entirely matches psCompare2; + * 0 o/w. + * + */ int CompareOperationsPair (Operation * psMain, Operation * psCompare1, Operation * psCompare2) { int nReturn = 0; diff -Nru libsymbolic-0.33.0/src/Simplify.c libsymbolic-0.34.0/src/Simplify.c --- libsymbolic-0.33.0/src/Simplify.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Simplify.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,29 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 functions for the simplification of Operations. The + * process recursively applies a collection of rule (tautologies) + * until no further simplifications are possible. This is a simple + * form of theorom proving, with the input and output statements + * being mathematically equivalent. + * + */ ////////////////////////////////////////////////////////////////// // Includes @@ -50,13 +63,19 @@ ////////////////////////////////////////////////////////////////// // Main application -////////////////////////////////////////////////////////////////// -// Recursively simplify an operation if possible -// Because a new version may created and the original may be freed -// it's common practice to overwrite the variable pointing to the -// input structure with the return value -// psOp: the operation to simplify, which may be entirely freed -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify an operation if possible. + * Applies a variety of proof rules (tautologies) to the original operation. + * The result will therefore be mathematically equivalent. + * Because a new version may created and the original may be freed + * it's good practice to overwrite the variable pointing to the + * input structure with the return value. + * + * @param psOp the operation to simplify, which may be entirely freed. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyOperation (Operation * psOp) { Operation * psReturn = NULL; OpUnary * psUna = NULL; @@ -509,21 +528,28 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Return the Greatest Common Denominator -// nA: input integer -// nB: input integer -// returns: the greatest common denominator of nA and nB +/** + * Return the Greatest Common Denominator of nA and nB. + * + * @param nA input integer. + * @param nB input integer. + * @return the greatest common denominator of nA and nB. + * + */ int gcd (int nA, int nB) { return (nB == 0 ? nA : gcd (nB, nA % nB)); } -////////////////////////////////////////////////////////////////// -// Recursively simplify a NEGATIVE operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the parameter of the unary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a NEGATIVE operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the parameter of the unary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyNEGATIVE (Operation * psOp, Operation * psVar1) { Operation * psReturn = psOp; OpBinary * psBin = NULL; @@ -556,12 +582,16 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify a NOT operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the parameter of the unary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a NOT operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the parameter of the unary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyNOT (Operation * psOp, Operation * psVar1) { Operation * psReturn = psOp; OpBinary * psBin = NULL; @@ -626,13 +656,17 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify an ADD operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the first parameter of the binary operation -// psVar2: the second parameter of the binary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify an ADD operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the first parameter of the binary operation. + * @param psVar2 the second parameter of the binary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyADD (Operation * psOp, Operation * psVar1, Operation * psVar2) { Operation * psReturn = psOp; @@ -769,13 +803,17 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify a SUB operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the first parameter of the binary operation -// psVar2: the second parameter of the binary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a SUB operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the first parameter of the binary operation. + * @param psVar2 the second parameter of the binary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifySUB (Operation * psOp, Operation * psVar1, Operation * psVar2) { Operation * psReturn = psOp; @@ -839,13 +877,17 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify a DIV operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the first parameter of the binary operation -// psVar2: the second parameter of the binary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a DIV operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the first parameter of the binary operation. + * @param psVar2 the second parameter of the binary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyDIV (Operation * psOp, Operation * psVar1, Operation * psVar2) { Operation * psReturn = psOp; @@ -863,13 +905,17 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify a DIVIDE operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the first parameter of the binary operation -// psVar2: the second parameter of the binary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a DIVIDE operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the first parameter of the binary operation. + * @param psVar2 the second parameter of the binary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyDIVIDE (Operation * psOp, Operation * psVar1, Operation * psVar2) { Operation * psReturn = psOp; @@ -920,13 +966,17 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify a POW operation if possible -// This is for internal use -// psOp: the operation to be simplified -// psVar1: the first parameter of the binary operation -// psVar2: the second parameter of the binary operation -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * Recursively simplify a POW operation if possible. + * This is for internal use. + * + * @param psOp the operation to be simplified. + * @param psVar1 the first parameter of the binary operation. + * @param psVar2 the second parameter of the binary operation. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * SimplifyPOW (Operation * psOp, Operation * psVar1, Operation * psVar2) { Operation * psReturn = psOp; @@ -961,9 +1011,20 @@ return psReturn; } - -////////////////////////////////////////////////////////////////// -// Continue simpliying an operation until it no longer changes +/** + * Continue simpliying an operation until it no longer changes. This + * repeadedly applies the proof rules until the Operation no longer changes. + * Because a new version may created and the original may be freed + * it's good practice to overwrite the variable pointing to the + * input structure with the return value. + * In general, it makes sense to use this rather than SimplifyOperation, since + * the UberSimplifyOperation is more effective at simplifying an Operation. + * + * @param psOp the operation to simplify, which may be entirely freed. + * @return a simplifed version of the operation, which should be freed once no + * longer needed. + * + */ Operation * UberSimplifyOperation (Operation * psOp) { Operation * psPrev = NULL; diff -Nru libsymbolic-0.33.0/src/symbolic.h libsymbolic-0.34.0/src/symbolic.h --- libsymbolic-0.33.0/src/symbolic.h 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/symbolic.h 2016-09-26 18:31:51.000000000 +0000 @@ -1,35 +1,42 @@ -////////////////////////////////////////////////////////////////// -// Symbolic -// -// Library for the construction of nested symbolic propositions -// The Flying Pig! -// Started 5/8/2003 -// http://www.flypig.co.uk -// -// -// The MIT License -// -// Copyright (c) 2009 David Llewellyn-Jones -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -////////////////////////////////////////////////////////////////// +/** + * Symbolic + * + * @file + * @author David Llewellyn-Jones + * @version 1.0 + * + * @section LICENSE + * + * The MIT License + * + * Copyright (c) 2003-2016 David Llewellyn-Jones + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @section DESCRIPTION + * + * Library for the construction of nested symbolic propositions. + * The Flying Pig! + * Started 5/8/2003 + * http://www.flypig.co.uk?to=symbolic + * + */ #if !defined _H_SYMBOLIC #define _H_SYMBOLIC @@ -68,7 +75,7 @@ ////////////////////////////////////////////////////////////////// // Structures -// Main operatioo structure +// Main operation structure typedef struct _Operation Operation; // Main variable strucutre typedef struct _Variable Variable; diff -Nru libsymbolic-0.33.0/src/symbolic_private.h libsymbolic-0.34.0/src/symbolic_private.h --- libsymbolic-0.33.0/src/symbolic_private.h 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/symbolic_private.h 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,23 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 + * + */ #if !defined _H_SYMBOLIC_PRIVATE #define _H_SYMBOLIC_PRIVATE diff -Nru libsymbolic-0.33.0/src/UserUnary.c libsymbolic-0.34.0/src/UserUnary.c --- libsymbolic-0.33.0/src/UserUnary.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/UserUnary.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,29 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 + * + * Symbolic has a collection of build in functions that it knows + * about automatically. Sometimes these may not be enough. The + * UserUnary functions provide an interface for registering + * new unary functions defined by the developer, extending the + * library's capabilities. + * + */ ////////////////////////////////////////////////////////////////// // Includes @@ -61,6 +74,13 @@ ////////////////////////////////////////////////////////////////// // Main application +/** + * + * + * @param + * @return + * + */ Operation * CreateUserUnary (char const * szVar, Operation * psVar1) { Operation * psOp; @@ -77,6 +97,13 @@ return psOp; } +/** + * + * + * @param + * @return + * + */ Operation * CreateUserUnaryLength (char const * szVar, int nLength, Operation * psVar1) { Operation * psOp; @@ -95,6 +122,13 @@ return psOp; } +/** + * + * + * @param + * @return + * + */ void SetUserUnaryFunc (Operation * psOp, UserFunc * psUserFunc) { if ((psOp->Vars.psUnaryUser->psUserFunc != psUserFunc) && (psOp->Vars.psUnaryUser->psUserFunc)) { DecrementUserFuncRef (psOp->Vars.psUnaryUser->psUserFunc); @@ -104,18 +138,35 @@ psOp->Vars.psUnaryUser->psUserFunc = psUserFunc; } -// For reference counting +/** + * For reference counting. + * + * @param + * @return + * + */ void IncrementUserFuncRef (UserFunc * psUserFunc) { psUserFunc->nReferences++; } -// For reference counting +/** + * For reference counting. + * + * @param + * @return + * + */ void DecrementUserFuncRef (UserFunc * psUserFunc) { psUserFunc->nReferences--; } -////////////////////////////////////////////////////////////////// -// Recursively copy a formula and all its subformulas +/** + * Recursively copy a formula and all its subformulas. + * + * @param + * @return + * + */ Operation * CopyUser (Operation * psOp) { Operation * psReturn; @@ -129,10 +180,13 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// 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 UserApproximateDefault (Operation * psOp) { double fReturn = NAN; double fVar1; @@ -154,14 +208,19 @@ return fReturn; } -////////////////////////////////////////////////////////////////// -// 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 operation, 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 operation, the differentiated result. + * + */ Operation * UserDifferentiateDefault (Operation * psOp, Operation * psWRT) { Operation * psReturn = NULL; OpBinary * psBin = NULL; @@ -182,13 +241,18 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Recursively simplify an operation if possible -// Because a new version may created and the original may be freed -// it's common practice to overwrite the variable pointing to the -// input structure with the return value -// psOp: the operation to simplify, which may be entirely freed -// returns: a simplifed version of the operation, which should be freed once no longer needed +/** + * + * Recursively simplify an operation if possible + * Because a new version may created and the original may be freed + * it's common practice to overwrite the variable pointing to the + * input structure with the return value + * + * @param psOp the operation to simplify, which may be entirely freed. + * @return a simplifed version of the operation, which should be freed once no + * longer needed + * + */ Operation * UserSimplifyDefault (Operation * psOp) { Operation * psReturn = NULL; OpUnary * psUna = NULL; @@ -211,8 +275,13 @@ return psReturn; } -////////////////////////////////////////////////////////////////// -// Compare two formulae recursively +/** + * Compare two formulae recursively. + * + * @param + * @return + * + */ bool UserCompare (Operation * psOp1, Operation * psOp2) { bool boReturn = TRUE; @@ -231,14 +300,17 @@ return boReturn; } -////////////////////////////////////////////////////////////////// -// Recursively turn a formula into a string -// Internal method. Directly allocates memory for the result, -// which must be freed manually once it's no longer needed -// using PropFree -// psOp: the operation to convert -// nStrLen: the maximum length the string can take -// returns: the resulting string in allocated memory +/** + * Recursively turn a formula into a string + * Internal method. Directly allocates memory for the result, + * which must be freed manually once it's no longer needed + * using PropFree + * + * @param psOp the operation to convert + * @param nStrLen the maximum length the string can take. + * @return the resulting string in allocated memory. + * + */ char * UserToString (Operation * psOp, char * szString, int nStrLen) { char * szVar1; @@ -263,10 +335,13 @@ return szString; } -////////////////////////////////////////////////////////////////// -// Recursively return the length of a formula turned into a string -// psOp: the operation to check -// returns: the length +/** + * Recursively return the length of a formula turned into a string. + * + * @param psOp the operation to check. + * @return the length. + * + */ int UserToStringLength (Operation * psOp) { int nReturn; int nVar1; @@ -287,15 +362,19 @@ return nReturn; } -////////////////////////////////////////////////////////////////// -// Recursively turn a formula into a string using float (0.0f) notation -// This will output a string that can be compiled into C/C++ or GLSL -// Internal method. Directly allocates memory for the result, -// which must be freed manually once it's no longer needed -// using PropFree -// psOp: the operation to convert -// nStrLen: the maximum length the string can take -// returns: the resulting string in allocated memory +/** + * + * Recursively turn a formula into a string using float (0.0f) notation + * This will output a string that can be compiled into C/C++ or GLSL + * Internal method. Directly allocates memory for the result, + * which must be freed manually once it's no longer needed + * using PropFree + * + * @param psOp the operation to convert. + * @param nStrLen the maximum length the string can take. + * @return the resulting string in allocated memory. + * + */ char * UserToStringC (Operation * psOp, char * szString, int nStrLen) { char * szVar1; @@ -320,10 +399,14 @@ return szString; } -////////////////////////////////////////////////////////////////// -// Recursively return the length of a formula turned into a string using float (0.0f) notation -// psOp: the operation to check -// returns: the length +/** + * Recursively return the length of a formula turned into a string using float + * (0.0f) notation. + * + * @param psOp the operation to check. + * @return the length. + * + */ int UserToStringCLength (Operation * psOp) { int nReturn; int nVar1; @@ -344,8 +427,13 @@ return nReturn; } -////////////////////////////////////////////////////////////////// -// Recursively free up all of the memory used by a formula and its sub formulas +/** + * Recursively free up all of the memory used by a formula and its sub formulas. + * + * @param + * @return + * + */ void UserFreeRecursive (Operation * psOp) { if ((psOp) && (psOp->eOpType == OPTYPE_UNARYUSER)) { if (psOp->Vars.psUnaryUser->psUserFunc) { @@ -357,10 +445,14 @@ } } -// Add a new nambed user function to the list -// psUserFuncs: the linked list of user functions to check -// szName: the name of the user function to add -// returns: the structure for the user function created +/** + * Add a new nambed user function to the list. + * + * @param psUserFuncs the linked list of user functions to check. + * @param szName the name of the user function to add. + * @return the structure for the user function created. + * + */ UserFunc * AddNewUserFunc (UserFunc * psUserFuncs, char const * const szName) { UserFunc * psNewFunc = NULL; UserFuncHead * psFuncHead = NULL; @@ -412,11 +504,17 @@ return psNewFunc; } -// Set the function callbacks for the user function -// psUserFunc: the user function to set the callbacks for -// pfApproximate: function returning the evaluated function as a rational (double) value -// pfDifferentiate: function returning the differential of the function -// pfSimplify: function performing a simplification of the function if possible +/** + * Set the function callbacks for the user function. + * + * @param psUserFunc the user function to set the callbacks for. + * @param pfApproximate function returning the evaluated function as a rational + * (double) value. + * @param pfDifferentiate function returning the differential of the function. + * @param pfSimplify function performing a simplification of the function if + * possible. + * + */ void SetUserFuncCallbacks (UserFunc * psUserFunc, UserApproximate pfApproximate, UserDifferentiate pfDifferentiate, UserSimplify pfSimplify, void * psContext) { psUserFunc->pfApproximate = pfApproximate; psUserFunc->pfDifferentiate = pfDifferentiate; @@ -424,10 +522,15 @@ psUserFunc->psContext = psContext; } -// Assign any user functions to an operation -// psOp: the operation to find user functions in -// psUserFuncs: the linked list of user functions to assign to the operation -// returns: the number of user functions already or newly assigned +/** + * Assign any user functions to an operation. + * + * @param psOp the operation to find user functions in. + * @param psUserFuncs the linked list of user functions to assign to the + * operation. + * @return the number of user functions already or newly assigned. + * + */ int AssignAllUserFuncs (Operation * psOp, UserFunc * psUserFuncs) { UserFunc * psUserFuncFound; int nAssigned; @@ -503,10 +606,14 @@ return nAssigned; } -// Find a user function with a given name -// psUserFuncs: the linked list of user functions to check -// szName: the name of the user function to find -// returns: the structure for the user function if found, or NULL otherwise +/** + * Find a user function with a given name. + * + * @param psUserFuncs the linked list of user functions to check. + * @param szName the name of the user function to find. + * @return the structure for the user function if found, or NULL otherwise. + * + */ UserFunc * FindUserFunc (UserFunc * psUserFuncs, char const * const szName) { bool boFound = FALSE; UserFunc * psUserFunc = NULL; @@ -527,8 +634,12 @@ return psUserFunc; } -// Free up any user functions that are no longer used in an operation -// psUserFuncs: the linked list of user functions to check +/** + * Free up any user functions that are no longer used in an operation. + * + * @param psUserFuncs the linked list of user functions to check. + * + */ UserFunc * FreeUserFuncs (UserFunc * psUserFuncs) { UserFuncHead * psFuncHead = NULL; UserFunc * psUserFunc = NULL; @@ -573,9 +684,13 @@ return psUserFunc; } -// Return the number of user functions in the linked list -// psUserFuncs: the linked list of user functions to check -// returns: the number of user functions in the list +/** + * Return the number of user functions in the linked list. + * + * @param psUserFuncs the linked list of user functions to check. + * @return the number of user functions in the list. + * + */ int UserFuncCount (UserFunc * psUserFuncs) { int nCount = 0; @@ -586,9 +701,13 @@ return nCount; } -// Return the first user functioon in the linked list -// psUserFunc: the user function to inspect -// returns: the first user function in the list +/** + * Return the first user functioon in the linked list. + * + * @param psUserFunc the user function to inspect. + * @return the first user function in the list. + * + */ UserFunc * UserFuncFirst (UserFunc * psUserFuncs) { UserFunc * psFind = NULL; if (psUserFuncs) { @@ -598,9 +717,13 @@ return psFind; } -// Return the last user functioon in the linked list -// psUserFunc: the user function to inspect -// returns: the last user function in the list +/** + * Return the last user functioon in the linked list. + * + * @param psUserFunc the user function to inspect. + * @return the last user function in the list. + * + */ UserFunc * UserFuncLast (UserFunc * psUserFuncs) { UserFunc * psFind = NULL; if (psUserFuncs) { @@ -610,9 +733,13 @@ return psFind; } -// Return the next user functioon in the linked list -// psUserFunc: the user function to inspect -// returns: the next user function in the list +/** + * Return the next user functioon in the linked list. + * + * @param psUserFunc the user function to inspect. + * @return the next user function in the list. + * + */ UserFunc * UserFuncNext (UserFunc * psUserFunc) { UserFunc * psFind = NULL; if (psUserFunc) { @@ -622,9 +749,13 @@ return psFind; } -// Return the previous user functioon in the linked list -// psUserFunc: the user function to inspect -// returns: the previous user function in the list +/** + * Return the previous user functioon in the linked list. + * + * @param psUserFunc the user function to inspect. + * @return the previous user function in the list. + * + */ UserFunc * UserFuncPrev (UserFunc * psUserFunc) { UserFunc * psFind = NULL; if (psUserFunc) { @@ -634,9 +765,13 @@ return psFind; } -// Return the user function name -// psUserFunc: the user function to inspect -// returns: the name of the variable +/** + * Return the user function name. + * + * @param psUserFunc the user function to inspect. + * @return the name of the variable. + * + */ char const * UserFuncName (UserFunc const * const psUserFunc) { char const * szName = NULL; diff -Nru libsymbolic-0.33.0/src/Variables.c libsymbolic-0.34.0/src/Variables.c --- libsymbolic-0.33.0/src/Variables.c 2015-08-08 23:16:37.000000000 +0000 +++ libsymbolic-0.34.0/src/Variables.c 2016-09-26 18:31:51.000000000 +0000 @@ -1,16 +1,27 @@ -////////////////////////////////////////////////////////////////// -// 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 + * @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 @@ ////////////////////////////////////////////////////////////////// // 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 @@ 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 @@ 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 @@ 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. + * + */ Variable * FreeVariables (Variable * psVariables) { VariableHead * psVarHead = NULL; Variable * psVariable = NULL; @@ -227,10 +268,14 @@ return psVariable; } -// Find a variable with a given name -// psVariables: the linked list of variables to check -// szVar: the name of the variable to find -// returns: the structure for the variable if found, or NULL otherwise +/** + * Find a variable with a given name. + * + * @param psVariables the linked list of variables to check. + * @param szVar the name of the variable to find. + * @return the structure for the variable if found, or NULL otherwise. + * + */ Variable * FindVariable (Variable * psVariables, char const * const szVar) { bool boFound = FALSE; Variable * psVariable = NULL; @@ -251,10 +296,14 @@ return psVariable; } -// Add a new nambed variable to the list -// psVariables: the linked list of variables to check -// szVar: the name of the variable to add -// returns: the structure for the variable created +/** + * Add a new nambed variable to the list. + * + * @param psVariables the linked list of variables to check. + * @param szVar the name of the variable to add. + * @return the structure for the variable created. + * + */ Variable * AddNewVariable (Variable * psVariables, char const * const szVar) { Variable * psNewVariable = NULL; VariableHead * psVarHead = NULL; @@ -305,9 +354,13 @@ return psNewVariable; } -// Return the number of variables in the linked list -// psVariables: the linked list of variables to check -// returns: the number of variables in the list +/** + * Return the number of variables in the linked list. + * + * @param psVariables the linked list of variables to check. + * @return the number of variables in the list. + * + */ int VariableCount (Variable * psVariables) { int nCount = 0; @@ -318,9 +371,13 @@ return nCount; } -// Return the first variable in the linked list -// psVariables: the linked list of variables to check -// returns: the first variable in the list +/** + * Return the first variable in the linked list. + * + * @param psVariables the linked list of variables to check. + * @return the first variable in the list. + * + */ Variable * VariableFirst (Variable * psVariables) { Variable * psFind = NULL; if (psVariables) { @@ -330,9 +387,13 @@ return psFind; } -// Return the last variable in the linked list -// psVariables: the linked list of variables to check -// returns: the last variable in the list +/** + * Return the last variable in the linked list. + * + * @param psVariables the linked list of variables to check. + * @return the last variable in the list. + * + */ Variable * VariableLast (Variable * psVariables) { Variable * psFind = NULL; if (psVariables) { @@ -342,9 +403,13 @@ return psFind; } -// Return the next variable in the linked list -// psVariables: the variable to inspect -// returns: the next variable in the list +/** + * Return the next variable in the linked list. + * + * @param psVariables the variable to inspect. + * @return the next variable in the list. + * + */ Variable * VariableNext (Variable * psVariables) { Variable * psFind = NULL; if (psVariables) { @@ -354,9 +419,13 @@ return psFind; } -// Return the previous variable in the linked list -// psVariables: the variable to inspect -// returns: the previous variable in the list +/** + * Return the previous variable in the linked list. + * + * @param psVariables the variable to inspect. + * @return the previous variable in the list. + * + */ Variable * VariablePrev (Variable * psVariables) { Variable * psFind = NULL; if (psVariables) { @@ -366,9 +435,13 @@ return psFind; } -// Return the variable name -// psVariable: the variable to inspect -// returns: the name of the variable +/** + * Return the variable name. + * + * @param psVariable the variable to inspect. + * @return the name of the variable. + * + */ char const * VariableName (Variable const * const psVariable) { char const * szName = NULL;