mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
James LewisMoss's xml refactoring patch.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3625 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
a016811048
commit
fed1fcd1fe
@ -79,6 +79,7 @@ noinst_HEADERS = \
|
||||
gnc-event.h \
|
||||
gnc-event-p.h \
|
||||
gnc-numeric.h \
|
||||
gnc-xml-helper.h \
|
||||
sixtp-parsers.h \
|
||||
sixtp-writers.h \
|
||||
sixtp-stack.h \
|
||||
|
34
src/engine/gnc-xml-helper.h
Normal file
34
src/engine/gnc-xml-helper.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef _GNC_XML_HELPER_H_
|
||||
#define _GNC_XML_HELPER_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _GNC_XML_HELPER_H_ */
|
@ -13,34 +13,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "Account.h"
|
||||
#include "Query.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
@ -49,34 +49,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "Account.h"
|
||||
#include "date.h"
|
||||
#include "DateUtils.h"
|
||||
|
@ -66,14 +66,6 @@ static gboolean dom_chars_handler(
|
||||
|
||||
}
|
||||
|
||||
static gboolean dom_before_handler(
|
||||
gpointer data_for_children, GSList* data_from_children,
|
||||
GSList* sibling_data, gpointer parent_data, gpointer global_data,
|
||||
gpointer *result, const gchar *tag, const gchar *child_tag)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
sixtp* sixtp_dom_parser_new(sixtp_end_handler ender)
|
||||
{
|
||||
sixtp *top_level;
|
||||
@ -83,7 +75,6 @@ sixtp* sixtp_dom_parser_new(sixtp_end_handler ender)
|
||||
if(!(top_level =
|
||||
sixtp_set_any(sixtp_new(), FALSE,
|
||||
SIXTP_START_HANDLER_ID, dom_start_handler,
|
||||
SIXTP_BEFORE_CHILD_HANDLER_ID, dom_before_handler,
|
||||
SIXTP_CHARACTERS_HANDLER_ID, dom_chars_handler,
|
||||
SIXTP_END_HANDLER_ID, ender,
|
||||
SIXTP_NO_MORE_HANDLERS)))
|
||||
|
@ -6,34 +6,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "Query.h"
|
||||
|
||||
gboolean xml_add_account_restorers(xmlNodePtr p, AccountGroup *g);
|
||||
|
@ -8,34 +8,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp-xml-write-utils.h"
|
||||
|
||||
#include "gnc-numeric.h"
|
||||
|
@ -6,34 +6,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-numeric.h"
|
||||
#include "GNCId.h"
|
||||
#include "date.h"
|
||||
|
@ -8,33 +8,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef HAVE_XML_VERSION_HEADER
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode children
|
||||
#define xmlRootNode children
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <gnome-xml/tree.h>
|
||||
#include <gnome-xml/parser.h>
|
||||
#include <gnome-xml/xmlmemory.h>
|
||||
#include <gnome-xml/parserInternals.h>
|
||||
#ifndef xmlChildrenNode
|
||||
#define xmlChildrenNode childs
|
||||
#define xmlRootNode root
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
typedef struct _sixtp_child_result sixtp_child_result;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user