James LewisMoss's patch with some xml and testing stuff.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3712 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-02-27 20:15:11 +00:00
parent 1f0b3f280c
commit 5494d6ad07
11 changed files with 104 additions and 28 deletions

View File

@@ -71,6 +71,7 @@ Kevin Finn <kevinfinn@mediaone.net> auto-decimal point patch, options patch
Ron Forrester <rjf@aracnet.com> for gnome patches Ron Forrester <rjf@aracnet.com> for gnome patches
Dave Freese <DFreese@osc.uscg.mil> for leap-year fix Dave Freese <DFreese@osc.uscg.mil> for leap-year fix
John Goerzen <jgoerzen@complete.org> file i/o fix for 64-bit architectures John Goerzen <jgoerzen@complete.org> file i/o fix for 64-bit architectures
Hans de Graaff <hans@degraaff.org> xml patches
Bill Gribble <grib@billgribble.com> qif importation code Bill Gribble <grib@billgribble.com> qif importation code
Mitsuo Hamada <mhamada@redhat.com> Japanese translations Mitsuo Hamada <mhamada@redhat.com> Japanese translations
Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version

View File

@@ -1,3 +1,28 @@
2001-02-27 James LewisMoss <jimdres@mindspring.com>
* src/test/test-xml-account.c (node_and_account_equal): Start
proper comparison between node and Account.
* src/engine/sixtp-dom-parsers.c (dom_tree_to_guid): Merge in Hans
de Graaff's xml patch. Use safe_strcmp.
* src/engine/gnc-xml-helper.h: cleanup. Merge in Hans de Graaff's
xml patch.
* src/engine/gnc-account-xml-v2.c: Merge in Hans de Graaff's xml
patch.
* src/test/test-stuff.c (check_dom_tree_version): Add func.
* src/test/Makefile.am (LDADD): Add EFENCE_LIBS to LDADD list.
* src/Makefile.am: Add EFENCE_LIBS to LDADD list.
* acconfig.h: Add required USE_EFENCE def.
* configure.in: Add --enable-profiling argument.
(GHTTP_CFLAGS): Add --enable-efence argument.
2001-02-27 Dave Peticolas <dave@krondo.com> 2001-02-27 Dave Peticolas <dave@krondo.com>
* src/gnome/dialog-userpass.c: add a dialog for username/password * src/gnome/dialog-userpass.c: add a dialog for username/password

View File

@@ -62,6 +62,9 @@
/* Should we add guppi support? */ /* Should we add guppi support? */
#undef USE_GUPPI #undef USE_GUPPI
/* Should we have efence linked in */
#undef USE_EFENCE
/* Use the new gtkhtml widget instead of the old xmhtml widget */ /* Use the new gtkhtml widget instead of the old xmhtml widget */
#undef HAVE_LIBGTKHTML #undef HAVE_LIBGTKHTML

View File

@@ -351,6 +351,18 @@ if test $USE_GUPPI = 0; then
else else
AC_DEFINE(USE_GUPPI) AC_DEFINE(USE_GUPPI)
AC_ARG_ENABLE( efence,
[ --enable-efence link using efence],
if test $enableval = yes; then
EFENCE_LIBS="-lefence"
USE_EFENCE=1
fi,
USE_EFENCE=0
EFENCE_LIBS="")
AC_DEFINE(USE_EFENCE)
AC_SUBST(EFENCE_LIBS)
## Things guppi needs (actually are these guppi dependencies or gtkhtml's?) ## Things guppi needs (actually are these guppi dependencies or gtkhtml's?)
# LAME: if you ask gnome-config for the zvt libs, it doesn't include # LAME: if you ask gnome-config for the zvt libs, it doesn't include

6
debian/rules vendored
View File

@@ -22,7 +22,11 @@ Makefile: Makefile.in configure
./autogen.sh --prefix=/usr \ ./autogen.sh --prefix=/usr \
--sysconfdir=/etc \ --sysconfdir=/etc \
--infodir=/usr/share/info \ --infodir=/usr/share/info \
--mandir=/usr/share/man --mandir=/usr/share/man \
--enable-efence \
--enable-error-on-warnings
# --enable-profile \
build: build-stamp build: build-stamp
build-stamp: Makefile build-stamp: Makefile

View File

@@ -501,6 +501,7 @@ provide an accurate Profit & Loss statement.
<PARA>for leap-year fix</PARA> <PARA>for leap-year fix</PARA>
</GLOSSDEF> </GLOSSDEF>
</GLOSSENTRY> </GLOSSENTRY>
<GLOSSENTRY> <GLOSSENTRY>
<GLOSSTERM><email>jgoerzen@complete.org</email> John <GLOSSTERM><email>jgoerzen@complete.org</email> John
Goerzen</GLOSSTERM> Goerzen</GLOSSTERM>
@@ -509,6 +510,14 @@ provide an accurate Profit & Loss statement.
</GLOSSDEF> </GLOSSDEF>
</GLOSSENTRY> </GLOSSENTRY>
<GLOSSENTRY>
<GLOSSTERM><email>hans@degraaff.org</email> Hans de Graaff
</GLOSSTERM>
<GLOSSDEF>
<PARA>xml patches</PARA>
</GLOSSDEF>
</GLOSSENTRY>
<GLOSSENTRY> <GLOSSENTRY>
<GLOSSTERM><email>grib@billgribble.com</email> Bill <GLOSSTERM><email>grib@billgribble.com</email> Bill
Gribble</GLOSSTERM> Gribble</GLOSSTERM>

View File

@@ -38,7 +38,8 @@ LDADD = \
${GHTTP_LIBS} \ ${GHTTP_LIBS} \
${GUPPI_LIBS} \ ${GUPPI_LIBS} \
${DB_LIBS} \ ${DB_LIBS} \
${INTLLIBS} ${INTLLIBS} \
${EFENCE_LIBS}
gnucash_SOURCES = \ gnucash_SOURCES = \
MultiLedger.c \ MultiLedger.c \

View File

@@ -99,7 +99,7 @@ account_type_handler (xmlNodePtr node, Account* act)
{ {
int type; int type;
xaccAccountStringToType(node->childs->content, &type); xaccAccountStringToType(node->xmlChildrenNode->content, &type);
xaccAccountSetType(act, type); xaccAccountSetType(act, type);
return TRUE; return TRUE;
} }

View File

@@ -13,8 +13,8 @@
#include "sixtp-dom-generators.h" #include "sixtp-dom-generators.h"
#include "gnc-xml.h" #include "gnc-xml.h"
#include "gnc-engine-util.h" #include "gnc-engine-util.h"
#include "sixtp-dom-parsers.h" #include "sixtp-dom-parsers.h"
#include "AccountP.h" #include "AccountP.h"
#include "Account.h" #include "Account.h"
@@ -71,18 +71,29 @@ struct com_char_handler com_handlers[] = {
{ 0, 0 } { 0, 0 }
}; };
static gboolean
string_to_integer(const char *content, gint64 *to)
{
if(sscanf(content, "%lld", to) == 1)
{
return TRUE;
}
else
{
return FALSE;
}
}
static void static void
set_commodity_value(xmlNodePtr node, gnc_commodity* com) set_commodity_value(xmlNodePtr node, gnc_commodity* com)
{ {
if(safe_strcmp(node->name, "cmdty:fraction")) if(safe_strcmp(node->name, "cmdty:fraction"))
{ {
/*
gint64 val; gint64 val;
if(string_to_integer(node, &val)) if(string_to_integer(node->xmlChildrenNode->content, &val))
{ {
gnc_commodity_set_fraction(com, val); gnc_commodity_set_fraction(com, val);
} }
*/
} }
else else
{ {

View File

@@ -9,26 +9,36 @@
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000 #if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
#include <libxml/tree.h> # include <libxml/tree.h>
#include <libxml/parser.h> # include <libxml/parser.h>
#include <libxml/xmlmemory.h> # include <libxml/xmlmemory.h>
#include <libxml/parserInternals.h> # include <libxml/parserInternals.h>
#ifndef xmlChildrenNode # ifndef xmlChildrenNode
#define xmlChildrenNode children # define xmlChildrenNode children
#define xmlRootNode children # endif /* ifndef xmlChildrenNode */
#endif # ifndef xmlRootNode
# define xmlRootNode children
# endif /* ifndef xmlRootNode */
# ifndef xmlAttrPropertyValue
# define xmlAttrPropertyValue children
# endif /* ifndef xmlAttrPropertyValue */
#else #else /* defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000 */
#include <gnome-xml/tree.h> # include <gnome-xml/tree.h>
#include <gnome-xml/parser.h> # include <gnome-xml/parser.h>
#include <gnome-xml/xmlmemory.h> # include <gnome-xml/xmlmemory.h>
#include <gnome-xml/parserInternals.h> # include <gnome-xml/parserInternals.h>
#ifndef xmlChildrenNode # ifndef xmlChildrenNode
#define xmlChildrenNode childs # define xmlChildrenNode childs
#define xmlRootNode root # endif /* ifndef xmlChildrenNode */
#endif # ifndef xmlRootNode
# define xmlRootNode root
# endif /* ifndef xmlRootNode */
# ifndef xmlAttrPropertyValue
# define xmlAttrPropertyValue val
# endif /* ifndef xmlAttrPropertyValue */
#endif #endif /* defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000 */
#endif /* _GNC_XML_HELPER_H_ */ #endif /* _GNC_XML_HELPER_H_ */

View File

@@ -30,14 +30,14 @@ dom_tree_to_guid(xmlNodePtr node)
} }
{ {
char *type = node->properties->val->content; char *type = node->properties->xmlAttrPropertyValue->content;
if(strcmp("guid", type) == 0) if(safe_strcmp("guid", type) == 0)
{ {
GUID *gid = g_new(GUID, 1); GUID *gid = g_new(GUID, 1);
string_to_guid(node->xmlChildrenNode->content, gid); string_to_guid(node->xmlChildrenNode->content, gid);
return gid; return gid;
} }
else if(strcmp("new", type) == 0) else if(safe_strcmp("new", type) == 0)
{ {
/* FIXME: handle this case */ /* FIXME: handle this case */
return NULL; return NULL;