diff --git a/ChangeLog b/ChangeLog index f185444ccd..166d80bdc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-04-14 Dave Peticolas + + * lots of build system files: changes for the global id stuff. + + * src/engine/GNCId.c: engine globally unique id api implementation. + + * src/engine/guid/md5.c: taken from GNU textutils. + + * src/engine/guid/guid.c: new file with routines for generating + globally unique ids. + 2000-04-10 Dave Peticolas * doc/README: only the environment variable LANG needs to diff --git a/Makefile.common b/Makefile.common index e242ffe35e..71472c1c3b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,8 +1,22 @@ -### -*-makefile-*- ################################################# -## Makefile.common -## -## standard targets and rules -#################################################################### +# Makefile.common -- standard targets and rules +# Copyright (C) 2000 Linas Vepstas +# +# 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, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org # Autoconf notes... # Need to handle -MD there. @@ -34,6 +48,11 @@ ifdef GNOME_CONFIG_BIN GNOME_CFLAGS += $(shell ${GNOME_CONFIG_BIN} --cflags gnomeui) endif +ifdef GLIB_CONFIG_BIN + GLIB_CFLAGS := $(shell ${GLIB_CONFIG_BIN} --cflags) + GLIB_LIBS := $(shell ${GLIB_CONFIG_BIN} --libs) +endif + QT_FLAGS := diff --git a/Makefile.in b/Makefile.in index 0e8972df01..e8d5a43c8b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,13 +14,11 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Robin Clark -# Internet: rclark@rush.aero.org -# Address: 609 8th Street -# Huntington Beach, CA 92648-4632 +# along with this program; if not, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org include @top_srcdir@/Makefile.init diff --git a/Makefile.init.in b/Makefile.init.in index e4dc148391..904e2e00f9 100644 --- a/Makefile.init.in +++ b/Makefile.init.in @@ -1,3 +1,23 @@ +# Makefile.init -- configured make variables +# Copyright (C) 2000 Linas Vepstas +# +# 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, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org + @SET_MAKE@ export PATH := @GUILE_BIN@:@ABSOLUTE_TOP_SRCDIR@/lib/g-wrap-install/bin/:${PATH} diff --git a/config.h.in b/config.h.in index f9add2f783..8b93f84778 100644 --- a/config.h.in +++ b/config.h.in @@ -39,6 +39,12 @@ /* Enable debugging stuff */ #define USE_DEBUG +/* Standard C headers present */ +#undef STDC_HEADERS + +/* memcpy present */ +#undef HAVE_MEMCPY + /* check for stpcpy for Solaris */ #undef HAVE_STPCPY diff --git a/configure b/configure index a23e00982a..72de20225b 100755 --- a/configure +++ b/configure @@ -1289,16 +1289,200 @@ else SET_MAKE="MAKE=${MAKE-make}" fi +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1294: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 -for ac_func in stpcpy +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1374: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + +for ac_func in stpcpy memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1297: checking for $ac_func" >&5 +echo "configure:1481: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1346,6 +1530,7 @@ fi done + ### -------------------------------------------------------------------------- ### Fix up prefix for recursive expansion @@ -1467,99 +1652,19 @@ GNC_EXPANDED_LOCALE_DIR=`gnc_recursively_expand_var "${LOCALE_DIR}"` -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1472: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for locale.h""... $ac_c" 1>&6 -echo "configure:1553: checking for locale.h" >&5 +echo "configure:1658: checking for locale.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1583,19 +1688,19 @@ fi if test "$ac_cv_header_locale_h" = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:1587: checking for LC_MESSAGES" >&5 +echo "configure:1692: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:1599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -1616,7 +1721,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:1620: checking whether NLS is requested" >&5 +echo "configure:1725: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -1636,7 +1741,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:1640: checking whether included gettext is requested" >&5 +echo "configure:1745: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -1655,17 +1760,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:1659: checking for libintl.h" >&5 +echo "configure:1764: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1682,19 +1787,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:1686: checking for gettext in libc" >&5 +echo "configure:1791: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:1698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -1710,7 +1815,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:1714: checking for bindtextdomain in -lintl" >&5 +echo "configure:1819: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1718,7 +1823,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1745,12 +1850,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:1749: checking for gettext in libintl" >&5 +echo "configure:1854: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:1754: checking for gettext in -lintl" >&5 +echo "configure:1859: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1758,7 +1863,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1808,7 +1913,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1812: checking for $ac_word" >&5 +echo "configure:1917: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1842,12 +1947,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1846: checking for $ac_func" >&5 +echo "configure:1951: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1897,7 +2002,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1901: checking for $ac_word" >&5 +echo "configure:2006: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1933,7 +2038,7 @@ fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1937: checking for $ac_word" >&5 +echo "configure:2042: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGMERGE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1969,7 +2074,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1973: checking for $ac_word" >&5 +echo "configure:2078: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2001,7 +2106,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2032,7 +2137,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:2036: checking whether catgets can be used" >&5 +echo "configure:2141: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -2045,7 +2150,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:2049: checking for main in -li" >&5 +echo "configure:2154: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2053,14 +2158,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2088,12 +2193,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:2092: checking for catgets" >&5 +echo "configure:2197: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -2138,7 +2243,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2142: checking for $ac_word" >&5 +echo "configure:2247: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2174,7 +2279,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2178: checking for $ac_word" >&5 +echo "configure:2283: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2211,7 +2316,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2215: checking for $ac_word" >&5 +echo "configure:2320: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2246,7 +2351,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2250: checking for $ac_word" >&5 +echo "configure:2355: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2304,7 +2409,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2308: checking for $ac_word" >&5 +echo "configure:2413: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2338,7 +2443,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2342: checking for $ac_word" >&5 +echo "configure:2447: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2374,7 +2479,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2378: checking for $ac_word" >&5 +echo "configure:2483: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2469,7 +2574,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2473: checking for catalogs to be installed" >&5 +echo "configure:2578: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2550,7 +2655,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2554: checking for $ac_word" >&5 +echo "configure:2659: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2628,7 +2733,7 @@ fi # Extract the first word of "swig", so it can be a program name with args. set dummy swig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2632: checking for $ac_word" >&5 +echo "configure:2737: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SWIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2689,7 +2794,7 @@ then # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2693: checking for $ac_word" >&5 +echo "configure:2798: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2740,7 +2845,7 @@ then # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2744: checking for $ac_word" >&5 +echo "configure:2849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2790,7 +2895,7 @@ LIBS="$LIBS -lm" # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:2794: checking for X" >&5 +echo "configure:2899: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -2852,12 +2957,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2926,14 +3031,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -3039,17 +3144,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:3043: checking whether -R must be followed by a space" >&5 +echo "configure:3148: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -3065,14 +3170,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -3104,7 +3209,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:3108: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:3213: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3112,7 +3217,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3145,7 +3250,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:3149: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:3254: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3153,7 +3258,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3193,12 +3298,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:3197: checking for gethostbyname" >&5 +echo "configure:3302: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -3242,7 +3347,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3246: checking for gethostbyname in -lnsl" >&5 +echo "configure:3351: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3250,7 +3355,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3291,12 +3396,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:3295: checking for connect" >&5 +echo "configure:3400: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -3340,7 +3445,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:3344: checking for connect in -lsocket" >&5 +echo "configure:3449: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3348,7 +3453,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3383,12 +3488,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:3387: checking for remove" >&5 +echo "configure:3492: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -3432,7 +3537,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:3436: checking for remove in -lposix" >&5 +echo "configure:3541: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3440,7 +3545,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3475,12 +3580,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:3479: checking for shmat" >&5 +echo "configure:3584: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -3524,7 +3629,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:3528: checking for shmat in -lipc" >&5 +echo "configure:3633: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3532,7 +3637,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3576,7 +3681,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:3580: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:3685: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3584,7 +3689,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3717,7 +3822,7 @@ fi # the XmHTML widget needs libz, libjpeg, libpng and libm # it also uses #ifdef's not #if's so DONT #def to zero. echo $ac_n "checking for deflateEnd in -lz""... $ac_c" 1>&6 -echo "configure:3721: checking for deflateEnd in -lz" >&5 +echo "configure:3826: checking for deflateEnd in -lz" >&5 ac_lib_var=`echo z'_'deflateEnd | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3725,7 +3830,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3760,7 +3865,7 @@ else fi echo $ac_n "checking for jpeg_read_scanlines in -ljpeg""... $ac_c" 1>&6 -echo "configure:3764: checking for jpeg_read_scanlines in -ljpeg" >&5 +echo "configure:3869: checking for jpeg_read_scanlines in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_read_scanlines | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3768,7 +3873,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3803,7 +3908,7 @@ else fi echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:3807: checking for png_read_image in -lpng" >&5 +echo "configure:3912: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3811,7 +3916,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpng $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3852,7 +3957,7 @@ fi # LIBS="-lXmu -lXt -lXext $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6 -echo "configure:3856: checking for XpmReadFileToXpmImage in -lXpm" >&5 +echo "configure:3961: checking for XpmReadFileToXpmImage in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3860,7 +3965,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXpm $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3902,7 +4007,7 @@ fi # Don't build the xmhtml source if user already has it installed... # this is ugly, there must be a nicer way of setting this up ... echo $ac_n "checking for XmHTMLTextScrollToLine in -lXmHTML""... $ac_c" 1>&6 -echo "configure:3906: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5 +echo "configure:4011: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5 ac_lib_var=`echo XmHTML'_'XmHTMLTextScrollToLine | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3910,7 +4015,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXmHTML $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS $X_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3968,14 +4073,14 @@ GNOME_STATIC_TARGET="gnome.static.real" #AC_CHECK_HEADER might work, but I'm not sure it uses CPPFLAGS # this guarantees it - it works. Promise!! echo $ac_n "checking gtk-xmhtml/gtk-xmhtml.h""... $ac_c" 1>&6 -echo "configure:3972: checking gtk-xmhtml/gtk-xmhtml.h" >&5 +echo "configure:4077: checking gtk-xmhtml/gtk-xmhtml.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3997,7 +4102,7 @@ CPPFLAGS="$OLDCPPFLAGS" ### -------------------------------------------------------------------------- # If readline exists, just assume that guile needs it. It probably does. echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:4001: checking for readline in -lreadline" >&5 +echo "configure:4106: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4005,7 +4110,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4050,7 +4155,7 @@ EXTRALIBS=`$GNOME_CONFIG_BIN --libs gtkxmhtml` #check for gtkxmhtml, export library link to variable GTK_XMHTML echo $ac_n "checking for gtk_xmhtml_new in -lgtkxmhtml""... $ac_c" 1>&6 -echo "configure:4054: checking for gtk_xmhtml_new in -lgtkxmhtml" >&5 +echo "configure:4159: checking for gtk_xmhtml_new in -lgtkxmhtml" >&5 ac_lib_var=`echo gtkxmhtml'_'gtk_xmhtml_new | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4058,7 +4163,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgtkxmhtml $EXTRALIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4101,7 +4206,7 @@ EXTRALIBS=`$GNOME_CONFIG_BIN --libs print` # check for gnome-print and enable it via HAVE_LIBGNOMEPRINT # if found echo $ac_n "checking for gnome_print_context_new in -lgnomeprint""... $ac_c" 1>&6 -echo "configure:4105: checking for gnome_print_context_new in -lgnomeprint" >&5 +echo "configure:4210: checking for gnome_print_context_new in -lgnomeprint" >&5 ac_lib_var=`echo gnomeprint'_'gnome_print_context_new | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4109,7 +4214,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnomeprint $EXTRALIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4171,7 +4276,7 @@ fi if test "${with_guile_config+set}" = set; then withval="$with_guile_config" echo $ac_n "checking for guile-config""... $ac_c" 1>&6 -echo "configure:4175: checking for guile-config" >&5 +echo "configure:4280: checking for guile-config" >&5 echo "$ac_t""${with_guile_config}" 1>&6 GUILE_CONFIG="$with_guile_config" LIBS="`${GUILE_CONFIG} link` ${LIBS}" @@ -4184,7 +4289,7 @@ if test x"$GUILE_CONFIG" = x; then # Extract the first word of "guile-config", so it can be a program name with args. set dummy guile-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4188: checking for $ac_word" >&5 +echo "configure:4293: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GUILE_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4240,7 +4345,7 @@ if test x"$GUILE_CONFIG" = x; then GNC_LIBS_SAFE=${LIBS} echo $ac_n "checking for guile""... $ac_c" 1>&6 -echo "configure:4244: checking for guile" >&5 +echo "configure:4349: checking for guile" >&5 if eval "test \"`echo '$''{'ac_cv_lib_guile'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4253,14 +4358,14 @@ else else LIBS="${GNC_TEST_LIBS} ${GNC_LIBS_SAFE}" cat > conftest.$ac_ext < int main() { gh_eval_file; ; return 0; } EOF -if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* GUILELIBS="${GNC_TEST_LIBS}" else @@ -4287,7 +4392,7 @@ if test x"$GUILE_CONFIG" != x; then # Extract the first word of "guile", so it can be a program name with args. set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4291: checking for $ac_word" >&5 +echo "configure:4396: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4326,7 +4431,7 @@ if test x"$GUILE_BIN" = x && test x"$with_guile" != x; then # Extract the first word of "guile", so it can be a program name with args. set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4330: checking for $ac_word" >&5 +echo "configure:4435: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4365,7 +4470,7 @@ if test x"${GUILE_BIN}" = x; then # Extract the first word of "guile", so it can be a program name with args. set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4369: checking for $ac_word" >&5 +echo "configure:4474: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4660,10 +4765,10 @@ s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@RANLIB@%$RANLIB%g s%@CC@%$CC%g +s%@CPP@%$CPP%g s%@OPT_STYLE_INSTALL@%$OPT_STYLE_INSTALL%g s%@LOCALE_DIR@%$LOCALE_DIR%g s%@GNC_EXPANDED_LOCALE_DIR@%$GNC_EXPANDED_LOCALE_DIR%g -s%@CPP@%$CPP%g s%@USE_NLS@%$USE_NLS%g s%@MSGFMT@%$MSGFMT%g s%@GMSGFMT@%$GMSGFMT%g diff --git a/configure.in b/configure.in index a0ecdae083..aab9ea2dbb 100644 --- a/configure.in +++ b/configure.in @@ -38,8 +38,10 @@ AC_PROG_CC AC_ISC_POSIX AC_C_BIGENDIAN AC_PROG_MAKE_SET +AC_HEADER_STDC + +AC_CHECK_FUNCS(stpcpy memcpy) -AC_CHECK_FUNCS(stpcpy) ### -------------------------------------------------------------------------- ### Fix up prefix for recursive expansion diff --git a/src/Makefile.in b/src/Makefile.in index f1eee6699a..1acf097677 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -13,19 +13,18 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Robin Clark -# Internet: rclark@rush.aero.org -# Address: 609 8th Street -# Huntington Beach, CA 92648-4632 +# along with this program; if not, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org include @top_srcdir@/Makefile.init INCLPATH = -I. \ -I.. \ -I./engine \ + -I./engine/guid \ -I./register \ -Ireports \ -I@srcdir@/../include \ diff --git a/src/engine/Account.c b/src/engine/Account.c index 63a060f08e..874a4fd5c1 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -1,7 +1,7 @@ /********************************************************************\ * Account.c -- the Account data structure * * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999 Linas Vepstas * + * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #include @@ -37,6 +36,7 @@ #include "Queue.h" #include "Transaction.h" #include "TransactionP.h" +#include "GNCIdP.h" #include "util.h" /* The unsafe_ops flag allows certain unsafe manipulations to be @@ -109,7 +109,17 @@ Account * xaccMallocAccount( void ) { Account *acc = (Account *)_malloc(sizeof(Account)); + xaccInitAccount (acc); + + guid_new(&acc->guid); + + if (xaccGUIDType(&acc->guid) != GNC_ID_NONE) { + PWARN("xaccMallocAccount: duplicate id\n"); + } + + xaccStoreEntity(acc, &acc->guid, GNC_ID_ACCOUNT); + return acc; } @@ -124,10 +134,12 @@ xaccFreeAccount( Account *acc ) Transaction *t; if (NULL == acc) return; - + + xaccRemoveEntity(&acc->guid); + /* First, recursively free children */ xaccFreeAccountGroup (acc->children); - + /* Next, clean up the splits */ /* any split pointing at this account needs to be unmarked */ for (i=0; inumSplits; i++) { @@ -152,7 +164,7 @@ xaccFreeAccount( Account *acc ) _free (acc->splits); acc->splits = NULL; acc->numSplits = 0; - + /* Finally, clean up the account info */ if (acc->accInfo) xaccFreeAccInfo (acc->accInfo); acc->accInfo = NULL; @@ -208,6 +220,24 @@ xaccAccountCommitEdit (Account *acc) acc->open = 0; } +/********************************************************************\ +\********************************************************************/ +GUID * +xaccAccountGetGUID (Account *account) +{ + if (!account) return NULL; + return &account->guid; +} + +/********************************************************************\ +\********************************************************************/ +Account * +xaccAccountLookup (GUID *guid) +{ + if (!guid) return NULL; + return xaccLookupEntity(guid, GNC_ID_ACCOUNT); +} + /********************************************************************\ \********************************************************************/ @@ -896,9 +926,9 @@ xaccConsolidateTransactions (Account * acc) if (xaccSplitGetReconcile(sa) != NREC) continue; - /* We get the matching split using the tickee value + /* We get the matching split using the ticket value generated by xaccTransMatch above. */ - sb = xaccTransGetSplit(tb, sa->tickee); + sb = xaccTransGetSplit(tb, sa->ticket); xaccSplitSetReconcile (sa, xaccSplitGetReconcile(sb)); xaccSplitGetDateReconciledTS (sb, &ts); diff --git a/src/engine/Account.h b/src/engine/Account.h index 9f13674d57..f2164572e6 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -28,6 +28,7 @@ #include "config.h" #include "AccInfo.h" #include "Transaction.h" +#include "GNCId.h" /** PROTOTYPES ******************************************************/ @@ -49,6 +50,19 @@ void xaccFreeAccount( Account * ); void xaccAccountBeginEdit (Account *, int defer); void xaccAccountCommitEdit (Account *); +/* + * The xaccAccountGetGUID() subroutine will return the + * globally unique id associated with that account. + * User code should use this id to reference accounts + * and *not* the integer account id below. + * + * The xaccAccountLookup() subroutine will return the + * account associated with the given id, or NULL + * if there is no such account. + */ +GUID * xaccAccountGetGUID (Account *account); +Account * xaccAccountLookup (GUID *guid); + int xaccGetAccountID (Account *); char xaccGetAccountFlags (Account *); @@ -56,11 +70,11 @@ char xaccGetAccountFlags (Account *); * The xaccAccountInsertSplit() method will insert the indicated * split into the indicated account. If the split already * belongs to another account, it will be removed from that - * account first. + * account first. */ void xaccAccountInsertSplit (Account *, Split *); -/* The xaccCheckDateOrder() surboutine checks to see if +/* The xaccCheckDateOrder() subroutine checks to see if * a split is in proper sorted date order with respect * to the other splits in this account. * @@ -109,13 +123,13 @@ void xaccConsolidateTransactions (Account *); /* The xaccMoveFarEnd() method changes the account to which the * "far end" of the split belongs. The "far end" is as follows: - * Double-entry transactions by thier nature consist of a set of + * Double-entry transactions by their nature consist of a set of * two or more splits. If the transaction has precisely two splits, * then the "far end" is the "other split" of the pair. If * the transaction consists of three or more splits, then the * "far end" is undefined. All that the xaccMoveFareEnd() method * does is reparent the "other split" to the indicated account. - * The first argument is the split whose fare end will be changed, + * The first argument is the split whose far end will be changed, * the second argument is the new far-end account. */ diff --git a/src/engine/AccountP.h b/src/engine/AccountP.h index 933ad5a023..937715e35f 100644 --- a/src/engine/AccountP.h +++ b/src/engine/AccountP.h @@ -1,3 +1,27 @@ +/********************************************************************\ + * Account.h -- the Account data structure * + * Copyright (C) 1997 Robin D. Clark * + * Copyright (C) 1997, 1998, 1999 Linas Vepstas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + /* * FILE: * AccountP.h @@ -15,37 +39,14 @@ * */ -/********************************************************************\ - * Account.h -- the Account data structure * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999 Linas Vepstas * - * * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * - * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * -\********************************************************************/ - #ifndef __XACC_ACCOUNT_P_H__ #define __XACC_ACCOUNT_P_H__ #include "config.h" #include "AccInfo.h" #include "Transaction.h" +#include "GNCId.h" + /** STRUCTS *********************************************************/ struct _account { @@ -106,7 +107,7 @@ struct _account { char *security; /* The parent and children pointers are used to implement an account - * heirarchy, of accounts that have sub-accounts ("detail accounts"). + * hierarchy, of accounts that have sub-accounts ("detail accounts"). */ AccountGroup *parent; /* back-pointer to parent */ AccountGroup *children; /* pointer to sub-accounts */ @@ -117,6 +118,8 @@ struct _account { int id; /* unique account id, internally assigned */ char flags; + GUID guid; /* globally unique account id */ + /* protected data, cached parameters */ double balance; double cleared_balance; diff --git a/src/engine/FileIO.c b/src/engine/FileIO.c index 606fe29629..6364a564dc 100644 --- a/src/engine/FileIO.c +++ b/src/engine/FileIO.c @@ -97,6 +97,7 @@ #include "Transaction.h" #include "TransactionP.h" #include "TransLog.h" +#include "GNCIdP.h" #include "util.h" #define PERMS 0666 @@ -155,7 +156,7 @@ static int writeTSDate( int fd, Timespec *); /*******************************************************/ /* backwards compatibility definitions for numeric value * of account type. These numbers are used (are to be - * used) no where else but here, precisely because they + * used) nowhere else but here, precisely because they * are non-portable. The values of these defines MUST * NOT BE CHANGED; ANY CHANGES WILL BREAK FILE COMPATIBILITY. * YOU HAVE BEEN WARNED!!!! @@ -307,14 +308,14 @@ xaccReadAccountGroup( int fd ) maingrp = 0x0; error_code = ERR_FILEIO_NO_ERROR; - + /* check for valid file descriptor */ if( 0 > fd ) { error_code = ERR_FILEIO_FILE_NOT_FOUND; return NULL; } - + /* Read in the file format token */ err = read( fd, &token, sizeof(int) ); if( sizeof(int) != err ) @@ -534,7 +535,7 @@ readAccount( int fd, AccountGroup *grp, int token ) xaccAccountSetCurrency (acc, DEFAULT_CURRENCY); } - /* aux account info first appears in versin ten files */ + /* aux account info first appears in version ten files */ if (10 <= token) { readAccInfo( fd, acc, token ); } @@ -600,7 +601,7 @@ readAccount( int fd, AccountGroup *grp, int token ) * With the double-entry system, the file may reference accounts * that have not yet been read or properly parented. Thus, we need * a way of dealing with this, and this routine performs this - * work. Basically, accounts are requested by thier id. If an + * work. Basically, accounts are requested by their id. If an * account with the indicated ID does not exist, it is created * and placed in a temporary holding cell. Accounts in the * holding cell can be located, (so that transactions can be @@ -632,19 +633,19 @@ locateAccount (int acc_id) /* normalize the account numbers -- positive-definite. * That is, the unique id must never decrease, - * nor must it overalp any existing account id */ + * nor must it overlap any existing account id */ if (next_free_unique_account_id <= acc_id) { next_free_unique_account_id = acc_id+1; } return acc; } - + static Account * springAccount (int acc_id) { Account * acc; - + /* first, see if we're confused about the account */ acc = xaccGetAccountFromID (maingrp, acc_id); if (acc) { @@ -665,7 +666,7 @@ springAccount (int acc_id) printf ("Couldn't find account \n"); return NULL; } - + /********************************************************************\ * readInvAcct * * reads in the auxilliary account info * @@ -1005,6 +1006,7 @@ readTransaction( int fd, Account *acc, int token ) * Later versions don't have this. */ offset = 1; split = readSplit (fd, token); + xaccRemoveEntity(&trans->splits[0]->guid); xaccFreeSplit (trans->splits[0]); trans->splits[0] = split; split->parent = trans; @@ -1024,6 +1026,7 @@ readTransaction( int fd, Account *acc, int token ) split = readSplit (fd, token); if (0 == i+offset) { /* the first split has been malloced. just replace it */ + xaccRemoveEntity (&trans->splits[i+offset]->guid); xaccFreeSplit (trans->splits[i+offset]); trans->splits[i+offset] = split; split->parent = trans; diff --git a/src/engine/GNCId.c b/src/engine/GNCId.c new file mode 100644 index 0000000000..4def72e1ea --- /dev/null +++ b/src/engine/GNCId.c @@ -0,0 +1,221 @@ +/********************************************************************\ + * GNCId.c -- Gnucash entity identifier implementation * + * Copyright (C) 2000 Dave Peticolas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#include "config.h" + +#include +#include + +#include "GNCIdP.h" + + +/** Type definitions ************************************************/ +typedef struct entity_node +{ + GNCIdType entity_type; + gpointer entity; +} EntityNode; + + +/** Static global variables *****************************************/ +static GHashTable * entity_table = NULL; + + +/** Function implementations ****************************************/ + +static gboolean +entity_node_destroy(gpointer key, gpointer value, gpointer not_used) +{ + GUID *guid = key; + EntityNode *e_node = value; + + e_node->entity_type = GNC_ID_NONE; + e_node->entity = NULL; + + g_free(guid); + g_free(e_node); + + return TRUE; +} + +static void entity_table_destroy() +{ + if (entity_table == NULL) + return; + + g_hash_table_foreach_remove(entity_table, entity_node_destroy, NULL); + g_hash_table_destroy(entity_table); + + entity_table = NULL; +} + +static guint +id_hash(gconstpointer key) +{ + const GUID *guid = key; + + if (key == NULL) + return 0; + + if (sizeof(guint) <= 16) + return *((guint *) guid->data); + else + { + guint hash = 0; + int i, j; + + for (i = 0, j = 0; i < sizeof(guint); i++, j++) + { + if (j == 16) + j = 0; + + hash <<= 4; + hash |= guid->data[j]; + } + + return hash; + } +} + +static gboolean +id_compare(gconstpointer key_1, gconstpointer key_2) +{ + return memcmp(key_1, key_2, sizeof(GUID)) == 0; +} + +static void summarize_table(); + +static void +entity_table_init() +{ + if (entity_table != NULL) + entity_table_destroy(); + + entity_table = g_hash_table_new(id_hash, id_compare); + + atexit(summarize_table); +} + +GNCIdType +xaccGUIDType(GUID * guid) +{ + EntityNode *e_node; + + if (guid == NULL) + return GNC_ID_NONE; + + if (entity_table == NULL) + entity_table_init(); + + e_node = g_hash_table_lookup(entity_table, guid->data); + if (e_node == NULL) + return GNC_ID_NONE; + + return e_node->entity_type; +} + +void * +xaccLookupEntity(GUID * guid, GNCIdType entity_type) +{ + EntityNode *e_node; + + if (guid == NULL) + return NULL; + + if (entity_table == NULL) + entity_table_init(); + + e_node = g_hash_table_lookup(entity_table, guid->data); + if (e_node == NULL) + return NULL; + + if (e_node->entity_type != entity_type) + return NULL; + + return e_node->entity; +} + +void +xaccStoreEntity(void * entity, GUID * guid, GNCIdType entity_type) +{ + EntityNode *e_node; + GUID *new_guid; + + if (entity == NULL) + return; + + if (guid == NULL) + return; + + if ((entity_type <= GNC_ID_NONE) || (entity_type > LAST_GNC_ID)) + return; + + xaccRemoveEntity(guid); + + e_node = g_new(EntityNode, 1); + e_node->entity_type = entity_type; + e_node->entity = entity; + + new_guid = g_new(GUID, 1); + *new_guid = *guid; + + g_hash_table_insert(entity_table, new_guid, e_node); +} + +void +xaccRemoveEntity(GUID * guid) +{ + gpointer e_node; + gpointer old_guid; + + if (guid == NULL) + return; + + if (entity_table == NULL) + entity_table_init(); + + if (g_hash_table_lookup_extended(entity_table, guid, &old_guid, &e_node)) + { + g_hash_table_remove(entity_table, old_guid); + entity_node_destroy(old_guid, e_node, NULL); + } +} + +static void +print_node(gpointer key, gpointer value, gpointer not_used) +{ + GUID *guid = key; + EntityNode *node = value; + + fprintf(stderr, "%s %d %p\n", + guid_to_string(guid), node->entity_type, node->entity); +} + +static void +summarize_table() +{ + if (entity_table == NULL) + return; + + g_hash_table_foreach(entity_table, print_node, NULL); +} diff --git a/src/engine/GNCId.h b/src/engine/GNCId.h new file mode 100644 index 0000000000..23850ca5c0 --- /dev/null +++ b/src/engine/GNCId.h @@ -0,0 +1,64 @@ +/********************************************************************\ + * GNCId.h -- Gnucash entity identifier API * + * Copyright (C) 2000 Dave Peticolas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#ifndef __GNC_ID__ +#define __GNC_ID__ 1 + +/* This file defines an API for using gnucash entity identifiers. + * + * Identifiers can be used to reference Account Groups, Accounts, + * Transactions, and Splits. These four Gnucash types are referred to + * as Gnucash entities. Identifiers are globally-unique and permanent, + * i.e., once an entity has been assigned an identifier, it retains + * that same identifier for its lifetime. + * + * Identifiers can be encoded as hex strings. */ + +#include + +#include "guid.h" +#include "util.h" + + +/* Identifiers are 'typed' with integers. The ids used in gnucash are + * defined below. An id with type GNC_ID_NONE does not refer to any + * entity. An identifier with a type other than GNC_ID_NONE may refer + * to an actual entity, but that is not guaranteed. If an id does + * refer to an entity, the type of the entity will match the type + * of the identifier. */ +typedef enum +{ + GNC_ID_NONE = 0, + GNC_ID_GROUP, + GNC_ID_ACCOUNT, + GNC_ID_TRANS, + GNC_ID_SPLIT, + LAST_GNC_ID = GNC_ID_SPLIT +} GNCIdType; + + +/* Return the type of an identifier. */ +GNCIdType xaccGUIDType(GUID * guid); + + +#endif diff --git a/src/engine/GNCIdP.h b/src/engine/GNCIdP.h new file mode 100644 index 0000000000..539daaed09 --- /dev/null +++ b/src/engine/GNCIdP.h @@ -0,0 +1,45 @@ +/********************************************************************\ + * GNCIdP.h -- Gnucash entity identifier engine-only API * + * Copyright (C) 2000 Dave Peticolas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#ifndef __GNC_ID_P__ +#define __GNC_ID_P__ 1 + +#include "GNCId.h" + +/* This file defines an engine-only API for using gnucash entity + * identifiers. */ + +/* Lookup an entity given an id and a type. If there is no entity + * associated with the id, or if it has a different type, NULL + * is returned. */ +void * xaccLookupEntity(GUID * guid, GNCIdType entity_type); + +/* Store the given entity under the given id with the given type. */ +void xaccStoreEntity(void * entity, GUID * guid, GNCIdType entity_type); + +/* Remove any existing association between an entity and the given + * id. The entity is not changed in any way. */ +void xaccRemoveEntity(GUID * guid); + + +#endif diff --git a/src/engine/Group.c b/src/engine/Group.c index a000ab5ee2..de2492ee2a 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #include @@ -33,9 +32,12 @@ #include "Group.h" #include "GroupP.h" #include "TransactionP.h" +#include "GNCIdP.h" #include "util.h" #include "gnc-common.h" +static short module = MOD_ENGINE; + /********************************************************************\ * Because I can't use C++ for this project, doesn't mean that I * * can't pretend to! These functions perform actions on the * @@ -49,12 +51,12 @@ void xaccInitializeAccountGroup (AccountGroup *grp) { grp->saved = GNC_T; - + grp->parent = NULL; grp->numAcc = 0; grp->account = _malloc (sizeof (Account *)); grp->account[0] = NULL; /* null-terminated array */ - + grp->balance = 0.0; } @@ -64,9 +66,17 @@ AccountGroup * xaccMallocAccountGroup( void ) { AccountGroup *grp = (AccountGroup *)_malloc(sizeof(AccountGroup)); - + xaccInitializeAccountGroup (grp); + guid_new(&grp->guid); + + if (xaccGUIDType(&grp->guid) != GNC_ID_NONE) { + PWARN("xaccMallocAccountGroup: duplicate id\n"); + } + + xaccStoreEntity(grp, &grp->guid, GNC_ID_GROUP); + return grp; } @@ -76,12 +86,14 @@ void xaccFreeAccountGroup( AccountGroup *grp ) { int i; + if (NULL == grp) return; - for( i=0; inumAcc; i++ ) { + xaccRemoveEntity(&grp->guid); + + for( i=0; inumAcc; i++ ) xaccFreeAccount( grp->account[i] ); - } - + _free( grp->account ); /* null everything out, just in case somebody @@ -90,7 +102,7 @@ xaccFreeAccountGroup( AccountGroup *grp ) grp->numAcc = 0; grp->account = NULL; grp->balance = 0.0; - + _free(grp); } @@ -136,6 +148,24 @@ xaccAccountGroupNotSaved (AccountGroup *grp) return 0; } +/********************************************************************\ +\********************************************************************/ +GUID * +xaccGroupGetGUID (AccountGroup *group) +{ + if (!group) return NULL; + return &group->guid; +} + +/********************************************************************\ +\********************************************************************/ +AccountGroup * +xaccGroupLookup (GUID *guid) +{ + if (!guid) return NULL; + return xaccLookupEntity(guid, GNC_ID_GROUP); +} + /********************************************************************\ * Get the number of accounts, including subaccounts * \********************************************************************/ @@ -758,7 +788,7 @@ xaccConcatGroups (AccountGroup *togrp, AccountGroup *fromgrp) if (!togrp) return; if (!fromgrp) return; - + /* The act of inserting the account into togrp also causes * it to automatically be deleted from fromgrp. But use a * saved copy of fromgrp's numAcc member since, after the diff --git a/src/engine/Group.h b/src/engine/Group.h index bbbee85cb5..91f3c41159 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -1,7 +1,7 @@ /********************************************************************\ * Group.h -- the main data structure of the program * * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998 Linas Vepstas * + * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #ifndef __XACC_ACCOUNT_GROUP_H__ @@ -30,10 +29,23 @@ #include "gnc-common.h" #include "Account.h" +#include "GNCId.h" + /** PROTOTYPES ******************************************************/ -AccountGroup *xaccMallocAccountGroup( void ); -void xaccFreeAccountGroup( AccountGroup *account_group ); +AccountGroup *xaccMallocAccountGroup( void ); +void xaccFreeAccountGroup( AccountGroup *account_group ); + +/* + * The xaccGroupGetGUID() subroutine will return the + * globally unique id associated with that group. + * + * The xaccGroupLookup() subroutine will return the + * group associated with the given id, or NULL + * if there is no such group. + */ +GUID * xaccGroupGetGUID (AccountGroup *group); +AccountGroup * xaccGroupLookup (GUID *guid); /* * The xaccConcatGroups() subroutine will move all accounts diff --git a/src/engine/GroupP.h b/src/engine/GroupP.h index 2e7f3fde50..db73d3f7cf 100644 --- a/src/engine/GroupP.h +++ b/src/engine/GroupP.h @@ -1,17 +1,7 @@ -/* - * FILE: - * GroupP.h - * - * FUNCTION: - * This is the *private* account group structure. - * This header should *not* be included by any code outside of the - * engine. - * - */ /********************************************************************\ * GroupP.h -- the main data structure of the program * * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998 Linas Vepstas * + * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -24,20 +14,32 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ +/* + * FILE: + * GroupP.h + * + * FUNCTION: + * This is the *private* account group structure. + * This header should *not* be included by any code outside of the + * engine. + * + */ + #ifndef __XACC_ACCOUNT_GROUP_P_H__ #define __XACC_ACCOUNT_GROUP_P_H__ #include "config.h" #include "Transaction.h" +#include "GNCId.h" + /** STRUCTS *********************************************************/ struct _account_group { @@ -50,9 +52,10 @@ struct _account_group { int numAcc; /* number of accounts in array */ Account **account; /* array of account pointers */ + GUID guid; /* globally unique id */ + /* cached parameters */ double balance; - }; #endif /* __XACC_ACCOUNT_GROUP_P_H__ */ diff --git a/src/engine/Makefile.in b/src/engine/Makefile.in index f5b43c9261..7f005f082d 100644 --- a/src/engine/Makefile.in +++ b/src/engine/Makefile.in @@ -14,27 +14,30 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Robin Clark -# Internet: rclark@rush.aero.org -# Address: 609 8th Street -# Huntington Beach, CA 92648-4632 +# along with this program; if not, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org include @top_srcdir@/Makefile.init -INCLPATH = -I@srcdir@/../../include -I@srcdir@/../.. -I@prefix@/include +INCLPATH = -I@srcdir@/../../include \ + -I@srcdir@/../.. \ + -I@srcdir@/guid \ + -I@prefix@/include # add the -fpic flag to generate relocatable position independent code -# for the engine so that in can be used in a shared module (e.g. a perl module) -CFLAGS = @CFLAGS@ ${INCLPATH} -fpic +# for the engine so that in can be used in a shared module (e.g. a perl module) +CFLAGS = @CFLAGS@ ${INCLPATH} -fpic ${GLIB_CFLAGS} +LIBS = @LIBS@ ${GLIB_LIBS} ###################################################################### # See Makefile.common for information about these variables. INDEP_SRCS := AccInfo.c Account.c DateUtils.c FileIO.c Group.c \ LedgerUtils.c QIFIO.c Query.c Queue.c Scrub.c Session.c \ - Transaction.c TransLog.c date.c util.c + Transaction.c TransLog.c date.c util.c GNCId.c \ + guid/md5.c guid/guid.c ###################################################################### all: default diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c index 7b5905bf50..c092958a7e 100644 --- a/src/engine/Transaction.c +++ b/src/engine/Transaction.c @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #include @@ -37,6 +36,7 @@ #include "Transaction.h" #include "TransactionP.h" #include "TransLog.h" +#include "GNCIdP.h" #include "util.h" #include "date.h" @@ -102,7 +102,7 @@ xaccInitSplit(Split * split) split->share_reconciled_balance = 0.0; split->cost_basis = 0.0; - split->tickee = 0; + split->ticket = 0; } /********************************************************************\ @@ -112,7 +112,17 @@ Split * xaccMallocSplit(void) { Split *split = (Split *)_malloc(sizeof(Split)); + xaccInitSplit (split); + + guid_new(&split->guid); + + if (xaccGUIDType(&split->guid) != GNC_ID_NONE) { + PWARN("xaccMallocSplit: duplicate id\n"); + } + + xaccStoreEntity(split, &split->guid, GNC_ID_SPLIT); + return split; } @@ -142,6 +152,8 @@ xaccCloneSplit (Split *s) split->date_reconciled.tv_sec = s->date_reconciled.tv_sec; split->date_reconciled.tv_nsec = s->date_reconciled.tv_nsec; + split->guid = s->guid; + /* no need to futz with the balances; these get wiped each time ... * split->balance = s->balance; * split->cleared_balance = s->cleared_balance; @@ -182,6 +194,24 @@ xaccFreeSplit( Split *split ) _free(split); } +/********************************************************************\ +\********************************************************************/ +GUID * +xaccSplitGetGUID (Split *split) +{ + if (!split) return NULL; + return &split->guid; +} + +/********************************************************************\ +\********************************************************************/ +Split * +xaccSplitLookup (GUID *guid) +{ + if (!guid) return NULL; + return xaccLookupEntity(guid, GNC_ID_SPLIT); +} + /********************************************************************\ \********************************************************************/ @@ -355,7 +385,17 @@ Transaction * xaccMallocTransaction( void ) { Transaction *trans = (Transaction *)_malloc(sizeof(Transaction)); + xaccInitTransaction (trans); + + guid_new(&trans->guid); + + if (xaccGUIDType(&trans->guid) != GNC_ID_NONE) { + PWARN("xaccMallocTransaction: duplicate id\n"); + } + + xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS); + return trans; } @@ -380,7 +420,7 @@ xaccCloneTransaction (Transaction *t) trans->docref = strdup(t->docref); n=0; while (t->splits[n]) n++; - trans->splits = (Split **) _malloc ((n+1)* sizeof (Split *)); + trans->splits = (Split **) _malloc ((n+1)* sizeof (Split *)); n=0; while (t->splits[n]) { @@ -398,6 +438,8 @@ xaccCloneTransaction (Transaction *t) trans->open = 0; trans->orig = NULL; + trans->guid = t->guid; + return (trans); } @@ -412,6 +454,7 @@ xaccFreeTransaction( Transaction *trans ) Split *s; if (!trans) return; + ENTER ("xaccFreeTransaction(): addr=%p\n", trans); /* free up the destination splits */ @@ -451,9 +494,28 @@ xaccFreeTransaction( Transaction *trans ) } _free(trans); + LEAVE ("xaccFreeTransaction(): addr=%p\n", trans); } +/********************************************************************\ +\********************************************************************/ +GUID * +xaccTransGetGUID (Transaction *trans) +{ + if (!trans) return NULL; + return &trans->guid; +} + +/********************************************************************\ +\********************************************************************/ +Transaction * +xaccTransLookup (GUID *guid) +{ + if (!guid) return NULL; + return xaccLookupEntity(guid, GNC_ID_TRANS); +} + /********************************************************************\ \********************************************************************/ @@ -752,6 +814,7 @@ xaccSplitRebalance (Split *split) if (!trans) return; if (DEFER_REBALANCE & (trans->open)) return; + if (split->acc) { char *ra, *rb; if (ACC_DEFER_REBALANCE & (split->acc->open)) return; @@ -908,6 +971,7 @@ xaccTransCommitEdit (Transaction *trans) PINFO ("xaccTransCommitEdit(): delete trans at addr=%p\n", trans); /* Make a log in the journal before destruction. */ xaccTransWriteLog (trans, 'D'); + xaccRemoveEntity(&trans->guid); xaccFreeTransaction (trans); return; } @@ -987,12 +1051,16 @@ xaccTransRollbackEdit (Transaction *trans) int force_it=0, mismatch=0, i; if (!trans) return; + CHECK_OPEN (trans); + ENTER ("xaccTransRollbackEdit(): trans addr=%p\n", trans); /* copy the original values back in. */ orig = trans->orig; + xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS); + #define PUT_BACK(val) { free(trans->val); trans->val=orig->val; orig->val=0x0; } PUT_BACK (num); PUT_BACK (description); @@ -1012,7 +1080,7 @@ xaccTransRollbackEdit (Transaction *trans) * CheckDateOrder routine could be cpu-cyle brutal, so it maybe * it could use some tuning ... */ - i=0; + i=0; s = trans->splits[0]; so = orig->splits[0]; while (s && so) { @@ -1030,8 +1098,8 @@ xaccTransRollbackEdit (Transaction *trans) s->date_reconciled.tv_sec = so->date_reconciled.tv_sec; s->date_reconciled.tv_nsec = so->date_reconciled.tv_nsec; - /* do NOT check date order until all of teh other fields - * have beenproperly restored */ + /* do NOT check date order until all of the other fields + * have been properly restored */ xaccCheckDateOrder (s->acc, s); MARK_SPLIT (s); xaccAccountRecomputeBalance (s->acc); @@ -1051,12 +1119,13 @@ xaccTransRollbackEdit (Transaction *trans) xaccFreeSplit (orig->splits[i]); orig->splits[i] = s; i++; - s = trans->splits[i]; + s = trans->splits[i]; } i=mismatch; s = trans->splits[i]; while (s) { acc = s->acc; MARK_SPLIT (s); + xaccRemoveEntity(&s->guid); xaccAccountRemoveSplit (acc, s); xaccAccountRecomputeBalance (acc); xaccFreeSplit (s); @@ -1064,26 +1133,29 @@ xaccTransRollbackEdit (Transaction *trans) s = trans->splits[i]; } _free (trans->splits); - + trans->splits = orig->splits; orig->splits = NULL; - + i=mismatch; s = trans->splits[i]; while (s) { acc = s->acc; MARK_SPLIT (s); + xaccStoreEntity(s, &s->guid, GNC_ID_SPLIT); xaccAccountInsertSplit (acc, s); xaccAccountRecomputeBalance (acc); i++; - s = trans->splits[i]; + s = trans->splits[i]; } } xaccTransWriteLog (trans, 'R'); xaccFreeTransaction (trans->orig); + trans->orig = NULL; trans->open = 0; + LEAVE ("xaccTransRollbackEdit(): trans addr=%p\n", trans); } @@ -1109,11 +1181,14 @@ xaccTransDestroy (Transaction *trans) CHECK_OPEN (trans); xaccTransWriteLog (trans, 'D'); + xaccRemoveEntity(&trans->guid); + i=0; split = trans->splits[i]; while (split) { MARK_SPLIT (split); acc = split ->acc; + xaccRemoveEntity(&split->guid); xaccAccountRemoveSplit (acc, split); xaccAccountRecomputeBalance (acc); xaccFreeSplit (split); @@ -1143,6 +1218,8 @@ xaccSplitDestroy (Split *split) assert (trans->splits); CHECK_OPEN (trans); + xaccRemoveEntity(&split->guid); + numsplits = 0; s = trans->splits[0]; while (s) { @@ -1159,7 +1236,7 @@ xaccSplitDestroy (Split *split) * Or if the account has only two splits, * then this destroy will leave only one split. * Don't rebalance, as this will goof up the - * value of teh remaining split. + * value of the remaining split. */ MARK_SPLIT (split); xaccTransRemoveSplit (trans, split); @@ -1248,7 +1325,7 @@ xaccTransRemoveSplit (Transaction *trans, Split *split) * returns a positive value if transaction a is dated later than b, * * This function tries very hard to uniquely order all transactions. - * If two transactions occur on the same date, then thier "num" fields + * If two transactions occur on the same date, then their "num" fields * are compared. If the num fields are identical, then the description * fields are compared. If these are identical, then the memo fields * are compared. Hopefully, there will not be any transactions that @@ -1484,32 +1561,32 @@ xaccTransMatch (Transaction **tap, Transaction **tbp) * have to be in identical order to match. So we have to cycle through them, * without creating bogus matches. */ - na=0; while ((sa=ta->splits[na])) { sa->tickee = -1; na++; } - nb=0; while ((sb=tb->splits[nb])) { sb->tickee = -1; nb++; } + na=0; while ((sa=ta->splits[na])) { sa->ticket = -1; na++; } + nb=0; while ((sb=tb->splits[nb])) { sb->ticket = -1; nb++; } na=0; while ((sa=ta->splits[na])) { - if (-1 < sa->tickee) {na++; continue;} + if (-1 < sa->ticket) {na++; continue;} nb=0; while ((sb=tb->splits[nb])) { - if (-1 < sb->tickee) {nb++; continue;} + if (-1 < sb->ticket) {nb++; continue;} retval = xaccSplitMatch (&sa, &sb); if ((0 == retval) && (sa->acc == sb->acc)) { - sb->tickee = na; - sa->tickee = nb; + sb->ticket = na; + sa->ticket = nb; break; } nb++; } - if (-1 == sa->tickee) return -1; + if (-1 == sa->ticket) return -1; na++; } nb=0; while ((sb=tb->splits[nb])) { - if (-1 == sb->tickee) return +1; + if (-1 == sb->ticket) return +1; nb++; } @@ -1550,13 +1627,12 @@ xaccTransSetDateSecs (Transaction *trans, time_t secs) trans->date_posted.tv_nsec = 0; /* Because the date has changed, we need to make sure that each of the - * splits is properly ordered in each of thier accounts. We could do that + * splits is properly ordered in each of their accounts. We could do that * here, simply by reinserting each split into its account. However, in * some ways this is bad behaviour, and it seems much better/nicer to defer * that until the commit phase, i.e. until the user has called the * xaccTransCommitEdit() routine. So, for now, we are done. */ - } void @@ -1670,7 +1746,6 @@ xaccTransSetDateToday (Transaction *trans) PINFO ("xaccTransSetDateToday(): addr=%p set date to %lu %s \n", trans, tv.tv_sec, ctime ((time_t *)&tv.tv_sec)); - } @@ -1989,7 +2064,8 @@ xaccGetAccountByName (Transaction *trans, const char * name) if (!trans) return NULL; if (!name) return NULL; - /* walk through the splits, looking for one, any one, that has a parent account */ + /* walk through the splits, looking for one, any one, that has a + * parent account */ i = 0; s = trans->splits[0]; while (s) { @@ -2019,7 +2095,8 @@ xaccGetAccountByFullName (Transaction *trans, const char * name, if (!trans) return NULL; if (!name) return NULL; - /* walk through the splits, looking for one, any one, that has a parent account */ + /* walk through the splits, looking for one, any one, that has a + * parent account */ i = 0; s = trans->splits[0]; while (s) { diff --git a/src/engine/Transaction.h b/src/engine/Transaction.h index 5380027a49..6a7b4a905a 100644 --- a/src/engine/Transaction.h +++ b/src/engine/Transaction.h @@ -14,23 +14,25 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #ifndef __XACC_TRANSACTION_H__ #define __XACC_TRANSACTION_H__ #include "config.h" -#include "gnc-common.h" #include +#include "gnc-common.h" +#include "GNCId.h" + + /* Values for the reconciled field in Transaction: */ #define CREC 'c' /* The transaction has been cleared */ #define YREC 'y' /* The transaction has been reconciled */ @@ -146,6 +148,17 @@ void xaccTransRollbackEdit (Transaction *); gncBoolean xaccTransIsOpen (Transaction *trans); +/* + * The xaccTransGetGUID() subroutine will return the + * globally unique id associated with that transaction. + * + * The xaccTransLookup() subroutine will return the + * transaction associated with the given id, or NULL + * if there is no such transaction. + */ +GUID * xaccTransGetGUID (Transaction *trans); +Transaction * xaccTransLookup (GUID *guid); + /* Convert a day, month, and year to a Timespec */ Timespec gnc_dmy2timespec(int day, int month, int year); @@ -298,6 +311,17 @@ double xaccTransGetImbalance (Transaction * trans); Split * xaccMallocSplit (void); void xaccInitSplit (Split *); /* clears a split struct */ +/* + * The xaccSplitGetGUID() subroutine will return the + * globally unique id associated with that split. + * + * The xaccSplitLookup() subroutine will return the + * split associated with the given id, or NULL + * if there is no such split. + */ +GUID * xaccSplitGetGUID (Split *split); +Split * xaccSplitLookup (GUID *guid); + /* The memo is an arbitrary string associated with a split. * Users typically type in free form text from the GUI. */ @@ -314,7 +338,7 @@ void xaccSplitSetAction (Split *, const char *); void xaccSplitSetDocref (Split *, const char *); /* The Reconcile is a single byte, whose values are typically - * are "no", "cleared" and "reconciled" + * are "N", "C" and "R" */ void xaccSplitSetReconcile (Split *, char); void xaccSplitSetDateReconciledSecs (Split *, time_t); diff --git a/src/engine/TransactionP.h b/src/engine/TransactionP.h index 0d75279d14..5b3fe41f07 100644 --- a/src/engine/TransactionP.h +++ b/src/engine/TransactionP.h @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ /* @@ -49,12 +48,14 @@ #include "config.h" #include "Transaction.h" /* for typedefs */ +#include "GNCId.h" + /** STRUCTS *********************************************************/ /* * Double-entry is forced by having at least two splits in every * transaction. By convention, (and only by convention, not by - * any inate requirement), the first split is considered to be + * any innate requirement), the first split is considered to be * the source split or the crediting split, and the others are * the destination, or debiting splits. The grand total of all * of the splits must always be kept zero. @@ -117,8 +118,10 @@ struct _split double share_reconciled_balance; double cost_basis; - /* no tickee no washee */ - int tickee; + + GUID guid; /* globally unique id */ + + int ticket; /* used for matching up splits for QIFIO.c */ }; @@ -129,7 +132,7 @@ struct _transaction /* The num field is a arbitrary user-assigned field. * It is intended to store a short id number, typically the check number, - * deposit number, invoice number or other tracking number + * deposit number, invoice number or other tracking number. */ char * num; @@ -149,10 +152,10 @@ struct _transaction Split **splits; /* list of splits, null terminated */ /* marker is used to track the progress of transaction traversals. - * 0 is never a legitimate marker value, so we can tell is we hit a - * new transaction in the middle of a traversal. All each new - * traversal cares about is whether or not the marker stored in a - * transaction is the same as or different than the one + * 0 is never a legitimate marker value, so we can tell is we hit + * a new transaction in the middle of a traversal. All each new + * traversal cares about is whether or not the marker stored in + * a transaction is the same as or different than the one * corresponding to the current traversal. */ unsigned char marker; @@ -160,6 +163,11 @@ struct _transaction * opened for editing. */ char open; + /* guid is a globally unique identifier which can be used to + * reference the transaction. + */ + GUID guid; + /* the orig pointer points at a copy of the original transaction, * before editing was started. This orig copy is used to rollback * any changes made if/when the edit is abandoned. @@ -206,7 +214,7 @@ void xaccTransRemoveSplit (Transaction*, Split *); * (the share price of the source split is not changed). * If the indicated split is the source split, then the value * of the very first destination split is adjusted so that - * the blanace is zero. If there is not destination split, + * the balance is zero. If there is not destination split, * one of two outcomes are possible, depending on whether * "forced_double_entry" is enabled or disabled. * (1) if forced-double-entry is disabled, the fact that diff --git a/src/engine/guid/guid.c b/src/engine/guid/guid.c new file mode 100644 index 0000000000..3f788df008 --- /dev/null +++ b/src/engine/guid/guid.c @@ -0,0 +1,434 @@ +/********************************************************************\ + * guid.c -- globally unique ID implementation * + * Copyright (C) 2000 Dave Peticolas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "guid.h" +#include "md5.h" + +# ifndef P_tmpdir +# define P_tmpdir "/tmp" +# endif + + +/** Constants *******************************************************/ +#define GUID_TRUE (0 == 0) +#define GUID_FALSE (! GUID_TRUE) +#define BLOCKSIZE 4096 +#define THRESHOLD (2 * BLOCKSIZE) + + +/** Static global variables *****************************************/ +static int guid_initialized = GUID_FALSE; +static struct md5_ctx guid_context; + + +/** Function implementations ****************************************/ + +/* This code is based on code in md5.c in GNU textutils. */ +static size_t +init_from_stream(FILE *stream, size_t max_size) +{ + char buffer[BLOCKSIZE + 72]; + size_t sum, block_size, total; + + if (max_size <= 0) + return 0; + + total = 0; + + /* Iterate over file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + * computation function processes the whole buffer so that with the + * next round of the loop another block can be read. */ + size_t n; + sum = 0; + + if (max_size < BLOCKSIZE) + block_size = max_size; + else + block_size = BLOCKSIZE; + + /* Read block. Take care for partial reads. */ + do + { + n = fread (buffer + sum, 1, block_size - sum, stream); + + sum += n; + } + while (sum < block_size && n != 0); + + max_size -= sum; + + if (n == 0 && ferror (stream)) + return total; + + /* If end of file or max_size is reached, end the loop. */ + if ((n == 0) || (max_size == 0)) + break; + + /* Process buffer with BLOCKSIZE bytes. Note that + * BLOCKSIZE % 64 == 0 */ + md5_process_block (buffer, BLOCKSIZE, &guid_context); + + total += sum; + } + + /* Add the last bytes if necessary. */ + if (sum > 0) + { + md5_process_bytes (buffer, sum, &guid_context); + total += sum; + } + + return total; +} + +static size_t +init_from_file(const char *filename, size_t max_size) +{ + struct stat stats; + size_t total = 0; + FILE *fp; + + if (stat(filename, &stats) == 0) + { + md5_process_bytes(&stats, sizeof(stats), &guid_context); + total += sizeof(stats); + } + + if (max_size <= 0) + return total; + + fp = fopen (filename, "r"); + if (fp == NULL) + return total; + + total += init_from_stream(fp, max_size); + + fclose(fp); + + return total; +} + +static size_t +init_from_dir(const char *dirname, unsigned int max_files) +{ + char filename[1024]; + struct dirent *de; + struct stat stats; + size_t total; + int result; + DIR *dir; + + if (max_files <= 0) + return 0; + + dir = opendir (dirname); + if (dir == NULL) + return 0; + + total = 0; + + do + { + de = readdir(dir); + if (de == NULL) + break; + + md5_process_bytes(de, sizeof(struct dirent), &guid_context); + total += sizeof(struct dirent); + + result = snprintf(filename, sizeof(filename), + "%s/%s", dirname, de->d_name); + if ((result < 0) || (result >= sizeof(filename))) + continue; + + if (stat(filename, &stats) != 0) + continue; + md5_process_bytes(&stats, sizeof(stats), &guid_context); + total += sizeof(stats); + + max_files--; + } while (max_files > 0); + + closedir(dir); + + return total; +} + +static size_t +init_from_time() +{ + size_t total; + time_t t_time; + clock_t clocks; + struct tms tms_buf; + + total = 0; + + t_time = time(NULL); + md5_process_bytes(&t_time, sizeof(t_time), &guid_context); + total += sizeof(t_time); + + clocks = times(&tms_buf); + md5_process_bytes(&clocks, sizeof(clocks), &guid_context); + md5_process_bytes(&tms_buf, sizeof(tms_buf), &guid_context); + total += sizeof(clocks) + sizeof(tms_buf); + + return total; +} + +void +guid_init() +{ + size_t bytes = 0; + + md5_init_ctx(&guid_context); + + /* files */ + { + const char * files[] = + { "/dev/urandom", + "/etc/passwd", + "/proc/loadavg", + "/proc/meminfo", + "/proc/net/dev", + "/proc/rtc", + "/proc/self/environ", + "/proc/self/stat", + "/proc/stat", + "/proc/uptime", + "/dev/urandom", /* once more for good measure :) */ + NULL + }; + int i; + + for (i = 0; files[i] != NULL; i++) + bytes += init_from_file(files[i], BLOCKSIZE); + } + + /* directories */ + { + const char * dirname; + const char * dirs[] = + { + "/proc", + P_tmpdir, + "/var/lock", + "/var/log", + "/var/mail", + "/var/spool/mail", + "/var/run", + NULL + }; + int i; + + for (i = 0; dirs[i] != NULL; i++) + bytes += init_from_dir(dirs[i], 32); + + dirname = getenv("HOME"); + if (dirname != NULL) + bytes += init_from_dir(dirname, 32); + } + + /* process and parent ids */ + { + pid_t pid; + + pid = getpid(); + md5_process_bytes(&pid, sizeof(pid), &guid_context); + bytes += sizeof(pid); + + pid = getppid(); + md5_process_bytes(&pid, sizeof(pid), &guid_context); + bytes += sizeof(pid); + } + + /* user info */ + { + uid_t uid; + gid_t gid; + char *s; + + s = getlogin(); + md5_process_bytes(s, strlen(s), &guid_context); + bytes += strlen(s); + + uid = getuid(); + md5_process_bytes(&uid, sizeof(uid), &guid_context); + bytes += sizeof(uid); + + gid = getgid(); + md5_process_bytes(&gid, sizeof(gid), &guid_context); + bytes += sizeof(gid); + } + + /* plain old random */ + { + int n, i; + + srand((unsigned int) time(NULL)); + + for (i = 0; i < 32; i++) + { + n = rand(); + + md5_process_bytes(&n, sizeof(n), &guid_context); + bytes += sizeof(n); + } + } + + /* time in secs and clock ticks */ + bytes += init_from_time(); + + fprintf(stderr, "guid_init got %u bytes.\n", bytes); + if (bytes < THRESHOLD) + fprintf(stderr, + "WARNING: guid_init only got %u bytes.\n" + "The identifiers might not be very random.\n", bytes); + + guid_initialized = GUID_TRUE; +} + +void +guid_init_with_salt(const void *salt, size_t salt_len) +{ + guid_init(); + + md5_process_bytes(salt, salt_len, &guid_context); +} + +void +guid_init_only_salt(const void *salt, size_t salt_len) +{ + md5_init_ctx(&guid_context); + + md5_process_bytes(salt, salt_len, &guid_context); + + guid_initialized = GUID_TRUE; +} + +void +guid_new(GUID *guid) +{ + struct md5_ctx ctx; + + if (guid == NULL) + return; + + if (!guid_initialized) + guid_init(); + + /* make the id */ + ctx = guid_context; + md5_finish_ctx(&ctx, guid->data); + + /* update the global context */ + init_from_time(); +} + +/* needs 32 bytes exactly, doesn't print a null char */ +static void +encode_md5_data(const unsigned char *data, char *buffer) +{ + size_t count; + + for (count = 0; count < 16; count++, buffer += 2) + sprintf(buffer, "%02x", data[count]); +} + +/* returns true if the first 32 bytes of buffer encode + * a hex number. returns false otherwise. Decoded number + * is packed into data in little endian order. */ +static int +decode_md5_string(const char *string, unsigned char *data) +{ + unsigned char n1, n2; + size_t count; + char c1, c2; + + if (string == NULL) + return GUID_FALSE; + + for (count = 0; count < 16; count++) + { + c1 = tolower(string[2 * count]); + if (!isxdigit(c1)) + return GUID_FALSE; + + c2 = tolower(string[2 * count + 1]); + if (!isxdigit(c2)) + return GUID_FALSE; + + if (isdigit(c1)) + n1 = c1 - '0'; + else + n1 = c1 - 'a' + 10; + + if (isdigit(c2)) + n2 = c2 - '0'; + else + n2 = c2 - 'a' + 10; + + if (data != NULL) + data[count] = (n1 << 4) | n2; + } + + return GUID_TRUE; +} + +const char * +guid_to_string(const GUID * guid) +{ + static char string[33]; + + encode_md5_data(guid->data, string); + + string[32] = '\0'; + + return string; +} + +int +string_to_guid(const char * string, GUID * guid) +{ + return decode_md5_string(string, (guid != NULL) ? guid->data : NULL); +} diff --git a/src/engine/guid/guid.h b/src/engine/guid/guid.h new file mode 100644 index 0000000000..fa5df17cc3 --- /dev/null +++ b/src/engine/guid/guid.h @@ -0,0 +1,82 @@ +/********************************************************************\ + * guid.h -- globally unique ID User API * + * Copyright (C) 2000 Dave Peticolas * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#ifndef __GUID__ +#define __GUID__ 1 + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* This file defines an API for using globally unique identifiers. */ + +/* The type used to store guids */ +typedef struct _GUID +{ + unsigned char data[16]; +} GUID; + + +/* Three functions to initialize the id generator. Only one needs to + * be called. Calling any initialization function a second time will + * reset the generator and erase the effect of the first call. + * + * guid_init() will initialize the generator with a variety of random + * sources. + * + * guid_init_with_salt() will initialize the generator with guid_init() + * and with the data given in the salt argument. This argument can be + * used to add additional randomness to the generated ids. + * + * guid_init_only_salt() will initialize the generator with the data + * given in the salt argument, but not with any other source. Calling + * guid_init_only_salt() with a specific argument will produce a + * specific sequence of ids reliably. */ +void guid_init(); +void guid_init_with_salt(const void *salt, size_t salt_len); +void guid_init_only_salt(const void *salt, size_t salt_len); + + +/* Generate a new id. If no initialization function has been called, + * guid_init() will be called before the id is created. */ +void guid_new(GUID *guid); + + +/* Return a null-terminated string encoding of the id. String + * encodings of identifiers are hex numbers printed only with the + * characters '0' through '9' and 'a' through 'f'. The encoding will + * always be 32 characters long. The returned string should not be + * modified. A subsequent call to guid_to_string() will overwrite + * the result of a previous call. */ +const char * guid_to_string(const GUID * guid); + + +/* Given a string, decode the id into the guid if guid is non-NULL. + * The function returns true if the string was a valid 32 character + * hexadecimal number. This function accepts both upper and lower case + * hex digits. If the return value if false, the effect on guid is + * undefined. */ +int string_to_guid(const char * string, GUID * guid); + + +#endif diff --git a/src/engine/guid/md5.c b/src/engine/guid/md5.c new file mode 100644 index 0000000000..d742c54f66 --- /dev/null +++ b/src/engine/guid/md5.c @@ -0,0 +1,419 @@ +/* md5.c - Functions to compute MD5 message digest of files or memory blocks + according to the definition of MD5 in RFC 1321 from April 1992. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + 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, 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. */ + +/* Written by Ulrich Drepper , 1995. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if STDC_HEADERS || defined _LIBC +# include +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#include "md5.h" + +#ifdef _LIBC +# include +# if __BYTE_ORDER == __BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +#ifdef WORDS_BIGENDIAN +# define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) +#else +# define SWAP(n) (n) +#endif + + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (RFC 1321, 3.1: Step 1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; + + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +void +md5_init_ctx (ctx) + struct md5_ctx *ctx; +{ + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +} + +/* Put result from CTX in first 16 bytes following RESBUF. The result + must be in little endian byte order. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +void * +md5_read_ctx (ctx, resbuf) + const struct md5_ctx *ctx; + void *resbuf; +{ + ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); + ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); + ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); + ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); + + return resbuf; +} + +/* Process the remaining bytes in the internal buffer and the usual + prolog according to the standard and write the result to RESBUF. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +void * +md5_finish_ctx (ctx, resbuf) + struct md5_ctx *ctx; + void *resbuf; +{ + /* Take yet unprocessed bytes into account. */ + md5_uint32 bytes = ctx->buflen; + size_t pad; + + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if (ctx->total[0] < bytes) + ++ctx->total[1]; + + pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; + memcpy (&ctx->buffer[bytes], fillbuf, pad); + + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); + *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); + + /* Process last bytes. */ + md5_process_block (ctx->buffer, bytes + pad + 8, ctx); + + return md5_read_ctx (ctx, resbuf); +} + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +int +md5_stream (stream, resblock) + FILE *stream; + void *resblock; +{ + /* Important: BLOCKSIZE must be a multiple of 64. */ +#define BLOCKSIZE 4096 + struct md5_ctx ctx; + char buffer[BLOCKSIZE + 72]; + size_t sum; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + /* Iterate over full file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + computation function processes the whole buffer so that with the + next round of the loop another block can be read. */ + size_t n; + sum = 0; + + /* Read block. Take care for partial reads. */ + do + { + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); + + sum += n; + } + while (sum < BLOCKSIZE && n != 0); + if (n == 0 && ferror (stream)) + return 1; + + /* If end of file is reached, end the loop. */ + if (n == 0) + break; + + /* Process buffer with BLOCKSIZE bytes. Note that + BLOCKSIZE % 64 == 0 + */ + md5_process_block (buffer, BLOCKSIZE, &ctx); + } + + /* Add the last bytes if necessary. */ + if (sum > 0) + md5_process_bytes (buffer, sum, &ctx); + + /* Construct result in desired memory. */ + md5_finish_ctx (&ctx, resblock); + return 0; +} + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +void * +md5_buffer (buffer, len, resblock) + const char *buffer; + size_t len; + void *resblock; +{ + struct md5_ctx ctx; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + /* Process whole buffer but last len % 64 bytes. */ + md5_process_bytes (buffer, len, &ctx); + + /* Put result in desired memory area. */ + return md5_finish_ctx (&ctx, resblock); +} + + +void +md5_process_bytes (buffer, len, ctx) + const void *buffer; + size_t len; + struct md5_ctx *ctx; +{ + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) + { + size_t left_over = ctx->buflen; + size_t add = 128 - left_over > len ? len : 128 - left_over; + + memcpy (&ctx->buffer[left_over], buffer, add); + ctx->buflen += add; + + if (left_over + add > 64) + { + md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); + /* The regions in the following copy operation cannot overlap. */ + memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], + (left_over + add) & 63); + ctx->buflen = (left_over + add) & 63; + } + + buffer = (const char *) buffer + add; + len -= add; + } + + /* Process available complete blocks. */ + if (len > 64) + { + md5_process_block (buffer, len & ~63, ctx); + buffer = (const char *) buffer + (len & ~63); + len &= 63; + } + + /* Move remaining bytes in internal buffer. */ + if (len > 0) + { + memcpy (ctx->buffer, buffer, len); + ctx->buflen = len; + } +} + + +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ + +void +md5_process_block (buffer, len, ctx) + const void *buffer; + size_t len; + struct md5_ctx *ctx; +{ + md5_uint32 correct_words[16]; + const md5_uint32 *words = buffer; + size_t nwords = len / sizeof (md5_uint32); + const md5_uint32 *endp = words + nwords; + md5_uint32 A = ctx->A; + md5_uint32 B = ctx->B; + md5_uint32 C = ctx->C; + md5_uint32 D = ctx->D; + + /* First increment the byte count. RFC 1321 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if (ctx->total[0] < len) + ++ctx->total[1]; + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (words < endp) + { + md5_uint32 *cwp = correct_words; + md5_uint32 A_save = A; + md5_uint32 B_save = B; + md5_uint32 C_save = C; + md5_uint32 D_save = D; + + /* First round: using the given function, the context and a constant + the next context is computed. Because the algorithms processing + unit is a 32-bit word and it is determined to work on words in + little endian byte order we perhaps have to change the byte order + before the computation. To reduce the work for the next steps + we store the swapped words in the array CORRECT_WORDS. */ + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) + + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + + /* Add the starting values of the context. */ + A += A_save; + B += B_save; + C += C_save; + D += D_save; + } + + /* Put checksum in context given as argument. */ + ctx->A = A; + ctx->B = B; + ctx->C = C; + ctx->D = D; +} diff --git a/src/engine/guid/md5.h b/src/engine/guid/md5.h new file mode 100644 index 0000000000..b7645ec503 --- /dev/null +++ b/src/engine/guid/md5.h @@ -0,0 +1,146 @@ +/* md5.h - Declaration of functions and data types used for MD5 sum + computing library functions. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + 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, 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. */ + +#ifndef _MD5_H +#define _MD5_H 1 + +#include + +#if defined HAVE_LIMITS_H || _LIBC +# include +#endif + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + doing that would require that the configure script compile and *run* + the resulting executable. Locally running cross-compiled executables + is usually not possible. */ + +#ifdef _LIBC +# include +typedef u_int32_t md5_uint32; +#else +# if defined __STDC__ && __STDC__ +# define UINT_MAX_32_BITS 4294967295U +# else +# define UINT_MAX_32_BITS 0xFFFFFFFF +# endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +# ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +# endif + +# if UINT_MAX == UINT_MAX_32_BITS + typedef unsigned int md5_uint32; +# else +# if USHRT_MAX == UINT_MAX_32_BITS + typedef unsigned short md5_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS + typedef unsigned long md5_uint32; +# else + /* The following line is intended to evoke an error. + Using #error is not portable enough. */ + "Cannot determine unsigned 32-bit data type." +# endif +# endif +# endif +#endif + +#undef __P +#if defined (__STDC__) && __STDC__ +#define __P(x) x +#else +#define __P(x) () +#endif + +/* Structure to save state of computation between the single steps. */ +struct md5_ctx +{ + md5_uint32 A; + md5_uint32 B; + md5_uint32 C; + md5_uint32 D; + + md5_uint32 total[2]; + md5_uint32 buflen; + char buffer[128]; +}; + +/* + * The following three functions are build up the low level used in + * the functions `md5_stream' and `md5_buffer'. + */ + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +extern void md5_init_ctx __P ((struct md5_ctx *ctx)); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is necessary that LEN is a multiple of 64!!! */ +extern void md5_process_block __P ((const void *buffer, size_t len, + struct md5_ctx *ctx)); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is NOT required that LEN is a multiple of 64. */ +extern void md5_process_bytes __P ((const void *buffer, size_t len, + struct md5_ctx *ctx)); + +/* Process the remaining bytes in the buffer and put result from CTX + in first 16 bytes following RESBUF. The result is always in little + endian byte order, so that a byte-wise output yields to the wanted + ASCII representation of the message digest. + + IMPORTANT: On some systems it is required that RESBUF be correctly + aligned for a 32 bits value. */ +extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); + + +/* Put result from CTX in first 16 bytes following RESBUF. The result is + always in little endian byte order, so that a byte-wise output yields + to the wanted ASCII representation of the message digest. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); + + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +extern int md5_stream __P ((FILE *stream, void *resblock)); + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); + +#endif diff --git a/src/gnome/Makefile.in b/src/gnome/Makefile.in index cc6976bc53..7f13d07516 100644 --- a/src/gnome/Makefile.in +++ b/src/gnome/Makefile.in @@ -14,13 +14,11 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Robin Clark -# Internet: rclark@rush.aero.org -# Address: 609 8th Street -# Huntington Beach, CA 92648-4632 +# along with this program; if not, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org include @top_srcdir@/Makefile.init @@ -28,6 +26,7 @@ INCLPATH := -I.. \ -I../.. \ -I../guile \ -I../engine \ + -I../engine/guid \ -I../register \ -I../reports \ -I@srcdir@/../../include \ @@ -53,6 +52,7 @@ endif # text to work on... OTHER_OBJS += $(wildcard @top_srcdir@/src/obj/gnome/*.o) OTHER_OBJS += $(wildcard @top_srcdir@/src/engine/obj/*.o) +OTHER_OBJS += $(wildcard @top_srcdir@/src/engine/obj/guid/*.o) OTHER_OBJS += $(wildcard @top_srcdir@/src/register/obj/gnome/*.o) OTHER_OBJS += $(wildcard @top_srcdir@/src/reports/obj/*.o) OTHER_OBJS += $(wildcard @top_srcdir@/src/guile/obj/*.o) diff --git a/src/gnome/window-adjust.c b/src/gnome/window-adjust.c index accc7e48d9..882e5849a5 100644 --- a/src/gnome/window-adjust.c +++ b/src/gnome/window-adjust.c @@ -14,13 +14,12 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * \********************************************************************/ #include "top-level.h" @@ -142,7 +141,7 @@ gnc_ui_AdjBWindow_ok_cb(GtkWidget * widget, gpointer data) xaccAccountCommitEdit(adjBData->account); xaccTransCommitEdit(trans); - + gnc_account_ui_refresh(adjBData->account); gnc_refresh_main_window(); diff --git a/src/register/Makefile.in b/src/register/Makefile.in index 72fae7ee95..7cb2964fb9 100644 --- a/src/register/Makefile.in +++ b/src/register/Makefile.in @@ -27,6 +27,7 @@ INCLPATH = -I@top_srcdir@/ \ -I@top_srcdir@/src \ -I@top_srcdir@/include \ -I@top_srcdir@/src/engine \ + -I@top_srcdir@/src/engine/guid \ -I@top_srcdir@/lib/ComboBox-1.33 \ -I@top_srcdir@/lib/Xbae-4.6.2-linas \ -I@prefix@/include \ diff --git a/src/register/gnome/Makefile.in b/src/register/gnome/Makefile.in index 17864deccd..a7be74f5c5 100644 --- a/src/register/gnome/Makefile.in +++ b/src/register/gnome/Makefile.in @@ -13,13 +13,11 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Robin Clark -# Internet: rclark@rush.aero.org -# Address: 609 8th Street -# Huntington Beach, CA 92648-4632 +# along with this program; if not, contact: +# +# Free Software Foundation Voice: +1-617-542-5942 +# 59 Temple Place - Suite 330 Fax: +1-617-542-2652 +# Boston, MA 02111-1307, USA gnu@gnu.org include @top_srcdir@/Makefile.init @@ -27,6 +25,7 @@ INCLPATH = -I@top_srcdir@/ \ -I@top_srcdir@/src \ -I@top_srcdir@/include \ -I@top_srcdir@/src/engine \ + -I@top_srcdir@/src/engine/guid \ -I@top_srcdir@/src/gnome \ -I@prefix@/include \ -I@top_srcdir@/src/register diff --git a/src/swig/Makefile.in b/src/swig/Makefile.in index a7eb46825b..c6007648f3 100644 --- a/src/swig/Makefile.in +++ b/src/swig/Makefile.in @@ -47,7 +47,3 @@ perl5: ${OBJS} ../engine/libengine.a @cd perl5 && $(MAKE) default .PHONY: motif - -# Local Variables: -# tab-width: 2 -# End: diff --git a/src/swig/perl5/Makefile.in b/src/swig/perl5/Makefile.in index 0524c2ab65..5450678a73 100644 --- a/src/swig/perl5/Makefile.in +++ b/src/swig/perl5/Makefile.in @@ -27,6 +27,7 @@ INCLPATH = \ -I@top_srcdir@/src \ -I@top_srcdir@/src/swig\ -I@top_srcdir@/src/engine \ + -I@top_srcdir@/src/engine/guid \ -I@top_srcdir@/include \ -I@PERLINCL@/CORE \ -I$(prefix)/include @@ -102,7 +103,3 @@ TRASH += gnucash.pm gnucash.so # ${SWIG} ${SWIG_FLAGS} -o $@ $< # ${PERL} -pi -e 's/^void gnucash\(\)/void gnucash_swig_init\(\)/' $@ # TRASH += gnucash-all-guile_wrap.c - -# Local Variables: -# tab-width: 2 -# End: