mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Convert XML Backend to compile as C++.
This commit is contained in:
@@ -62,40 +62,40 @@ src/backend/sql/gnc-slots-sql.cpp
|
||||
src/backend/sql/gnc-tax-table-sql.cpp
|
||||
src/backend/sql/gnc-transaction-sql.cpp
|
||||
src/backend/sql/gnc-vendor-sql.cpp
|
||||
src/backend/xml/gnc-account-xml-v2.c
|
||||
src/backend/xml/gnc-address-xml-v2.c
|
||||
src/backend/xml/gnc-backend-xml.c
|
||||
src/backend/xml/gnc-bill-term-xml-v2.c
|
||||
src/backend/xml/gnc-book-xml-v2.c
|
||||
src/backend/xml/gnc-budget-xml-v2.c
|
||||
src/backend/xml/gnc-commodity-xml-v2.c
|
||||
src/backend/xml/gnc-customer-xml-v2.c
|
||||
src/backend/xml/gnc-employee-xml-v2.c
|
||||
src/backend/xml/gnc-entry-xml-v2.c
|
||||
src/backend/xml/gnc-freqspec-xml-v2.c
|
||||
src/backend/xml/gnc-invoice-xml-v2.c
|
||||
src/backend/xml/gnc-job-xml-v2.c
|
||||
src/backend/xml/gnc-lot-xml-v2.c
|
||||
src/backend/xml/gnc-order-xml-v2.c
|
||||
src/backend/xml/gnc-owner-xml-v2.c
|
||||
src/backend/xml/gnc-pricedb-xml-v2.c
|
||||
src/backend/xml/gnc-recurrence-xml-v2.c
|
||||
src/backend/xml/gnc-schedxaction-xml-v2.c
|
||||
src/backend/xml/gnc-tax-table-xml-v2.c
|
||||
src/backend/xml/gnc-transaction-xml-v2.c
|
||||
src/backend/xml/gnc-vendor-xml-v2.c
|
||||
src/backend/xml/gnc-xml-helper.c
|
||||
src/backend/xml/io-example-account.c
|
||||
src/backend/xml/io-gncxml-gen.c
|
||||
src/backend/xml/gnc-account-xml-v2.cpp
|
||||
src/backend/xml/gnc-address-xml-v2.cpp
|
||||
src/backend/xml/gnc-backend-xml.cpp
|
||||
src/backend/xml/gnc-bill-term-xml-v2.cpp
|
||||
src/backend/xml/gnc-book-xml-v2.cpp
|
||||
src/backend/xml/gnc-budget-xml-v2.cpp
|
||||
src/backend/xml/gnc-commodity-xml-v2.cpp
|
||||
src/backend/xml/gnc-customer-xml-v2.cpp
|
||||
src/backend/xml/gnc-employee-xml-v2.cpp
|
||||
src/backend/xml/gnc-entry-xml-v2.cpp
|
||||
src/backend/xml/gnc-freqspec-xml-v2.cpp
|
||||
src/backend/xml/gnc-invoice-xml-v2.cpp
|
||||
src/backend/xml/gnc-job-xml-v2.cpp
|
||||
src/backend/xml/gnc-lot-xml-v2.cpp
|
||||
src/backend/xml/gnc-order-xml-v2.cpp
|
||||
src/backend/xml/gnc-owner-xml-v2.cpp
|
||||
src/backend/xml/gnc-pricedb-xml-v2.cpp
|
||||
src/backend/xml/gnc-recurrence-xml-v2.cpp
|
||||
src/backend/xml/gnc-schedxaction-xml-v2.cpp
|
||||
src/backend/xml/gnc-tax-table-xml-v2.cpp
|
||||
src/backend/xml/gnc-transaction-xml-v2.cpp
|
||||
src/backend/xml/gnc-vendor-xml-v2.cpp
|
||||
src/backend/xml/gnc-xml-helper.cpp
|
||||
src/backend/xml/io-example-account.cpp
|
||||
src/backend/xml/io-gncxml-gen.cpp
|
||||
src/backend/xml/io-gncxml-v1.cpp
|
||||
src/backend/xml/io-gncxml-v2.c
|
||||
src/backend/xml/io-utils.c
|
||||
src/backend/xml/sixtp.c
|
||||
src/backend/xml/io-gncxml-v2.cpp
|
||||
src/backend/xml/io-utils.cpp
|
||||
src/backend/xml/sixtp.cpp
|
||||
src/backend/xml/sixtp-dom-generators.cpp
|
||||
src/backend/xml/sixtp-dom-parsers.cpp
|
||||
src/backend/xml/sixtp-stack.c
|
||||
src/backend/xml/sixtp-to-dom-parser.c
|
||||
src/backend/xml/sixtp-utils.c
|
||||
src/backend/xml/sixtp-stack.cpp
|
||||
src/backend/xml/sixtp-to-dom-parser.cpp
|
||||
src/backend/xml/sixtp-utils.cpp
|
||||
src/bin/gnucash-bin.c
|
||||
src/business/business-gnome/business-gnome.scm
|
||||
src/business/business-gnome/business-gnome-utils.c
|
||||
|
||||
@@ -19,42 +19,42 @@ AM_CPPFLAGS = \
|
||||
${BOOST_CPPFLAGS}
|
||||
|
||||
libgnc_backend_xml_utils_la_SOURCES = \
|
||||
gnc-account-xml-v2.c \
|
||||
gnc-address-xml-v2.c \
|
||||
gnc-bill-term-xml-v2.c \
|
||||
gnc-book-xml-v2.c \
|
||||
gnc-budget-xml-v2.c \
|
||||
gnc-commodity-xml-v2.c \
|
||||
gnc-customer-xml-v2.c \
|
||||
gnc-employee-xml-v2.c \
|
||||
gnc-entry-xml-v2.c \
|
||||
gnc-freqspec-xml-v2.c \
|
||||
gnc-invoice-xml-v2.c \
|
||||
gnc-job-xml-v2.c \
|
||||
gnc-lot-xml-v2.c \
|
||||
gnc-order-xml-v2.c \
|
||||
gnc-owner-xml-v2.c \
|
||||
gnc-pricedb-xml-v2.c \
|
||||
gnc-recurrence-xml-v2.c \
|
||||
gnc-schedxaction-xml-v2.c \
|
||||
gnc-tax-table-xml-v2.c \
|
||||
gnc-transaction-xml-v2.c \
|
||||
gnc-vendor-xml-v2.c \
|
||||
gnc-xml-helper.c \
|
||||
io-example-account.c \
|
||||
io-gncxml-gen.c \
|
||||
gnc-account-xml-v2.cpp \
|
||||
gnc-address-xml-v2.cpp \
|
||||
gnc-bill-term-xml-v2.cpp \
|
||||
gnc-book-xml-v2.cpp \
|
||||
gnc-budget-xml-v2.cpp \
|
||||
gnc-commodity-xml-v2.cpp \
|
||||
gnc-customer-xml-v2.cpp \
|
||||
gnc-employee-xml-v2.cpp \
|
||||
gnc-entry-xml-v2.cpp \
|
||||
gnc-freqspec-xml-v2.cpp \
|
||||
gnc-invoice-xml-v2.cpp \
|
||||
gnc-job-xml-v2.cpp \
|
||||
gnc-lot-xml-v2.cpp \
|
||||
gnc-order-xml-v2.cpp \
|
||||
gnc-owner-xml-v2.cpp \
|
||||
gnc-pricedb-xml-v2.cpp \
|
||||
gnc-recurrence-xml-v2.cpp \
|
||||
gnc-schedxaction-xml-v2.cpp \
|
||||
gnc-tax-table-xml-v2.cpp \
|
||||
gnc-transaction-xml-v2.cpp \
|
||||
gnc-vendor-xml-v2.cpp \
|
||||
gnc-xml-helper.cpp \
|
||||
io-example-account.cpp \
|
||||
io-gncxml-gen.cpp \
|
||||
io-gncxml-v1.cpp \
|
||||
io-gncxml-v2.c \
|
||||
io-utils.c \
|
||||
io-gncxml-v2.cpp \
|
||||
io-utils.cpp \
|
||||
sixtp-dom-generators.cpp \
|
||||
sixtp-dom-parsers.cpp \
|
||||
sixtp-stack.c \
|
||||
sixtp-to-dom-parser.c \
|
||||
sixtp-utils.c \
|
||||
sixtp.c
|
||||
sixtp-stack.cpp \
|
||||
sixtp-to-dom-parser.cpp \
|
||||
sixtp-utils.cpp \
|
||||
sixtp.cpp
|
||||
|
||||
libgncmod_backend_xml_la_SOURCES = \
|
||||
gnc-backend-xml.c
|
||||
gnc-backend-xml.cpp
|
||||
|
||||
noinst_HEADERS = \
|
||||
gnc-backend-xml.h \
|
||||
|
||||
@@ -22,12 +22,16 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <AccountP.h>
|
||||
#include <Account.h>
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
@@ -42,8 +46,6 @@
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "AccountP.h"
|
||||
#include "Account.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -154,7 +156,7 @@ gnc_account_dom_tree_create(Account *act,
|
||||
|
||||
for (n = lots; n; n = n->next)
|
||||
{
|
||||
GNCLot * lot = n->data;
|
||||
GNCLot * lot = static_cast<decltype(lot)>(n->data);
|
||||
xmlAddChild(toaddto, gnc_lot_dom_tree_create(lot));
|
||||
}
|
||||
}
|
||||
@@ -189,7 +191,7 @@ set_string(xmlNodePtr node, Account* act,
|
||||
static gboolean
|
||||
account_name_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
|
||||
return set_string(node, pdata->account, xaccAccountSetName);
|
||||
}
|
||||
@@ -197,7 +199,7 @@ account_name_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_id_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
GncGUID *guid;
|
||||
|
||||
guid = dom_tree_to_guid(node);
|
||||
@@ -213,7 +215,7 @@ account_id_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_type_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
GNCAccountType type = ACCT_TYPE_INVALID;
|
||||
char *string;
|
||||
|
||||
@@ -229,7 +231,7 @@ account_type_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_commodity_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gnc_commodity *ref;
|
||||
|
||||
// ref = dom_tree_to_commodity_ref_no_engine(node, pdata->book);
|
||||
@@ -242,7 +244,7 @@ account_commodity_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_commodity_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer(node, &val);
|
||||
@@ -254,7 +256,7 @@ account_commodity_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_hidden_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gboolean val;
|
||||
|
||||
dom_tree_to_boolean(node, &val);
|
||||
@@ -266,7 +268,7 @@ account_hidden_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_placeholder_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gboolean val;
|
||||
|
||||
dom_tree_to_boolean(node, &val);
|
||||
@@ -278,7 +280,7 @@ account_placeholder_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_non_standard_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
|
||||
xaccAccountSetNonStdSCU(pdata->account, TRUE);
|
||||
|
||||
@@ -292,7 +294,7 @@ account_non_standard_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
deprecated_account_currency_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gnc_commodity *ref;
|
||||
|
||||
PWARN("Account %s: Obsolete xml tag 'act:currency' will not be preserved.",
|
||||
@@ -306,7 +308,7 @@ deprecated_account_currency_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
deprecated_account_currency_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
PWARN("Account %s: Obsolete xml tag 'act:currency-scu' will not be preserved.",
|
||||
xaccAccountGetName( pdata->account ));
|
||||
return TRUE;
|
||||
@@ -315,7 +317,7 @@ deprecated_account_currency_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
deprecated_account_security_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gnc_commodity *ref, *orig = xaccAccountGetCommodity(pdata->account);
|
||||
|
||||
PWARN("Account %s: Obsolete xml tag 'act:security' will not be preserved.",
|
||||
@@ -340,7 +342,7 @@ deprecated_account_security_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
deprecated_account_security_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
gint64 val;
|
||||
|
||||
PWARN("Account %s: Obsolete xml tag 'act:security-scu' will not be preserved.",
|
||||
@@ -359,14 +361,14 @@ deprecated_account_security_scu_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_slots_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE (pdata->account));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
account_parent_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
Account *parent;
|
||||
GncGUID *gid;
|
||||
|
||||
@@ -390,7 +392,7 @@ account_parent_handler (xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_code_handler(xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
|
||||
return set_string(node, pdata->account, xaccAccountSetCode);
|
||||
}
|
||||
@@ -398,7 +400,7 @@ account_code_handler(xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_description_handler(xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
|
||||
return set_string(node, pdata->account, xaccAccountSetDescription);
|
||||
}
|
||||
@@ -406,7 +408,7 @@ account_description_handler(xmlNodePtr node, gpointer act_pdata)
|
||||
static gboolean
|
||||
account_lots_handler(xmlNodePtr node, gpointer act_pdata)
|
||||
{
|
||||
struct account_pdata *pdata = act_pdata;
|
||||
struct account_pdata *pdata = static_cast<decltype(pdata)>(act_pdata);
|
||||
xmlNodePtr mark;
|
||||
|
||||
g_return_val_if_fail(node, FALSE);
|
||||
@@ -468,7 +470,7 @@ gnc_account_end_handler(gpointer data_for_children,
|
||||
Account *acc, *parent, *root;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
int type;
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
}
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
@@ -114,7 +115,7 @@ set_string(xmlNodePtr node, GncAddress* addr,
|
||||
static gboolean
|
||||
address_name_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetName);
|
||||
}
|
||||
@@ -122,7 +123,7 @@ address_name_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_addr1_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetAddr1);
|
||||
}
|
||||
@@ -130,7 +131,7 @@ address_addr1_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_addr2_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetAddr2);
|
||||
}
|
||||
@@ -138,7 +139,7 @@ address_addr2_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_addr3_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetAddr3);
|
||||
}
|
||||
@@ -146,7 +147,7 @@ address_addr3_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_addr4_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetAddr4);
|
||||
}
|
||||
@@ -154,7 +155,7 @@ address_addr4_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_phone_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetPhone);
|
||||
}
|
||||
@@ -162,7 +163,7 @@ address_phone_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_fax_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetFax);
|
||||
}
|
||||
@@ -170,7 +171,7 @@ address_fax_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_email_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
|
||||
return set_string(node, pdata->address, gncAddressSetEmail);
|
||||
}
|
||||
@@ -178,7 +179,7 @@ address_email_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
static gboolean
|
||||
address_slots_handler (xmlNodePtr node, gpointer addr_pdata)
|
||||
{
|
||||
struct address_pdata *pdata = addr_pdata;
|
||||
struct address_pdata *pdata = static_cast<decltype(pdata)>(addr_pdata);
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE (pdata->address));
|
||||
}
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
|
||||
#ifndef GNC_ADDRESS_XML_V2_H
|
||||
#define GNC_ADDRESS_XML_V2_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "gncAddress.h"
|
||||
|
||||
}
|
||||
gboolean gnc_dom_tree_to_address (xmlNodePtr node, GncAddress *address);
|
||||
xmlNodePtr gnc_address_to_dom_tree (const char *tag, GncAddress *addr);
|
||||
void gnc_address_xml_initialize (void);
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
* This file implements the top-level QofBackend API for saving/
|
||||
* restoring data to/from an ordinary Unix filesystem file.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
@@ -76,10 +77,16 @@ typedef int ssize_t;
|
||||
#include "gnc-engine.h"
|
||||
|
||||
#include "gnc-uri-utils.h"
|
||||
|
||||
#include "io-gncxml.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "gnc-backend-xml.h"
|
||||
|
||||
#ifndef HAVE_STRPTIME
|
||||
# include "strptime.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "io-gncxml.h"
|
||||
#include "gnc-prefs.h"
|
||||
|
||||
#include "gnc-address-xml-v2.h"
|
||||
@@ -94,10 +101,6 @@ typedef int ssize_t;
|
||||
#include "gnc-tax-table-xml-v2.h"
|
||||
#include "gnc-vendor-xml-v2.h"
|
||||
|
||||
#ifndef HAVE_STRPTIME
|
||||
# include "strptime.h"
|
||||
#endif
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_BACKEND;
|
||||
|
||||
static gboolean save_may_clobber_data (QofBackend *bend);
|
||||
@@ -30,12 +30,15 @@
|
||||
|
||||
#ifndef GNC_BACKEND_XML_H_
|
||||
#define GNC_BACKEND_XML_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include "qof.h"
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "qofbackend-p.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XML_RETAIN_NONE,
|
||||
@@ -83,5 +86,7 @@ void gnc_module_init_backend_xml(void);
|
||||
G_MODULE_EXPORT
|
||||
void qof_backend_module_init(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* GNC_BACKEND_XML_H_ */
|
||||
|
||||
@@ -21,13 +21,19 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncInvoice.h"
|
||||
#include "qof.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
@@ -40,11 +46,7 @@
|
||||
#include "gnc-xml.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncInvoice.h"
|
||||
#include "gnc-bill-term-xml-v2.h"
|
||||
#include "qof.h"
|
||||
|
||||
#include "xml-helpers.h"
|
||||
|
||||
@@ -167,21 +169,21 @@ set_numeric (xmlNodePtr node, GncBillTerm *term,
|
||||
static gboolean
|
||||
days_duedays_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_int (node, pdata->term, gncBillTermSetDueDays);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
days_discdays_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_int (node, pdata->term, gncBillTermSetDiscountDays);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
days_discount_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_numeric (node, pdata->term, gncBillTermSetDiscount);
|
||||
}
|
||||
|
||||
@@ -211,28 +213,28 @@ dom_tree_to_days_data (xmlNodePtr node, struct billterm_pdata *pdata)
|
||||
static gboolean
|
||||
prox_dueday_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_int (node, pdata->term, gncBillTermSetDueDays);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
prox_discday_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_int (node, pdata->term, gncBillTermSetDiscountDays);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
prox_discount_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_numeric (node, pdata->term, gncBillTermSetDiscount);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
prox_cutoff_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_int (node, pdata->term, gncBillTermSetCutoff);
|
||||
}
|
||||
|
||||
@@ -298,7 +300,7 @@ set_string (xmlNodePtr node, GncBillTerm *term,
|
||||
static gboolean
|
||||
billterm_guid_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
GncGUID *guid;
|
||||
GncBillTerm *term;
|
||||
|
||||
@@ -324,21 +326,21 @@ billterm_guid_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
static gboolean
|
||||
billterm_name_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_string (node, pdata->term, gncBillTermSetName);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
billterm_desc_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_string (node, pdata->term, gncBillTermSetDescription);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
billterm_refcount_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer(node, &val);
|
||||
@@ -349,7 +351,7 @@ billterm_refcount_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
static gboolean
|
||||
billterm_invisible_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer(node, &val);
|
||||
@@ -361,21 +363,21 @@ billterm_invisible_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
static gboolean
|
||||
billterm_parent_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_parent_child (node, pdata, gncBillTermSetParent);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
billterm_child_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return set_parent_child (node, pdata, gncBillTermSetChild);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
billterm_days_data_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
|
||||
g_return_val_if_fail (node, FALSE);
|
||||
g_return_val_if_fail (gncBillTermGetType (pdata->term) == 0, FALSE);
|
||||
@@ -387,7 +389,7 @@ billterm_days_data_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
static gboolean
|
||||
billterm_prox_data_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
|
||||
g_return_val_if_fail (node, FALSE);
|
||||
g_return_val_if_fail (gncBillTermGetType (pdata->term) == 0, FALSE);
|
||||
@@ -399,7 +401,7 @@ billterm_prox_data_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
static gboolean
|
||||
billterm_slots_handler (xmlNodePtr node, gpointer billterm_pdata)
|
||||
{
|
||||
struct billterm_pdata *pdata = billterm_pdata;
|
||||
struct billterm_pdata *pdata = static_cast<decltype(pdata)>(billterm_pdata);
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE(pdata->term));
|
||||
}
|
||||
|
||||
@@ -454,7 +456,7 @@ gnc_billterm_end_handler(gpointer data_for_children,
|
||||
GncBillTerm *term;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
|
||||
if (parent_data)
|
||||
@@ -491,7 +493,7 @@ billterm_sixtp_parser_create(void)
|
||||
static void
|
||||
do_count (QofInstance *term_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
(*count)++;
|
||||
}
|
||||
|
||||
@@ -508,7 +510,7 @@ xml_add_billterm (QofInstance *term_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncBillTerm *term = (GncBillTerm *) term_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -573,7 +575,7 @@ static void
|
||||
billterm_scrub_cb (QofInstance *term_p, gpointer list_p)
|
||||
{
|
||||
GncBillTerm *term = GNC_BILLTERM(term_p);
|
||||
GList **list = list_p;
|
||||
GList **list = static_cast<decltype(list)>(list_p);
|
||||
|
||||
if (billterm_is_grandchild(term))
|
||||
{
|
||||
@@ -613,7 +615,7 @@ billterm_scrub_cb (QofInstance *term_p, gpointer list_p)
|
||||
static void
|
||||
billterm_scrub_invoices (QofInstance * invoice_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncInvoice *invoice = GNC_INVOICE(invoice_p);
|
||||
GncBillTerm *term, *new_bt;
|
||||
gint32 count;
|
||||
@@ -644,7 +646,7 @@ billterm_scrub_invoices (QofInstance * invoice_p, gpointer ht_p)
|
||||
static void
|
||||
billterm_scrub_cust (QofInstance * cust_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncCustomer *cust = GNC_CUSTOMER(cust_p);
|
||||
GncBillTerm *term;
|
||||
gint32 count;
|
||||
@@ -669,7 +671,7 @@ billterm_scrub_cust (QofInstance * cust_p, gpointer ht_p)
|
||||
static void
|
||||
billterm_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncVendor *vendor = GNC_VENDOR(vendor_p);
|
||||
GncBillTerm *term;
|
||||
gint32 count;
|
||||
@@ -694,7 +696,7 @@ billterm_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
|
||||
static void
|
||||
billterm_reset_refcount (gpointer key, gpointer value, gpointer notused)
|
||||
{
|
||||
GncBillTerm *term = key;
|
||||
GncBillTerm *term = static_cast<decltype(term)>(key);
|
||||
gint32 count = GPOINTER_TO_INT(value);
|
||||
|
||||
if (count != gncBillTermGetRefcount(term) && !gncBillTermGetInvisible(term))
|
||||
@@ -725,7 +727,7 @@ billterm_scrub (QofBook *book)
|
||||
for (node = list; node; node = node->next)
|
||||
{
|
||||
gchar termstr[GUID_ENCODING_LENGTH+1];
|
||||
term = node->data;
|
||||
term = static_cast<decltype(term)>(node->data);
|
||||
|
||||
guid_to_string_buff(qof_instance_get_guid(QOF_INSTANCE(term)), termstr);
|
||||
PWARN ("deleting grandchild billterm: %s\n", termstr);
|
||||
@@ -23,8 +23,11 @@
|
||||
|
||||
#ifndef GNC_BILLTERM_XML_V2_H
|
||||
#define GNC_BILLTERM_XML_V2_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "gncBillTerm.h"
|
||||
}
|
||||
|
||||
void gnc_billterm_xml_initialize (void);
|
||||
GncBillTerm *gnc_billterm_xml_find_or_create(QofBook *book, GncGUID *guid);
|
||||
|
||||
|
||||
@@ -22,12 +22,15 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "qof.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
@@ -44,7 +47,6 @@
|
||||
#include "io-utils.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "qof.h"
|
||||
|
||||
/* non-static because it's used in io-gncxml-v2.c */
|
||||
const gchar *gnc_v2_book_version_string = "2.0.0";
|
||||
@@ -158,7 +160,7 @@ write_book_parts(FILE *out, QofBook *book)
|
||||
if (ferror(out) || fprintf(out, "\n") < 0)
|
||||
return FALSE;
|
||||
|
||||
|
||||
|
||||
slotsnode = qof_instance_slots_to_dom_tree(book_slots_string,
|
||||
QOF_INSTANCE(book));
|
||||
if (slotsnode)
|
||||
@@ -179,7 +181,7 @@ write_book_parts(FILE *out, QofBook *book)
|
||||
static gboolean
|
||||
book_id_handler(xmlNodePtr node, gpointer book_pdata)
|
||||
{
|
||||
QofBook *book = book_pdata;
|
||||
QofBook *book = static_cast<decltype(book)>(book_pdata);
|
||||
GncGUID *guid;
|
||||
|
||||
guid = dom_tree_to_guid(node);
|
||||
@@ -192,7 +194,7 @@ book_id_handler(xmlNodePtr node, gpointer book_pdata)
|
||||
static gboolean
|
||||
book_slots_handler (xmlNodePtr node, gpointer book_pdata)
|
||||
{
|
||||
QofBook *book = book_pdata;
|
||||
QofBook *book = static_cast<decltype(book)>(book_pdata);
|
||||
gboolean success;
|
||||
|
||||
/* the below works only because the get is gaurenteed to return
|
||||
@@ -220,7 +222,7 @@ gnc_book_end_handler(gpointer data_for_children,
|
||||
{
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
|
||||
if (parent_data) return TRUE;
|
||||
@@ -249,7 +251,7 @@ gnc_book_id_end_handler(gpointer data_for_children,
|
||||
gboolean successful;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data) return TRUE;
|
||||
if (!tag) return TRUE;
|
||||
@@ -271,7 +273,7 @@ gnc_book_slots_end_handler(gpointer data_for_children,
|
||||
gboolean successful;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data) return TRUE;
|
||||
if (!tag) return TRUE;
|
||||
@@ -21,12 +21,14 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
@@ -176,7 +178,7 @@ gnc_budget_end_handler(gpointer data_for_children,
|
||||
GncBudget *bgt;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -21,14 +21,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include "AccountP.h"
|
||||
#include "Account.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -39,10 +42,6 @@
|
||||
#include "gnc-xml.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "AccountP.h"
|
||||
#include "Account.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
const gchar *commodity_version_string = "2.0.0";
|
||||
@@ -123,7 +122,7 @@ gnc_commodity_dom_tree_create(const gnc_commodity *com)
|
||||
|
||||
struct com_char_handler
|
||||
{
|
||||
gchar *tag;
|
||||
const char *tag;
|
||||
void(*func)(gnc_commodity *com, const char*val);
|
||||
};
|
||||
|
||||
@@ -254,7 +253,7 @@ gnc_commodity_end_handler(gpointer data_for_children,
|
||||
xmlNodePtr achild;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -21,15 +21,23 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-customer-xml-v2.h"
|
||||
#include "gnc-address-xml-v2.h"
|
||||
#include "gnc-bill-term-xml-v2.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,13 +49,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
#include "gnc-customer-xml-v2.h"
|
||||
#include "gnc-address-xml-v2.h"
|
||||
#include "gnc-bill-term-xml-v2.h"
|
||||
|
||||
#include "xml-helpers.h"
|
||||
|
||||
#define _GNC_MOD_NAME GNC_ID_CUSTOMER
|
||||
@@ -178,7 +179,7 @@ set_boolean(xmlNodePtr node, GncCustomer* cust,
|
||||
static gboolean
|
||||
customer_name_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
|
||||
return set_string(node, pdata->customer, gncCustomerSetName);
|
||||
}
|
||||
@@ -186,7 +187,7 @@ customer_name_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_guid_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
GncGUID *guid;
|
||||
GncCustomer *cust;
|
||||
|
||||
@@ -212,7 +213,7 @@ customer_guid_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_id_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
|
||||
return set_string(node, pdata->customer, gncCustomerSetID);
|
||||
}
|
||||
@@ -220,7 +221,7 @@ customer_id_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_notes_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
|
||||
return set_string(node, pdata->customer, gncCustomerSetNotes);
|
||||
}
|
||||
@@ -228,7 +229,7 @@ customer_notes_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_terms_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
GncGUID *guid;
|
||||
GncBillTerm *term;
|
||||
|
||||
@@ -245,7 +246,7 @@ customer_terms_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_addr_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
|
||||
return gnc_dom_tree_to_address (node, gncCustomerGetAddr(pdata->customer));
|
||||
}
|
||||
@@ -253,7 +254,7 @@ customer_addr_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_shipaddr_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
|
||||
return gnc_dom_tree_to_address (node,
|
||||
gncCustomerGetShipAddr(pdata->customer));
|
||||
@@ -263,7 +264,7 @@ customer_shipaddr_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_taxincluded_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
GncTaxIncluded type;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -283,14 +284,14 @@ customer_taxincluded_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_active_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
return set_boolean (node, pdata->customer, gncCustomerSetActive);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
customer_discount_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
gnc_numeric *val;
|
||||
|
||||
val = dom_tree_to_gnc_numeric(node);
|
||||
@@ -305,7 +306,7 @@ customer_discount_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_credit_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
gnc_numeric *val;
|
||||
|
||||
val = dom_tree_to_gnc_numeric(node);
|
||||
@@ -320,7 +321,7 @@ customer_credit_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_currency_handler (xmlNodePtr node, gpointer customer_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = customer_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(customer_pdata);
|
||||
gnc_commodity *com;
|
||||
|
||||
com = dom_tree_to_commodity_ref(node, pdata->book);
|
||||
@@ -334,7 +335,7 @@ customer_currency_handler (xmlNodePtr node, gpointer customer_pdata)
|
||||
static gboolean
|
||||
customer_taxtable_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
GncGUID *guid;
|
||||
GncTaxTable *taxtable;
|
||||
|
||||
@@ -359,14 +360,14 @@ customer_taxtable_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
static gboolean
|
||||
customer_taxtableoverride_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
return set_boolean (node, pdata->customer, gncCustomerSetTaxTableOverride);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
customer_slots_handler (xmlNodePtr node, gpointer cust_pdata)
|
||||
{
|
||||
struct customer_pdata *pdata = cust_pdata;
|
||||
struct customer_pdata *pdata = static_cast<decltype(pdata)>(cust_pdata);
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE(pdata->customer));
|
||||
}
|
||||
|
||||
@@ -425,7 +426,7 @@ gnc_customer_end_handler(gpointer data_for_children,
|
||||
GncCustomer *cust;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
|
||||
if (parent_data)
|
||||
@@ -475,7 +476,7 @@ customer_should_be_saved (GncCustomer *customer)
|
||||
static void
|
||||
do_count (QofInstance * cust_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (customer_should_be_saved ((GncCustomer *)cust_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -493,7 +494,7 @@ xml_add_customer (QofInstance * cust_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncCustomer *cust = (GncCustomer *) cust_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -21,15 +21,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncEmployeeP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,7 +43,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncEmployeeP.h"
|
||||
#include "gnc-employee-xml-v2.h"
|
||||
#include "gnc-address-xml-v2.h"
|
||||
|
||||
@@ -149,7 +150,7 @@ set_string(xmlNodePtr node, GncEmployee* employee,
|
||||
static gboolean
|
||||
employee_username_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
|
||||
return set_string(node, pdata->employee, gncEmployeeSetUsername);
|
||||
}
|
||||
@@ -157,7 +158,7 @@ employee_username_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_guid_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
GncGUID *guid;
|
||||
GncEmployee *employee;
|
||||
|
||||
@@ -185,7 +186,7 @@ employee_guid_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_id_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
|
||||
return set_string(node, pdata->employee, gncEmployeeSetID);
|
||||
}
|
||||
@@ -193,7 +194,7 @@ employee_id_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_language_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
|
||||
return set_string(node, pdata->employee, gncEmployeeSetLanguage);
|
||||
}
|
||||
@@ -201,7 +202,7 @@ employee_language_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_acl_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
|
||||
return set_string(node, pdata->employee, gncEmployeeSetAcl);
|
||||
}
|
||||
@@ -209,7 +210,7 @@ employee_acl_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_addr_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
|
||||
return gnc_dom_tree_to_address (node, gncEmployeeGetAddr(pdata->employee));
|
||||
}
|
||||
@@ -217,7 +218,7 @@ employee_addr_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_active_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
gint64 val;
|
||||
gboolean ret;
|
||||
|
||||
@@ -231,7 +232,7 @@ employee_active_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_workday_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
gnc_numeric *val;
|
||||
|
||||
val = dom_tree_to_gnc_numeric(node);
|
||||
@@ -245,7 +246,7 @@ employee_workday_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_rate_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
gnc_numeric *val;
|
||||
|
||||
val = dom_tree_to_gnc_numeric(node);
|
||||
@@ -259,7 +260,7 @@ employee_rate_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_currency_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
gnc_commodity *com;
|
||||
|
||||
com = dom_tree_to_commodity_ref(node, pdata->book);
|
||||
@@ -273,7 +274,7 @@ employee_currency_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_ccard_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
GncGUID *guid;
|
||||
Account *ccard_acc;
|
||||
|
||||
@@ -292,7 +293,7 @@ employee_ccard_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
static gboolean
|
||||
employee_slots_handler (xmlNodePtr node, gpointer employee_pdata)
|
||||
{
|
||||
struct employee_pdata *pdata = employee_pdata;
|
||||
struct employee_pdata *pdata = static_cast<decltype(pdata)>(employee_pdata);
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE(pdata->employee));
|
||||
}
|
||||
|
||||
@@ -347,7 +348,7 @@ gnc_employee_end_handler(gpointer data_for_children,
|
||||
GncEmployee *employee;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
|
||||
if (parent_data)
|
||||
@@ -397,7 +398,7 @@ employee_should_be_saved (GncEmployee *employee)
|
||||
static void
|
||||
do_count (QofInstance * employee_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (employee_should_be_saved ((GncEmployee *) employee_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -415,7 +416,7 @@ xml_add_employee (QofInstance * employee_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncEmployee *employee = (GncEmployee *) employee_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -21,15 +21,21 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gncEntryP.h"
|
||||
#include "gncOrderP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -40,11 +46,6 @@
|
||||
#include "gnc-xml.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncEntryP.h"
|
||||
#include "gncOrderP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
#include "gnc-entry-xml-v2.h"
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
|
||||
@@ -321,7 +322,7 @@ set_taxtable (xmlNodePtr node, struct entry_pdata *pdata,
|
||||
static gboolean
|
||||
entry_guid_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncGUID *guid;
|
||||
GncEntry *entry;
|
||||
|
||||
@@ -347,7 +348,7 @@ entry_guid_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_date_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_timespec(node, pdata->entry, gncEntrySetDate);
|
||||
}
|
||||
@@ -355,7 +356,7 @@ entry_date_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_dateentered_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_timespec(node, pdata->entry, gncEntrySetDateEntered);
|
||||
}
|
||||
@@ -363,7 +364,7 @@ entry_dateentered_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_description_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_string(node, pdata->entry, gncEntrySetDescription);
|
||||
}
|
||||
@@ -371,7 +372,7 @@ entry_description_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_action_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_string(node, pdata->entry, gncEntrySetAction);
|
||||
}
|
||||
@@ -379,7 +380,7 @@ entry_action_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_notes_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_string(node, pdata->entry, gncEntrySetNotes);
|
||||
}
|
||||
@@ -387,7 +388,7 @@ entry_notes_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_qty_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_numeric(node, pdata->entry, gncEntrySetQuantity);
|
||||
}
|
||||
@@ -397,14 +398,14 @@ entry_qty_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_invacct_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_account (node, pdata, gncEntrySetInvAccount);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_iprice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_numeric(node, pdata->entry, gncEntrySetInvPrice);
|
||||
}
|
||||
@@ -412,7 +413,7 @@ entry_iprice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_idiscount_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_numeric(node, pdata->entry, gncEntrySetInvDiscount);
|
||||
}
|
||||
@@ -420,7 +421,7 @@ entry_idiscount_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_idisctype_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncAmountType type;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -440,7 +441,7 @@ entry_idisctype_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_idischow_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncDiscountHow how;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -460,21 +461,21 @@ entry_idischow_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_itaxable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_boolean (node, pdata->entry, gncEntrySetInvTaxable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_itaxincluded_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_boolean (node, pdata->entry, gncEntrySetInvTaxIncluded);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_itaxtable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_taxtable (node, pdata, gncEntrySetInvTaxTable);
|
||||
}
|
||||
|
||||
@@ -483,14 +484,14 @@ entry_itaxtable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_billacct_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_account (node, pdata, gncEntrySetBillAccount);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_bprice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return set_numeric(node, pdata->entry, gncEntrySetBillPrice);
|
||||
}
|
||||
@@ -498,35 +499,35 @@ entry_bprice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_btaxable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_boolean (node, pdata->entry, gncEntrySetBillTaxable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_btaxincluded_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_boolean (node, pdata->entry, gncEntrySetBillTaxIncluded);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_btaxtable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_taxtable (node, pdata, gncEntrySetBillTaxTable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_billable_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
return set_boolean (node, pdata->entry, gncEntrySetBillable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
entry_billto_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncOwner billto;
|
||||
gboolean ret;
|
||||
|
||||
@@ -541,7 +542,7 @@ entry_billto_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_billpayment_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncEntryPaymentType type;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -563,7 +564,7 @@ entry_billpayment_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_order_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncGUID *guid;
|
||||
GncOrder *order;
|
||||
|
||||
@@ -588,7 +589,7 @@ entry_order_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_invoice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncGUID *guid;
|
||||
GncInvoice *invoice;
|
||||
|
||||
@@ -613,7 +614,7 @@ entry_invoice_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_bill_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
GncGUID *guid;
|
||||
GncInvoice *invoice;
|
||||
|
||||
@@ -640,7 +641,7 @@ entry_bill_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_acct_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
/* XXX: try to figure out if this is an 'invoice' or a 'bill' --
|
||||
* we have to wait until the end!
|
||||
*/
|
||||
@@ -651,7 +652,7 @@ entry_acct_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_price_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
gboolean res;
|
||||
|
||||
/* just set both.. Don't worry about extra data if it's wrong */
|
||||
@@ -664,7 +665,7 @@ entry_price_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
static gboolean
|
||||
entry_slots_handler (xmlNodePtr node, gpointer entry_pdata)
|
||||
{
|
||||
struct entry_pdata *pdata = entry_pdata;
|
||||
struct entry_pdata *pdata = static_cast<decltype(pdata)>(entry_pdata);
|
||||
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE (pdata->entry));
|
||||
}
|
||||
@@ -761,7 +762,7 @@ gnc_entry_end_handler(gpointer data_for_children,
|
||||
GncEntry *entry;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
|
||||
if (parent_data)
|
||||
@@ -798,7 +799,7 @@ entry_sixtp_parser_create(void)
|
||||
static void
|
||||
do_count (QofInstance * entry_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
(*count)++;
|
||||
}
|
||||
|
||||
@@ -815,7 +816,7 @@ xml_add_entry (QofInstance * entry_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncEntry *entry = (GncEntry *) entry_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -22,15 +22,18 @@
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include "qof.h"
|
||||
#include "SchedXaction.h"
|
||||
#include "FreqSpec.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "qof.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -43,14 +46,12 @@
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "SchedXaction.h"
|
||||
#include "FreqSpec.h"
|
||||
|
||||
const gchar *freqspec_version_string = "1.0.0";
|
||||
|
||||
struct freqTypeTuple
|
||||
{
|
||||
char *str;
|
||||
const char *str;
|
||||
FreqType ft;
|
||||
};
|
||||
|
||||
@@ -63,12 +64,12 @@ struct freqTypeTuple freqTypeStrs[] =
|
||||
{ "monthly", MONTHLY },
|
||||
{ "month_relative", MONTH_RELATIVE },
|
||||
{ "composite", COMPOSITE },
|
||||
{ NULL, -1 },
|
||||
{ NULL, static_cast<FreqType>(-1) },
|
||||
};
|
||||
|
||||
struct uiFreqTypeTuple
|
||||
{
|
||||
char *str;
|
||||
const char *str;
|
||||
UIFreqType uift;
|
||||
};
|
||||
|
||||
@@ -86,7 +87,7 @@ struct uiFreqTypeTuple uiFreqTypeStrs[] =
|
||||
{ "tri_anually", UIFREQ_TRI_ANUALLY },
|
||||
{ "semi_yearly", UIFREQ_SEMI_YEARLY },
|
||||
{ "yearly", UIFREQ_YEARLY },
|
||||
{ NULL, -1 }
|
||||
{ NULL, static_cast<UIFreqType>(-1) }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -135,17 +136,16 @@ static
|
||||
gboolean
|
||||
fs_uift_handler( xmlNodePtr node, gpointer data)
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
int i;
|
||||
char *nodeTxt;
|
||||
char *tmp;
|
||||
|
||||
nodeTxt = dom_tree_to_text( node );
|
||||
|
||||
g_return_val_if_fail( nodeTxt, FALSE );
|
||||
for ( i = 0; (tmp = uiFreqTypeStrs[i].str) != NULL; i++ )
|
||||
for ( i = 0; uiFreqTypeStrs[i].str != NULL; i++ )
|
||||
{
|
||||
if ( g_strcmp0( nodeTxt, tmp ) == 0 )
|
||||
if ( g_strcmp0( nodeTxt, uiFreqTypeStrs[i].str ) == 0 )
|
||||
{
|
||||
fspd->uift = uiFreqTypeStrs[i].uift;
|
||||
g_free( nodeTxt );
|
||||
@@ -160,7 +160,7 @@ static
|
||||
gboolean
|
||||
fs_date_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
GDate *foo;
|
||||
foo = dom_tree_to_gdate( node );
|
||||
if ( foo == NULL )
|
||||
@@ -174,7 +174,7 @@ static
|
||||
gboolean
|
||||
fs_interval_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
|
||||
@@ -191,7 +191,7 @@ static
|
||||
gboolean
|
||||
fs_offset_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
|
||||
@@ -206,7 +206,7 @@ static
|
||||
gboolean
|
||||
fs_day_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
|
||||
@@ -221,7 +221,7 @@ static
|
||||
gboolean
|
||||
fs_weekday_handler( xmlNodePtr node, gpointer data)
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
ret = dom_tree_to_integer( node, &foo );
|
||||
@@ -235,7 +235,7 @@ static
|
||||
gboolean
|
||||
fs_occurrence_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
ret = dom_tree_to_integer( node, &foo );
|
||||
@@ -249,7 +249,7 @@ static
|
||||
gboolean
|
||||
fs_weekend_adj_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean ret;
|
||||
gint64 foo;
|
||||
ret = dom_tree_to_integer( node, &foo );
|
||||
@@ -263,7 +263,7 @@ static
|
||||
gboolean
|
||||
fs_subelement_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
GList *recurrences;
|
||||
|
||||
recurrences = dom_tree_freqSpec_to_recurrences(node, fspd->book);
|
||||
@@ -304,7 +304,7 @@ struct dom_tree_handler fs_union_dom_handlers[] =
|
||||
static gboolean
|
||||
fs_none_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean successful;
|
||||
successful = dom_tree_generic_parse( node,
|
||||
fs_union_dom_handlers,
|
||||
@@ -316,7 +316,7 @@ static
|
||||
gboolean
|
||||
fs_once_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean successful;
|
||||
|
||||
successful = dom_tree_generic_parse( node,
|
||||
@@ -332,7 +332,7 @@ fs_once_handler( xmlNodePtr node, gpointer data )
|
||||
static gboolean
|
||||
fs_daily_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
GDate offset_date;
|
||||
gboolean successful;
|
||||
successful = dom_tree_generic_parse(node, fs_union_dom_handlers, fspd );
|
||||
@@ -350,7 +350,7 @@ static
|
||||
gboolean
|
||||
fs_weekly_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
GDate offset_date;
|
||||
gboolean successful;
|
||||
successful = dom_tree_generic_parse( node,
|
||||
@@ -370,7 +370,7 @@ static
|
||||
gboolean
|
||||
fs_monthly_handler( xmlNodePtr node, gpointer data)
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
GDate offset_date;
|
||||
gboolean successful;
|
||||
successful = dom_tree_generic_parse( node,
|
||||
@@ -391,7 +391,9 @@ fs_monthly_handler( xmlNodePtr node, gpointer data)
|
||||
}
|
||||
else
|
||||
{
|
||||
recurrenceSet(fspd->recurrence, fspd->interval, PERIOD_MONTH, &offset_date, fspd->weekend_adj);
|
||||
recurrenceSet(fspd->recurrence, fspd->interval,
|
||||
PERIOD_MONTH, &offset_date,
|
||||
static_cast<WeekendAdjust>(fspd->weekend_adj));
|
||||
}
|
||||
|
||||
return successful;
|
||||
@@ -416,7 +418,7 @@ static
|
||||
gboolean
|
||||
fs_composite_handler( xmlNodePtr node, gpointer data)
|
||||
{
|
||||
fsParseData *fspd = data;
|
||||
fsParseData *fspd = static_cast<decltype(fspd)>(data);
|
||||
gboolean successful;
|
||||
successful = dom_tree_generic_parse( node,
|
||||
fs_union_dom_handlers,
|
||||
@@ -21,32 +21,33 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
#include "gnc-invoice-xml-v2.h"
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
#include "gnc-bill-term-xml-v2.h"
|
||||
|
||||
#include "gnc-xml.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
#include "gnc-invoice-xml-v2.h"
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
#include "gnc-bill-term-xml-v2.h"
|
||||
|
||||
#define _GNC_MOD_NAME GNC_ID_INVOICE
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
@@ -197,7 +198,7 @@ set_timespec(xmlNodePtr node, GncInvoice* invoice,
|
||||
static gboolean
|
||||
invoice_guid_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncGUID *guid;
|
||||
GncInvoice *invoice;
|
||||
|
||||
@@ -223,7 +224,7 @@ invoice_guid_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_id_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
|
||||
return set_string(node, pdata->invoice, gncInvoiceSetID);
|
||||
}
|
||||
@@ -231,7 +232,7 @@ invoice_id_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_owner_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncOwner owner;
|
||||
gboolean ret;
|
||||
|
||||
@@ -245,7 +246,7 @@ invoice_owner_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_opened_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
|
||||
return set_timespec (node, pdata->invoice, gncInvoiceSetDateOpened);
|
||||
}
|
||||
@@ -253,7 +254,7 @@ invoice_opened_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_posted_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
|
||||
return set_timespec (node, pdata->invoice, gncInvoiceSetDatePosted);
|
||||
}
|
||||
@@ -261,7 +262,7 @@ invoice_posted_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_billing_id_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
|
||||
return set_string(node, pdata->invoice, gncInvoiceSetBillingID);
|
||||
}
|
||||
@@ -269,7 +270,7 @@ invoice_billing_id_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_notes_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
|
||||
return set_string(node, pdata->invoice, gncInvoiceSetNotes);
|
||||
}
|
||||
@@ -277,7 +278,7 @@ invoice_notes_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_active_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
gint64 val;
|
||||
gboolean ret;
|
||||
|
||||
@@ -291,7 +292,7 @@ invoice_active_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_terms_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncGUID *guid;
|
||||
GncBillTerm *term;
|
||||
|
||||
@@ -308,7 +309,7 @@ invoice_terms_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_posttxn_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncGUID *guid;
|
||||
Transaction *txn;
|
||||
|
||||
@@ -325,7 +326,7 @@ invoice_posttxn_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_postlot_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncGUID *guid;
|
||||
GNCLot *lot;
|
||||
|
||||
@@ -342,7 +343,7 @@ invoice_postlot_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_postacc_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncGUID *guid;
|
||||
Account *acc;
|
||||
|
||||
@@ -359,7 +360,7 @@ invoice_postacc_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_currency_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
gnc_commodity *com;
|
||||
|
||||
com = dom_tree_to_commodity_ref(node, pdata->book);
|
||||
@@ -373,7 +374,7 @@ invoice_currency_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_billto_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
GncOwner owner;
|
||||
gboolean ret;
|
||||
|
||||
@@ -387,7 +388,7 @@ invoice_billto_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_tochargeamt_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
gnc_numeric* num = dom_tree_to_gnc_numeric(node);
|
||||
g_return_val_if_fail(num, FALSE);
|
||||
|
||||
@@ -399,7 +400,7 @@ invoice_tochargeamt_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
static gboolean
|
||||
invoice_slots_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
struct invoice_pdata *pdata = static_cast<decltype(pdata)>(invoice_pdata);
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE (pdata->invoice));
|
||||
}
|
||||
|
||||
@@ -459,7 +460,7 @@ gnc_invoice_end_handler(gpointer data_for_children,
|
||||
GncInvoice *invoice;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -508,7 +509,7 @@ invoice_should_be_saved (GncInvoice *invoice)
|
||||
static void
|
||||
do_count (QofInstance * invoice_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (invoice_should_be_saved ((GncInvoice *)invoice_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -526,7 +527,7 @@ xml_add_invoice (QofInstance * invoice_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncInvoice *invoice = (GncInvoice *) invoice_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -21,15 +21,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncJobP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,7 +43,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncJobP.h"
|
||||
#include "gnc-job-xml-v2.h"
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
#include "xml-helpers.h"
|
||||
@@ -119,7 +120,7 @@ set_string(xmlNodePtr node, GncJob* job,
|
||||
static gboolean
|
||||
job_name_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
|
||||
return set_string(node, pdata->job, gncJobSetName);
|
||||
}
|
||||
@@ -127,7 +128,7 @@ job_name_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_guid_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
GncGUID *guid;
|
||||
GncJob *job;
|
||||
|
||||
@@ -153,7 +154,7 @@ job_guid_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_id_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
|
||||
return set_string(node, pdata->job, gncJobSetID);
|
||||
}
|
||||
@@ -161,7 +162,7 @@ job_id_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_reference_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
|
||||
return set_string(node, pdata->job, gncJobSetReference);
|
||||
}
|
||||
@@ -169,7 +170,7 @@ job_reference_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_owner_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
GncOwner owner;
|
||||
gboolean ret;
|
||||
|
||||
@@ -183,7 +184,7 @@ job_owner_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_active_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
gint64 val;
|
||||
gboolean ret;
|
||||
|
||||
@@ -197,7 +198,7 @@ job_active_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
static gboolean
|
||||
job_slots_handler (xmlNodePtr node, gpointer job_pdata)
|
||||
{
|
||||
struct job_pdata *pdata = job_pdata;
|
||||
struct job_pdata *pdata = static_cast<decltype(pdata)>(job_pdata);
|
||||
|
||||
return dom_tree_create_instance_slots (node, QOF_INSTANCE (pdata->job));
|
||||
}
|
||||
@@ -248,7 +249,7 @@ gnc_job_end_handler(gpointer data_for_children,
|
||||
GncJob *job;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -297,7 +298,7 @@ job_should_be_saved (GncJob *job)
|
||||
static void
|
||||
do_count (QofInstance * job_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (job_should_be_saved ((GncJob *)job_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -315,7 +316,7 @@ xml_add_job (QofInstance * job_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncJob *job = (GncJob *) job_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -22,15 +22,18 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-lot-p.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -42,8 +45,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-lot-p.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -83,7 +84,7 @@ struct lot_pdata
|
||||
static gboolean
|
||||
lot_id_handler (xmlNodePtr node, gpointer p)
|
||||
{
|
||||
struct lot_pdata *pdata = p;
|
||||
struct lot_pdata *pdata = static_cast<decltype(pdata)>(p);
|
||||
GncGUID *guid;
|
||||
|
||||
ENTER("(lot=%p)", pdata->lot);
|
||||
@@ -99,7 +100,7 @@ lot_id_handler (xmlNodePtr node, gpointer p)
|
||||
static gboolean
|
||||
lot_slots_handler (xmlNodePtr node, gpointer p)
|
||||
{
|
||||
struct lot_pdata *pdata = p;
|
||||
struct lot_pdata *pdata = static_cast<decltype(pdata)>(p);
|
||||
gboolean success;
|
||||
|
||||
ENTER("(lot=%p)", pdata->lot);
|
||||
@@ -127,7 +128,7 @@ gnc_lot_end_handler(gpointer data_for_children,
|
||||
GNCLot *lot;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -21,15 +21,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncOrderP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,8 +43,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncOrderP.h"
|
||||
|
||||
#include "gnc-order-xml-v2.h"
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
|
||||
@@ -144,7 +144,7 @@ set_timespec(xmlNodePtr node, GncOrder* order,
|
||||
static gboolean
|
||||
order_guid_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
GncGUID *guid;
|
||||
GncOrder *order;
|
||||
|
||||
@@ -170,7 +170,7 @@ order_guid_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_id_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return set_string(node, pdata->order, gncOrderSetID);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ order_id_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_owner_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
GncOwner owner;
|
||||
gboolean ret;
|
||||
|
||||
@@ -192,7 +192,7 @@ order_owner_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_opened_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return set_timespec (node, pdata->order, gncOrderSetDateOpened);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ order_opened_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_closed_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return set_timespec (node, pdata->order, gncOrderSetDateClosed);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ order_closed_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_notes_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return set_string(node, pdata->order, gncOrderSetNotes);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ order_notes_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_reference_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return set_string(node, pdata->order, gncOrderSetReference);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ order_reference_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_active_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
gint64 val;
|
||||
gboolean ret;
|
||||
|
||||
@@ -238,7 +238,7 @@ order_active_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
static gboolean
|
||||
order_slots_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
struct order_pdata *pdata = static_cast<decltype(pdata)>(order_pdata);
|
||||
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE (pdata->order));
|
||||
}
|
||||
@@ -291,7 +291,7 @@ gnc_order_end_handler(gpointer data_for_children,
|
||||
GncOrder *order;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ order_should_be_saved (GncOrder *order)
|
||||
static void
|
||||
do_count (QofInstance * order_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (order_should_be_saved ((GncOrder *) order_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -358,7 +358,7 @@ xml_add_order (QofInstance * order_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncOrder *order = (GncOrder *) order_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -21,15 +21,20 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncJobP.h"
|
||||
#include "gncVendorP.h"
|
||||
#include "gncEmployeeP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -42,10 +47,6 @@
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gnc-owner-xml-v2.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncJobP.h"
|
||||
#include "gncVendorP.h"
|
||||
#include "gncEmployeeP.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -101,7 +102,7 @@ struct owner_pdata
|
||||
static gboolean
|
||||
owner_type_handler (xmlNodePtr node, gpointer owner_pdata)
|
||||
{
|
||||
struct owner_pdata *pdata = owner_pdata;
|
||||
struct owner_pdata *pdata = static_cast<decltype(pdata)>(owner_pdata);
|
||||
char* txt = dom_tree_to_text(node);
|
||||
g_return_val_if_fail(txt, FALSE);
|
||||
|
||||
@@ -127,7 +128,7 @@ owner_type_handler (xmlNodePtr node, gpointer owner_pdata)
|
||||
static gboolean
|
||||
owner_id_handler (xmlNodePtr node, gpointer owner_pdata)
|
||||
{
|
||||
struct owner_pdata *pdata = owner_pdata;
|
||||
struct owner_pdata *pdata = static_cast<decltype(pdata)>(owner_pdata);
|
||||
GncGUID *guid;
|
||||
|
||||
guid = dom_tree_to_guid(node);
|
||||
@@ -22,10 +22,11 @@
|
||||
|
||||
#ifndef GNC_OWNER_XML_V2_H
|
||||
#define GNC_OWNER_XML_V2_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "gncOwner.h"
|
||||
#include "qof.h"
|
||||
|
||||
}
|
||||
gboolean gnc_dom_tree_to_owner (xmlNodePtr node, GncOwner *owner,
|
||||
QofBook *book);
|
||||
xmlNodePtr gnc_owner_to_dom_tree (const char *tag, const GncOwner *addr);
|
||||
|
||||
@@ -20,10 +20,14 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-pricedb-p.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml.h"
|
||||
#include "sixtp.h"
|
||||
@@ -34,9 +38,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-pricedb-p.h"
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -154,8 +155,8 @@ price_parse_xml_end_handler(gpointer data_for_children,
|
||||
xmlNodePtr price_xml = (xmlNodePtr) data_for_children;
|
||||
xmlNodePtr child;
|
||||
GNCPrice *p = NULL;
|
||||
gxpf_data *gdata = global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
gxpf_data *gdata = static_cast<decltype(gdata)>(global_data);
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
/* we haven't been handed the *top* level node yet... */
|
||||
if (parent_data) return TRUE;
|
||||
@@ -263,8 +264,8 @@ pricedb_start_handler(GSList* sibling_data,
|
||||
const gchar *tag,
|
||||
gchar **attrs)
|
||||
{
|
||||
gxpf_data *gdata = global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
gxpf_data *gdata = static_cast<decltype(gdata)>(global_data);
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
GNCPriceDB *db = gnc_pricedb_get_db(book);
|
||||
g_return_val_if_fail(db, FALSE);
|
||||
gnc_pricedb_set_bulk_update(db, TRUE);
|
||||
@@ -283,8 +284,8 @@ pricedb_after_child_handler(gpointer data_for_children,
|
||||
const gchar *child_tag,
|
||||
sixtp_child_result *child_result)
|
||||
{
|
||||
gxpf_data *gdata = global_data;
|
||||
sixtp_gdv2 *gd = gdata->parsedata;
|
||||
gxpf_data *gdata = static_cast<decltype(gdata)>(global_data);
|
||||
sixtp_gdv2 *gd = static_cast<decltype(gd)>(gdata->parsedata);
|
||||
GNCPriceDB *db = (GNCPriceDB *) * result;
|
||||
|
||||
g_return_val_if_fail(db, FALSE);
|
||||
@@ -300,7 +301,7 @@ pricedb_after_child_handler(gpointer data_for_children,
|
||||
g_return_val_if_fail(p, FALSE);
|
||||
gnc_pricedb_add_price(db, p);
|
||||
gd->counter.prices_loaded++;
|
||||
run_callback(gd, "prices");
|
||||
sixtp_run_callback(gd, "prices");
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@@ -328,7 +329,7 @@ pricedb_v2_end_handler(
|
||||
GSList* sibling_data, gpointer parent_data, gpointer global_data,
|
||||
gpointer *result, const gchar *tag)
|
||||
{
|
||||
GNCPriceDB *db = *result;
|
||||
GNCPriceDB *db = static_cast<decltype(db)>(*result);
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
|
||||
if (parent_data)
|
||||
@@ -21,15 +21,18 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include "qof.h"
|
||||
#include "Recurrence.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml.h"
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "qof.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
@@ -38,7 +41,6 @@
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "Recurrence.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -20,16 +20,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SX-book.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -208,7 +209,7 @@ static
|
||||
gboolean
|
||||
sx_id_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
GncGUID *tmp = dom_tree_to_guid( node );
|
||||
|
||||
@@ -223,7 +224,7 @@ static
|
||||
gboolean
|
||||
sx_name_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gchar *tmp = dom_tree_to_text( node );
|
||||
g_debug("sx named [%s]", tmp);
|
||||
@@ -236,7 +237,7 @@ sx_name_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static gboolean
|
||||
sx_enabled_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gchar *tmp = dom_tree_to_text( node );
|
||||
|
||||
@@ -248,7 +249,7 @@ sx_enabled_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static gboolean
|
||||
sx_autoCreate_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gchar *tmp = dom_tree_to_text( node );
|
||||
|
||||
@@ -260,7 +261,7 @@ sx_autoCreate_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static gboolean
|
||||
sx_notify_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gchar *tmp = dom_tree_to_text( node );
|
||||
|
||||
@@ -272,7 +273,7 @@ sx_notify_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static gboolean
|
||||
sx_advCreate_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gint64 advCreate;
|
||||
|
||||
@@ -288,7 +289,7 @@ sx_advCreate_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static gboolean
|
||||
sx_advRemind_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gint64 advRemind;
|
||||
|
||||
@@ -319,7 +320,7 @@ static
|
||||
gboolean
|
||||
sx_instcount_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gint64 instanceNum;
|
||||
|
||||
@@ -336,7 +337,7 @@ static
|
||||
gboolean
|
||||
sx_start_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
|
||||
return sx_set_date( node, sx, xaccSchedXactionSetStartDate );
|
||||
@@ -346,7 +347,7 @@ static
|
||||
gboolean
|
||||
sx_last_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
|
||||
return sx_set_date( node, sx, xaccSchedXactionSetLastOccurDate );
|
||||
@@ -356,7 +357,7 @@ static
|
||||
gboolean
|
||||
sx_end_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
|
||||
return sx_set_date( node, sx, xaccSchedXactionSetEndDate );
|
||||
@@ -413,7 +414,7 @@ _fixup_recurrence_start_dates(const GDate *sx_start_date, GList *schedule)
|
||||
static gboolean
|
||||
sx_freqspec_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
GList *schedule;
|
||||
gchar* debug_str;
|
||||
@@ -455,7 +456,7 @@ struct dom_tree_handler sx_recurrence_list_handlers[] =
|
||||
static gboolean
|
||||
sx_recurrence_handler(xmlNodePtr node, gpointer _pdata)
|
||||
{
|
||||
struct sx_pdata *parsing_data = _pdata;
|
||||
struct sx_pdata *parsing_data = static_cast<decltype(parsing_data)>(_pdata);
|
||||
GList *schedule = NULL;
|
||||
gchar* debug_str;
|
||||
|
||||
@@ -532,7 +533,7 @@ static
|
||||
gboolean
|
||||
sx_defer_inst_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
SXTmpStateData *tsd;
|
||||
|
||||
@@ -559,7 +560,7 @@ static
|
||||
gboolean
|
||||
sx_numOccur_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gint64 numOccur;
|
||||
|
||||
@@ -578,7 +579,7 @@ static
|
||||
gboolean
|
||||
sx_templ_acct_handler( xmlNodePtr node, gpointer sx_pdata)
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
GncGUID *templ_acct_guid = dom_tree_to_guid(node);
|
||||
Account *account;
|
||||
@@ -600,7 +601,7 @@ static
|
||||
gboolean
|
||||
sx_remOccur_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
gint64 remOccur;
|
||||
|
||||
@@ -618,7 +619,7 @@ static
|
||||
gboolean
|
||||
sx_slots_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
{
|
||||
struct sx_pdata *pdata = sx_pdata;
|
||||
struct sx_pdata *pdata = static_cast<decltype(pdata)>(sx_pdata);
|
||||
SchedXaction *sx = pdata->sx;
|
||||
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE(sx));
|
||||
@@ -671,11 +672,11 @@ gnc_schedXaction_end_handler(gpointer data_for_children,
|
||||
|
||||
g_return_val_if_fail( tree, FALSE );
|
||||
|
||||
sx = xaccSchedXactionMalloc( gdata->bookdata );
|
||||
sx = xaccSchedXactionMalloc(static_cast<QofBook*>(gdata->bookdata) );
|
||||
|
||||
memset(&sx_pdata, 0, sizeof(sx_pdata));
|
||||
sx_pdata.sx = sx;
|
||||
sx_pdata.book = gdata->bookdata;
|
||||
sx_pdata.book = static_cast<decltype(sx_pdata.book)>(gdata->bookdata);
|
||||
|
||||
g_assert( sx_dom_handlers != NULL );
|
||||
|
||||
@@ -733,7 +734,7 @@ gnc_schedXaction_end_handler(gpointer data_for_children,
|
||||
{
|
||||
Account *ra = NULL;
|
||||
Account *acct = NULL;
|
||||
sixtp_gdv2 *sixdata = gdata->parsedata;
|
||||
sixtp_gdv2 *sixdata = static_cast<decltype(sixdata)>(gdata->parsedata);
|
||||
QofBook *book;
|
||||
gchar guidstr[GUID_ENCODING_LENGTH+1];
|
||||
|
||||
@@ -786,7 +787,7 @@ static
|
||||
gboolean
|
||||
tt_act_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
gnc_template_xaction_data *txd = data;
|
||||
gnc_template_xaction_data *txd = static_cast<decltype(txd)>(data);
|
||||
Account *acc;
|
||||
gnc_commodity *com;
|
||||
|
||||
@@ -837,7 +838,7 @@ static
|
||||
gboolean
|
||||
tt_trn_handler( xmlNodePtr node, gpointer data )
|
||||
{
|
||||
gnc_template_xaction_data *txd = data;
|
||||
gnc_template_xaction_data *txd = static_cast<decltype(txd)>(data);
|
||||
Transaction *trn;
|
||||
|
||||
trn = dom_tree_to_transaction( node, txd->book );
|
||||
@@ -871,9 +872,9 @@ gnc_template_transaction_end_handler(gpointer data_for_children,
|
||||
const gchar *tag)
|
||||
{
|
||||
gboolean successful = FALSE;
|
||||
xmlNodePtr tree = data_for_children;
|
||||
gxpf_data *gdata = global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
xmlNodePtr tree = static_cast<decltype(tree)>(data_for_children);
|
||||
gxpf_data *gdata = static_cast<decltype(gdata)>(global_data);
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
GList *n;
|
||||
gnc_template_xaction_data txd;
|
||||
|
||||
@@ -21,15 +21,18 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncEntry.h"
|
||||
#include "gncTaxTableP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,8 +44,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncEntry.h"
|
||||
#include "gncTaxTableP.h"
|
||||
#include "gnc-tax-table-xml-v2.h"
|
||||
|
||||
#define _GNC_MOD_NAME GNC_ID_TAXTABLE
|
||||
@@ -126,7 +127,7 @@ taxtable_dom_tree_create (GncTaxTable *table)
|
||||
entries = xmlNewChild (ret, NULL, BAD_CAST taxtable_entries_string, NULL);
|
||||
for (list = gncTaxTableGetEntries (table); list; list = list->next)
|
||||
{
|
||||
GncTaxTableEntry *entry = list->data;
|
||||
GncTaxTableEntry *entry = static_cast<decltype(entry)>(list->data);
|
||||
xmlAddChild(entries, ttentry_dom_tree_create (entry));
|
||||
}
|
||||
|
||||
@@ -147,7 +148,7 @@ struct ttentry_pdata
|
||||
static gboolean
|
||||
ttentry_acct_handler (xmlNodePtr node, gpointer ttentry_pdata)
|
||||
{
|
||||
struct ttentry_pdata *pdata = ttentry_pdata;
|
||||
struct ttentry_pdata *pdata = static_cast<decltype(pdata)>(ttentry_pdata);
|
||||
GncGUID *guid;
|
||||
Account * acc;
|
||||
|
||||
@@ -162,9 +163,9 @@ ttentry_acct_handler (xmlNodePtr node, gpointer ttentry_pdata)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ttentry_type_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
ttentry_type_handler (xmlNodePtr node, gpointer ttentry_pdata)
|
||||
{
|
||||
struct ttentry_pdata *pdata = taxtable_pdata;
|
||||
struct ttentry_pdata *pdata = static_cast<decltype(pdata)>(ttentry_pdata);
|
||||
GncAmountType type;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -184,7 +185,7 @@ ttentry_type_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
ttentry_amount_handler (xmlNodePtr node, gpointer ttentry_pdata)
|
||||
{
|
||||
struct ttentry_pdata *pdata = ttentry_pdata;
|
||||
struct ttentry_pdata *pdata = static_cast<decltype(pdata)>(ttentry_pdata);
|
||||
gnc_numeric* num = dom_tree_to_gnc_numeric(node);
|
||||
g_return_val_if_fail(num, FALSE);
|
||||
|
||||
@@ -266,7 +267,7 @@ set_parent_child (xmlNodePtr node, struct taxtable_pdata *pdata,
|
||||
static gboolean
|
||||
taxtable_guid_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
GncGUID *guid;
|
||||
GncTaxTable *table;
|
||||
|
||||
@@ -292,7 +293,7 @@ taxtable_guid_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
taxtable_name_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
char* txt = dom_tree_to_text(node);
|
||||
g_return_val_if_fail(txt, FALSE);
|
||||
|
||||
@@ -304,7 +305,7 @@ taxtable_name_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
taxtable_refcount_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer(node, &val);
|
||||
@@ -315,7 +316,7 @@ taxtable_refcount_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
taxtable_invisible_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
gint64 val;
|
||||
|
||||
dom_tree_to_integer(node, &val);
|
||||
@@ -327,21 +328,21 @@ taxtable_invisible_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
taxtable_parent_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
return set_parent_child (node, pdata, gncTaxTableSetParent);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
taxtable_child_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
return set_parent_child (node, pdata, gncTaxTableSetChild);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
taxtable_entries_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
xmlNodePtr mark;
|
||||
|
||||
g_return_val_if_fail (node, FALSE);
|
||||
@@ -371,7 +372,7 @@ taxtable_entries_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
static gboolean
|
||||
taxtable_slots_handler (xmlNodePtr node, gpointer taxtable_pdata)
|
||||
{
|
||||
struct taxtable_pdata *pdata = taxtable_pdata;
|
||||
struct taxtable_pdata *pdata = static_cast<decltype(pdata)>(taxtable_pdata);
|
||||
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE (pdata->table));
|
||||
}
|
||||
@@ -423,7 +424,7 @@ gnc_taxtable_end_handler(gpointer data_for_children,
|
||||
GncTaxTable *table;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -459,7 +460,7 @@ taxtable_sixtp_parser_create(void)
|
||||
static void
|
||||
do_count (QofInstance * table_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
(*count)++;
|
||||
}
|
||||
|
||||
@@ -476,7 +477,7 @@ xml_add_taxtable (QofInstance * table_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncTaxTable *table = (GncTaxTable *) table_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -542,7 +543,7 @@ static void
|
||||
taxtable_scrub_cb (QofInstance * table_p, gpointer list_p)
|
||||
{
|
||||
GncTaxTable *table = GNC_TAXTABLE(table_p);
|
||||
GList **list = list_p;
|
||||
GList **list = static_cast<decltype(list)>(list_p);
|
||||
|
||||
if (taxtable_is_grandchild(table) || gncTaxTableGetEntries(table) == NULL)
|
||||
*list = g_list_prepend(*list, table);
|
||||
@@ -554,7 +555,7 @@ taxtable_scrub_cb (QofInstance * table_p, gpointer list_p)
|
||||
static void
|
||||
taxtable_scrub_entries (QofInstance * entry_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncEntry *entry = GNC_ENTRY(entry_p);
|
||||
GncTaxTable *table, *new_tt;
|
||||
gint32 count;
|
||||
@@ -607,7 +608,7 @@ taxtable_scrub_entries (QofInstance * entry_p, gpointer ht_p)
|
||||
static void
|
||||
taxtable_scrub_cust (QofInstance * cust_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncCustomer *cust = GNC_CUSTOMER(cust_p);
|
||||
GncTaxTable *table;
|
||||
gint32 count;
|
||||
@@ -624,7 +625,7 @@ taxtable_scrub_cust (QofInstance * cust_p, gpointer ht_p)
|
||||
static void
|
||||
taxtable_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
|
||||
{
|
||||
GHashTable *ht = ht_p;
|
||||
GHashTable *ht = static_cast<decltype(ht)>(ht_p);
|
||||
GncVendor *vendor = GNC_VENDOR(vendor_p);
|
||||
GncTaxTable *table;
|
||||
gint32 count;
|
||||
@@ -641,7 +642,7 @@ taxtable_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
|
||||
static void
|
||||
taxtable_reset_refcount (gpointer key, gpointer value, gpointer notused)
|
||||
{
|
||||
GncTaxTable *table = key;
|
||||
GncTaxTable *table = static_cast<decltype(table)>(key);
|
||||
gint32 count = GPOINTER_TO_INT(value);
|
||||
|
||||
if (count != gncTaxTableGetRefcount(table) && !gncTaxTableGetInvisible(table))
|
||||
@@ -671,7 +672,7 @@ taxtable_scrub (QofBook *book)
|
||||
for (node = list; node; node = node->next)
|
||||
{
|
||||
gchar guidstr[GUID_ENCODING_LENGTH+1];
|
||||
table = node->data;
|
||||
table = static_cast<decltype(table)>(node->data);
|
||||
|
||||
guid_to_string_buff(qof_instance_get_guid(QOF_INSTANCE(table)),guidstr);
|
||||
PINFO ("deleting grandchild taxtable: %s\n", guidstr);
|
||||
@@ -21,12 +21,18 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "AccountP.h"
|
||||
#include "Transaction.h"
|
||||
#include "TransactionP.h"
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-lot-p.h"
|
||||
}
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
@@ -41,11 +47,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "AccountP.h"
|
||||
#include "Transaction.h"
|
||||
#include "TransactionP.h"
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-lot-p.h"
|
||||
|
||||
const gchar *transaction_version_string = "2.0.0";
|
||||
|
||||
@@ -143,7 +144,7 @@ add_trans_splits(xmlNodePtr node, Transaction *trn)
|
||||
|
||||
for (n = xaccTransGetSplitList(trn); n; n = n->next)
|
||||
{
|
||||
Split *s = n->data;
|
||||
Split *s = static_cast<decltype(s)>(n->data);
|
||||
xmlAddChild(toaddto, split_to_dom_tree("trn:split", s));
|
||||
}
|
||||
}
|
||||
@@ -232,7 +233,7 @@ set_spl_gnc_num(xmlNodePtr node, Split* spl,
|
||||
static gboolean
|
||||
spl_id_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
GncGUID *tmp = dom_tree_to_guid(node);
|
||||
g_return_val_if_fail(tmp, FALSE);
|
||||
|
||||
@@ -245,21 +246,21 @@ spl_id_handler(xmlNodePtr node, gpointer data)
|
||||
static gboolean
|
||||
spl_memo_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
return set_spl_string(node, pdata->split, xaccSplitSetMemo);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spl_action_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
return set_spl_string(node, pdata->split, xaccSplitSetAction);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spl_reconciled_state_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
gchar *tmp = dom_tree_to_text(node);
|
||||
g_return_val_if_fail(tmp, FALSE);
|
||||
|
||||
@@ -273,7 +274,7 @@ spl_reconciled_state_handler(xmlNodePtr node, gpointer data)
|
||||
static gboolean
|
||||
spl_reconcile_date_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
Timespec ts;
|
||||
|
||||
ts = dom_tree_to_timespec(node);
|
||||
@@ -287,14 +288,14 @@ spl_reconcile_date_handler(xmlNodePtr node, gpointer data)
|
||||
static gboolean
|
||||
spl_value_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
return set_spl_gnc_num(node, pdata->split, xaccSplitSetValue);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spl_quantity_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
return set_spl_gnc_num(node, pdata->split, xaccSplitSetAmount);
|
||||
}
|
||||
|
||||
@@ -303,7 +304,7 @@ gboolean gnc_transaction_xml_v2_testing = FALSE;
|
||||
static gboolean
|
||||
spl_account_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
GncGUID *id = dom_tree_to_guid(node);
|
||||
Account *account;
|
||||
|
||||
@@ -329,7 +330,7 @@ spl_account_handler(xmlNodePtr node, gpointer data)
|
||||
static gboolean
|
||||
spl_lot_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
GncGUID *id = dom_tree_to_guid(node);
|
||||
GNCLot *lot;
|
||||
|
||||
@@ -353,7 +354,7 @@ spl_lot_handler(xmlNodePtr node, gpointer data)
|
||||
static gboolean
|
||||
spl_slots_handler(xmlNodePtr node, gpointer data)
|
||||
{
|
||||
struct split_pdata *pdata = data;
|
||||
struct split_pdata *pdata = static_cast<decltype(pdata)>(data);
|
||||
gboolean successful;
|
||||
|
||||
successful = dom_tree_create_instance_slots(node,
|
||||
@@ -447,7 +448,7 @@ set_tran_date(xmlNodePtr node, Transaction *trn,
|
||||
static gboolean
|
||||
trn_id_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
GncGUID *tmp = dom_tree_to_guid(node);
|
||||
|
||||
@@ -463,7 +464,7 @@ trn_id_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_currency_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
gnc_commodity *ref;
|
||||
|
||||
@@ -476,7 +477,7 @@ trn_currency_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_num_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
|
||||
return set_tran_string(node, trn, xaccTransSetNum);
|
||||
@@ -485,7 +486,7 @@ trn_num_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_date_posted_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
|
||||
return set_tran_date(node, trn, xaccTransSetDatePostedTS);
|
||||
@@ -494,7 +495,7 @@ trn_date_posted_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_date_entered_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
|
||||
return set_tran_date(node, trn, xaccTransSetDateEnteredTS);
|
||||
@@ -503,7 +504,7 @@ trn_date_entered_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_description_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
|
||||
return set_tran_string(node, trn, xaccTransSetDescription);
|
||||
@@ -512,7 +513,7 @@ trn_description_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_slots_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
gboolean successful;
|
||||
|
||||
@@ -526,7 +527,7 @@ trn_slots_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
static gboolean
|
||||
trn_splits_handler(xmlNodePtr node, gpointer trans_pdata)
|
||||
{
|
||||
struct trans_pdata *pdata = trans_pdata;
|
||||
struct trans_pdata *pdata = static_cast<decltype(pdata)>(trans_pdata);
|
||||
Transaction *trn = pdata->trans;
|
||||
xmlNodePtr mark;
|
||||
|
||||
@@ -596,7 +597,8 @@ gnc_transaction_end_handler(gpointer data_for_children,
|
||||
|
||||
g_return_val_if_fail(tree, FALSE);
|
||||
|
||||
trn = dom_tree_to_transaction(tree, gdata->bookdata);
|
||||
trn = dom_tree_to_transaction(tree,
|
||||
static_cast<QofBook*>(gdata->bookdata));
|
||||
if (trn != NULL)
|
||||
{
|
||||
gdata->cb(tag, gdata->parsedata, trn);
|
||||
@@ -21,15 +21,19 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncVendorP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -41,9 +45,6 @@
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "gncBillTermP.h"
|
||||
#include "gncVendorP.h"
|
||||
#include "gncTaxTableP.h"
|
||||
#include "gnc-vendor-xml-v2.h"
|
||||
#include "gnc-address-xml-v2.h"
|
||||
#include "xml-helpers.h"
|
||||
@@ -163,7 +164,7 @@ set_boolean(xmlNodePtr node, GncVendor* vendor,
|
||||
static gboolean
|
||||
vendor_name_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
|
||||
return set_string(node, pdata->vendor, gncVendorSetName);
|
||||
}
|
||||
@@ -171,7 +172,7 @@ vendor_name_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_guid_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
GncGUID *guid;
|
||||
GncVendor *vendor;
|
||||
|
||||
@@ -197,7 +198,7 @@ vendor_guid_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_id_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
|
||||
return set_string(node, pdata->vendor, gncVendorSetID);
|
||||
}
|
||||
@@ -205,7 +206,7 @@ vendor_id_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_notes_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
|
||||
return set_string(node, pdata->vendor, gncVendorSetNotes);
|
||||
}
|
||||
@@ -213,7 +214,7 @@ vendor_notes_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_terms_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
GncGUID *guid;
|
||||
GncBillTerm *term;
|
||||
|
||||
@@ -230,7 +231,7 @@ vendor_terms_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_addr_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
|
||||
return gnc_dom_tree_to_address (node, gncVendorGetAddr(pdata->vendor));
|
||||
}
|
||||
@@ -238,7 +239,7 @@ vendor_addr_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_taxincluded_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
GncTaxIncluded type;
|
||||
char *str;
|
||||
gboolean ret;
|
||||
@@ -258,14 +259,14 @@ vendor_taxincluded_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_active_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
return set_boolean (node, pdata->vendor, gncVendorSetActive);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vendor_currency_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
gnc_commodity *com;
|
||||
|
||||
com = dom_tree_to_commodity_ref(node, pdata->book);
|
||||
@@ -279,7 +280,7 @@ vendor_currency_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_taxtable_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
GncGUID *guid;
|
||||
GncTaxTable *taxtable;
|
||||
|
||||
@@ -304,14 +305,14 @@ vendor_taxtable_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
static gboolean
|
||||
vendor_taxtableoverride_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
return set_boolean (node, pdata->vendor, gncVendorSetTaxTableOverride);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vendor_slots_handler (xmlNodePtr node, gpointer vendor_pdata)
|
||||
{
|
||||
struct vendor_pdata *pdata = vendor_pdata;
|
||||
struct vendor_pdata *pdata = static_cast<decltype(pdata)>(vendor_pdata);
|
||||
return dom_tree_create_instance_slots(node, QOF_INSTANCE(pdata->vendor));
|
||||
|
||||
}
|
||||
@@ -368,7 +369,7 @@ gnc_vendor_end_handler(gpointer data_for_children,
|
||||
GncVendor *vendor;
|
||||
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
||||
gxpf_data *gdata = (gxpf_data*)global_data;
|
||||
QofBook *book = gdata->bookdata;
|
||||
QofBook *book = static_cast<decltype(book)>(gdata->bookdata);
|
||||
|
||||
if (parent_data)
|
||||
{
|
||||
@@ -417,7 +418,7 @@ vendor_should_be_saved (GncVendor *vendor)
|
||||
static void
|
||||
do_count (QofInstance * vendor_p, gpointer count_p)
|
||||
{
|
||||
int *count = count_p;
|
||||
int *count = static_cast<decltype(count)>(count_p);
|
||||
if (vendor_should_be_saved ((GncVendor *)vendor_p))
|
||||
(*count)++;
|
||||
}
|
||||
@@ -435,7 +436,7 @@ xml_add_vendor (QofInstance * vendor_p, gpointer out_p)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
GncVendor *vendor = (GncVendor *) vendor_p;
|
||||
FILE *out = out_p;
|
||||
FILE *out = static_cast<decltype(out)>(out_p);
|
||||
|
||||
if (ferror(out))
|
||||
return;
|
||||
@@ -21,8 +21,11 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <glib.h>
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
xmlChar*
|
||||
@@ -47,4 +50,3 @@ checked_char_cast (gchar *val)
|
||||
*end = '?';
|
||||
return (xmlChar*)(val);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
#ifndef GNC_XML_HELPER_H
|
||||
#define GNC_XML_HELPER_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
# include <libxml/SAX.h>
|
||||
@@ -32,6 +33,7 @@
|
||||
# include <libxml/parser.h>
|
||||
# include <libxml/xmlmemory.h>
|
||||
# include <libxml/parserInternals.h>
|
||||
}
|
||||
# ifndef xmlChildrenNode
|
||||
# define xmlChildrenNode children
|
||||
# endif /* ifndef xmlChildrenNode */
|
||||
|
||||
@@ -25,10 +25,14 @@
|
||||
#ifndef GNC_XML_H
|
||||
#define GNC_XML_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "SchedXaction.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-budget.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <stdio.h>
|
||||
#include <gmodule.h>
|
||||
/* #include <glib-gobject.h> */
|
||||
@@ -45,6 +46,7 @@ int libgncmod_backend_file_gnc_module_age = 0;
|
||||
static GNCModule engine;
|
||||
|
||||
|
||||
|
||||
char *
|
||||
libgncmod_backend_file_gnc_module_path(void)
|
||||
{
|
||||
@@ -79,3 +81,4 @@ libgncmod_backend_file_gnc_module_end(int refcount)
|
||||
|
||||
return unload;
|
||||
}
|
||||
} //extern "C"
|
||||
@@ -21,7 +21,8 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
@@ -43,9 +44,17 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include "gnc-engine.h"
|
||||
#include "Scrub.h"
|
||||
#include "TransLog.h"
|
||||
#include "platform.h"
|
||||
#if COMPILER(MSVC)
|
||||
# define g_fopen fopen
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "io-example-account.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
@@ -54,12 +63,6 @@
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-parsers.h"
|
||||
|
||||
#include "Scrub.h"
|
||||
#include "TransLog.h"
|
||||
#include "platform.h"
|
||||
#if COMPILER(MSVC)
|
||||
# define g_fopen fopen
|
||||
#endif
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
|
||||
#ifndef IO_EXAMPLE_ACCOUNT_H
|
||||
#define IO_EXAMPLE_ACCOUNT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "gnc-engine.h"
|
||||
|
||||
struct GncExampleAccount_struct
|
||||
@@ -52,7 +54,9 @@ GncExampleAccount *gnc_read_example_account(const gchar *filename);
|
||||
|
||||
void gnc_free_example_account_list(GSList *list);
|
||||
GSList* gnc_load_example_account_list(const char *dirname);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* gboolean gnc_is_example_account_xml(const gchar *name); */
|
||||
|
||||
#endif /* IO_EXAMPLE_ACCOUNT_H */
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
}
|
||||
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
@@ -24,8 +24,11 @@
|
||||
|
||||
#ifndef IO_GNCXML_GEN_H
|
||||
#define IO_GNCXML_GEN_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <glib.h>
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
|
||||
typedef gboolean (*gxpf_callback)(const char *tag, gpointer parsedata,
|
||||
|
||||
@@ -43,14 +43,15 @@ extern "C"
|
||||
#include <TransLog.h>
|
||||
#include <gnc-pricedb.h>
|
||||
#include <gnc-pricedb-p.h>
|
||||
#include "io-gncxml.h"
|
||||
}
|
||||
|
||||
#include "io-gncxml.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-stack.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
}
|
||||
|
||||
#include <kvp_frame.hpp>
|
||||
|
||||
/* from Transaction-xml-parser-v1.c */
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
@@ -44,15 +45,6 @@
|
||||
#include "Transaction.h"
|
||||
#include "TransactionP.h"
|
||||
#include "TransLog.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "io-utils.h"
|
||||
#ifdef G_OS_WIN32
|
||||
# include <io.h>
|
||||
# define close _close
|
||||
@@ -64,6 +56,16 @@
|
||||
# define g_fopen fopen
|
||||
# define g_open _open
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "io-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
/* Do not treat -Wstrict-aliasing warnings as errors because of problems of the
|
||||
* G_LOCK* macros as declared by glib. See
|
||||
@@ -110,15 +112,6 @@ static FILE *try_gz_open (const char *filename, const char *perms, gboolean use_
|
||||
static gboolean is_gzipped_file(const gchar *name);
|
||||
static gboolean wait_for_gzip(FILE *file);
|
||||
|
||||
void
|
||||
run_callback(sixtp_gdv2 *data, const char *type)
|
||||
{
|
||||
if (data->countCallback)
|
||||
{
|
||||
data->countCallback(data, type);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clear_up_account_commodity(
|
||||
gnc_commodity_table *tbl, Account *act,
|
||||
@@ -241,7 +234,7 @@ add_account_local(sixtp_gdv2 *data, Account *act)
|
||||
}
|
||||
|
||||
data->counter.accounts_loaded++;
|
||||
run_callback(data, "account");
|
||||
sixtp_run_callback(data, "account");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -250,7 +243,7 @@ static gboolean
|
||||
add_book_local(sixtp_gdv2 *data, QofBook *book)
|
||||
{
|
||||
data->counter.books_loaded++;
|
||||
run_callback(data, "book");
|
||||
sixtp_run_callback(data, "book");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -265,7 +258,7 @@ add_commodity_local(sixtp_gdv2 *data, gnc_commodity *com)
|
||||
gnc_commodity_table_insert(table, com);
|
||||
|
||||
data->counter.commodities_loaded++;
|
||||
run_callback(data, "commodities");
|
||||
sixtp_run_callback(data, "commodities");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -286,7 +279,7 @@ add_transaction_local(sixtp_gdv2 *data, Transaction *trn)
|
||||
xaccTransCommitEdit (trn);
|
||||
|
||||
data->counter.transactions_loaded++;
|
||||
run_callback(data, "transaction");
|
||||
sixtp_run_callback(data, "transaction");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -297,7 +290,7 @@ add_schedXaction_local(sixtp_gdv2 *data, SchedXaction *sx)
|
||||
sxes = gnc_book_get_schedxactions(data->book);
|
||||
gnc_sxes_add_sx(sxes, sx);
|
||||
data->counter.schedXactions_loaded++;
|
||||
run_callback(data, "schedXactions");
|
||||
sixtp_run_callback(data, "schedXactions");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -354,8 +347,8 @@ add_pricedb_local(sixtp_gdv2 *data, GNCPriceDB *db)
|
||||
static void
|
||||
do_counter_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -542,8 +535,8 @@ static const char *BUDGET_TAG = "gnc:budget";
|
||||
static void
|
||||
add_item_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -633,8 +626,8 @@ generic_callback(const char *tag, gpointer globaldata, gpointer data)
|
||||
static void
|
||||
add_parser_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -653,8 +646,8 @@ add_parser_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
static void
|
||||
scrub_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -960,8 +953,8 @@ static void write_budget (QofInstance *ent, gpointer data);
|
||||
static void
|
||||
write_counts_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -975,8 +968,8 @@ write_counts_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
static void
|
||||
write_data_cb (const char *type, gpointer data_p, gpointer be_data_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
struct file_backend *be_data = be_data_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(be_data_p);
|
||||
|
||||
g_return_if_fail (type && data && be_data);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -1090,12 +1083,12 @@ write_commodities(FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
||||
GList *comms, *lp2;
|
||||
xmlNodePtr comnode;
|
||||
|
||||
comms = gnc_commodity_table_get_commodities(tbl, lp->data);
|
||||
comms = gnc_commodity_table_get_commodities(tbl, static_cast<const char*>(lp->data));
|
||||
comms = g_list_sort(comms, compare_commodity_ids);
|
||||
|
||||
for (lp2 = comms; lp2; lp2 = lp2->next)
|
||||
{
|
||||
comnode = gnc_commodity_dom_tree_create(lp2->data);
|
||||
comnode = gnc_commodity_dom_tree_create(static_cast<const gnc_commodity*>(lp2->data));
|
||||
if (comnode == NULL)
|
||||
continue;
|
||||
|
||||
@@ -1108,7 +1101,7 @@ write_commodities(FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
||||
|
||||
xmlFreeNode(comnode);
|
||||
gd->counter.commodities_loaded++;
|
||||
run_callback(gd, "commodities");
|
||||
sixtp_run_callback(gd, "commodities");
|
||||
}
|
||||
|
||||
g_list_free (comms);
|
||||
@@ -1160,7 +1153,7 @@ write_pricedb(FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
||||
if (ferror(out))
|
||||
break;
|
||||
gd->counter.prices_loaded += 1;
|
||||
run_callback(gd, "prices");
|
||||
sixtp_run_callback(gd, "prices");
|
||||
}
|
||||
|
||||
xmlOutputBufferClose(outbuf);
|
||||
@@ -1178,7 +1171,7 @@ write_pricedb(FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
||||
static int
|
||||
xml_add_trn_data(Transaction *t, gpointer data)
|
||||
{
|
||||
struct file_backend *be_data = data;
|
||||
struct file_backend *be_data = static_cast<decltype(be_data)>(data);
|
||||
xmlNodePtr node;
|
||||
|
||||
node = gnc_transaction_dom_tree_create(t);
|
||||
@@ -1190,7 +1183,7 @@ xml_add_trn_data(Transaction *t, gpointer data)
|
||||
return -1;
|
||||
|
||||
be_data->gd->counter.transactions_loaded++;
|
||||
run_callback(be_data->gd, "transaction");
|
||||
sixtp_run_callback(be_data->gd, "transaction");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1244,14 +1237,14 @@ write_schedXactions( FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
||||
|
||||
do
|
||||
{
|
||||
tmpSX = schedXactions->data;
|
||||
tmpSX = static_cast<decltype(tmpSX)>(schedXactions->data);
|
||||
node = gnc_schedXaction_dom_tree_create( tmpSX );
|
||||
xmlElemDump( out, NULL, node );
|
||||
xmlFreeNode(node);
|
||||
if (ferror(out) || fprintf(out, "\n") < 0)
|
||||
return FALSE;
|
||||
gd->counter.schedXactions_loaded++;
|
||||
run_callback(gd, "schedXactions");
|
||||
sixtp_run_callback(gd, "schedXactions");
|
||||
}
|
||||
while ( (schedXactions = schedXactions->next) );
|
||||
|
||||
@@ -1262,7 +1255,7 @@ static void
|
||||
write_budget (QofInstance *ent, gpointer data)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
struct file_backend* be = data;
|
||||
struct file_backend* be = static_cast<decltype(be)>(data);
|
||||
|
||||
GncBudget *bgt = GNC_BUDGET(ent);
|
||||
|
||||
@@ -1276,7 +1269,7 @@ write_budget (QofInstance *ent, gpointer data)
|
||||
return;
|
||||
|
||||
be->gd->counter.budgets_loaded++;
|
||||
run_callback(be->gd, "budgets");
|
||||
sixtp_run_callback(be->gd, "budgets");
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1290,8 +1283,8 @@ gnc_xml2_write_namespace_decl (FILE *out, const char *name_space)
|
||||
static void
|
||||
do_write_namespace_cb (const char *type, gpointer data_p, gpointer file_p)
|
||||
{
|
||||
GncXmlDataType_t *data = data_p;
|
||||
FILE *out = file_p;
|
||||
GncXmlDataType_t *data = static_cast<decltype(data)>(data_p);
|
||||
FILE *out = static_cast<decltype(out)>(file_p);
|
||||
|
||||
g_return_if_fail (type && data && out);
|
||||
g_return_if_fail (data->version == GNC_FILE_BACKEND_VERS);
|
||||
@@ -1608,7 +1601,7 @@ wait_for_gzip(FILE *file)
|
||||
G_LOCK(threads);
|
||||
if (threads)
|
||||
{
|
||||
GThread *thread = g_hash_table_lookup(threads, file);
|
||||
GThread *thread = static_cast<decltype(thread)>(g_hash_table_lookup(threads, file));
|
||||
if (thread)
|
||||
{
|
||||
g_hash_table_remove(threads, file);
|
||||
@@ -1947,7 +1940,7 @@ gnc_xml2_find_ambiguous(const gchar *filename, GList *encodings,
|
||||
conv_list = NULL;
|
||||
for (iter = iconv_list; iter; iter = iter->next)
|
||||
{
|
||||
iconv_item = iter->data;
|
||||
iconv_item = static_cast<decltype(iconv_item)>(iter->data);
|
||||
utf8 = g_convert_with_iconv(word, -1, iconv_item->iconv,
|
||||
NULL, NULL, &error);
|
||||
if (utf8)
|
||||
@@ -2130,7 +2123,7 @@ parse_with_subst_push_handler (xmlParserCtxtPtr xml_context,
|
||||
error = NULL;
|
||||
|
||||
word = g_strndup(start, len);
|
||||
repl = g_hash_table_lookup(push_data->subst, word);
|
||||
repl = static_cast<decltype(repl)>(g_hash_table_lookup(push_data->subst, word));
|
||||
g_free(word);
|
||||
if (repl)
|
||||
{
|
||||
@@ -30,48 +30,16 @@
|
||||
|
||||
#ifndef IO_GNCXML_V2_H
|
||||
#define IO_GNCXML_V2_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-backend-xml.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int accounts_total;
|
||||
int accounts_loaded;
|
||||
|
||||
int books_total;
|
||||
int books_loaded;
|
||||
|
||||
int commodities_total;
|
||||
int commodities_loaded;
|
||||
|
||||
int transactions_total;
|
||||
int transactions_loaded;
|
||||
|
||||
int prices_total;
|
||||
int prices_loaded;
|
||||
|
||||
int schedXactions_total;
|
||||
int schedXactions_loaded;
|
||||
|
||||
int budgets_total;
|
||||
int budgets_loaded;
|
||||
} load_counter;
|
||||
|
||||
typedef struct sixtp_gdv2 sixtp_gdv2;
|
||||
typedef void (*countCallbackFn)(sixtp_gdv2 *gd, const char *type);
|
||||
struct sixtp_gdv2
|
||||
{
|
||||
QofBook *book;
|
||||
load_counter counter;
|
||||
countCallbackFn countCallback;
|
||||
QofBePercentageFunc gui_display_fn;
|
||||
gboolean exporting;
|
||||
};
|
||||
|
||||
/**
|
||||
* Struct used to pass in a new data type for XML storage. This contains
|
||||
@@ -98,18 +66,6 @@ struct sixtp_gdv2
|
||||
*/
|
||||
#define GNC_FILE_BACKEND "gnc:file:2"
|
||||
#define GNC_FILE_BACKEND_VERS 2
|
||||
typedef struct
|
||||
{
|
||||
int version; /* backend version number */
|
||||
const char * type_name; /* The XML tag for this type */
|
||||
|
||||
sixtp * (*create_parser) (void);
|
||||
gboolean (*add_item)(sixtp_gdv2 *, gpointer obj);
|
||||
int (*get_count) (QofBook *);
|
||||
gboolean (*write) (FILE*, QofBook*);
|
||||
void (*scrub) (QofBook *);
|
||||
gboolean (*ns) (FILE*);
|
||||
} GncXmlDataType_t;
|
||||
|
||||
/**
|
||||
* Struct used to pass the account group/accounts and trasnactions in
|
||||
@@ -124,9 +80,6 @@ typedef struct
|
||||
QofBook *book;
|
||||
} gnc_template_xaction_data;
|
||||
|
||||
/** Call after loading each record */
|
||||
void run_callback(sixtp_gdv2 *data, const char *type);
|
||||
|
||||
/** read in an account group from a file */
|
||||
gboolean qof_session_load_from_xml_file_v2(FileBackend *, QofBook *, QofBookFileType);
|
||||
|
||||
@@ -188,5 +141,7 @@ gint gnc_xml2_find_ambiguous(
|
||||
*/
|
||||
gboolean gnc_xml2_parse_with_subst (
|
||||
FileBackend *fbe, QofBook *book, GHashTable *subst);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __IO_GNCXML_V2_H__ */
|
||||
|
||||
@@ -21,17 +21,18 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glib.h>
|
||||
}
|
||||
|
||||
#include "gnc-xml.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "io-utils.h"
|
||||
|
||||
#include "sixtp.h"
|
||||
/*
|
||||
<!-- Local variables: -->
|
||||
<!-- mode: C -->
|
||||
@@ -68,7 +69,7 @@ write_one_account(FILE *out,
|
||||
return FALSE;
|
||||
|
||||
gd->counter.accounts_loaded++;
|
||||
run_callback(gd, "account");
|
||||
sixtp_run_callback(gd, "account");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -86,7 +87,8 @@ write_account_tree(FILE *out, Account *root, sixtp_gdv2 *gd)
|
||||
descendants = gnc_account_get_descendants(root);
|
||||
for (node = descendants; node; node = g_list_next(node))
|
||||
{
|
||||
if (!write_one_account(out, node->data, gd, allow_incompat))
|
||||
if (!write_one_account(out, static_cast<Account*>(node->data),
|
||||
gd, allow_incompat))
|
||||
{
|
||||
success = FALSE;
|
||||
break;
|
||||
@@ -24,11 +24,13 @@
|
||||
|
||||
#ifndef IO_UTILS_H
|
||||
#define IO_UTILS_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <stdio.h>
|
||||
#include "qof.h"
|
||||
}
|
||||
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "qof.h"
|
||||
|
||||
gboolean write_account_tree(FILE *out, Account *root, sixtp_gdv2 *gd);
|
||||
gboolean write_accounts(FILE *out, QofBook *book, sixtp_gdv2 *gd);
|
||||
|
||||
@@ -27,12 +27,12 @@ extern "C"
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include <gnc-date.h>
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
#include "sixtp-utils.h"
|
||||
}
|
||||
|
||||
#include <kvp_frame.hpp>
|
||||
|
||||
@@ -369,4 +369,3 @@ qof_instance_slots_to_dom_tree(const char *tag, const QofInstance* inst)
|
||||
frame->for_each_slot(add_kvp_slot, static_cast<void*>(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,18 +24,16 @@
|
||||
#ifndef SIXTP_DOM_GENERATORS_H
|
||||
#define SIXTP_DOM_GENERATORS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "sixtp-dom-generators.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "qof.h"
|
||||
#include "Recurrence.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
xmlNodePtr text_to_dom_tree(const char *tag, const char *str);
|
||||
xmlNodePtr int_to_dom_tree(const char *tag, gint64 val);
|
||||
@@ -54,7 +52,4 @@ xmlNodePtr recurrence_to_dom_tree(const gchar *tag, const Recurrence *r);
|
||||
|
||||
gchar* double_to_string(double value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _SIXTP_DOM_GENERATORS_H_ */
|
||||
|
||||
@@ -29,10 +29,10 @@ extern "C"
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include <gnc-engine.h>
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
}
|
||||
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include <kvp_frame.hpp>
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
@@ -302,10 +302,7 @@ string_to_binary(const gchar *str, void **v, guint64 *data_len)
|
||||
|
||||
static KvpValue* dom_tree_to_kvp_value(xmlNodePtr node);
|
||||
//needed for test access as well as internal use.
|
||||
extern "C"
|
||||
{
|
||||
KvpFrame* dom_tree_to_kvp_frame(xmlNodePtr node);
|
||||
}
|
||||
KvpFrame* dom_tree_to_kvp_frame(xmlNodePtr node);
|
||||
|
||||
static KvpValue*
|
||||
dom_tree_to_list_kvp_value(xmlNodePtr node)
|
||||
|
||||
@@ -23,18 +23,16 @@
|
||||
|
||||
#ifndef SIXTP_DOM_PARSERS_H
|
||||
#define SIXTP_DOM_PARSERS_H
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
#include "qof.h"
|
||||
#include "gnc-budget.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
|
||||
GncGUID* dom_tree_to_guid(xmlNodePtr node);
|
||||
|
||||
@@ -78,7 +76,4 @@ gboolean dom_tree_generic_parse(xmlNodePtr node,
|
||||
struct dom_tree_handler *handlers,
|
||||
gpointer data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _SIXTP_DOM_PARSERS_H_ */
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
}
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-stack.h"
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
|
||||
#ifndef SIXTP_STACK_H
|
||||
#define SIXTP_STACK_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <glib.h>
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
|
||||
|
||||
@@ -20,12 +20,14 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <ctype.h>
|
||||
}
|
||||
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
@@ -84,7 +86,7 @@ dom_fail_handler(gpointer data_for_children,
|
||||
gpointer *result,
|
||||
const gchar *tag)
|
||||
{
|
||||
if (*result) xmlFreeNode(*result);
|
||||
if (*result) xmlFreeNode(static_cast<xmlNodePtr>(*result));
|
||||
}
|
||||
|
||||
static gboolean dom_chars_handler(
|
||||
@@ -22,7 +22,8 @@
|
||||
********************************************************************/
|
||||
|
||||
#define __EXTENSIONS__
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -31,8 +32,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -42,6 +41,10 @@
|
||||
#endif
|
||||
#include <gnc-date.h>
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-utils.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
|
||||
#ifndef SIXTP_UTILS_H
|
||||
#define SIXTP_UTILS_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "qof.h"
|
||||
|
||||
}
|
||||
#include "sixtp.h"
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -34,6 +35,7 @@
|
||||
typedef int ssize_t;
|
||||
# define g_fopen fopen
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-parsers.h"
|
||||
@@ -175,7 +177,7 @@ sixtp_set_any(sixtp *tochange, int cleanup, ...)
|
||||
|
||||
do
|
||||
{
|
||||
type = va_arg(ap, sixtp_handler_type);
|
||||
type = static_cast<decltype(type)>(va_arg(ap, int));
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -397,17 +399,20 @@ sixtp_sax_start_handler(void *user_data,
|
||||
|
||||
/* Use an extended lookup so we can get *our* copy of the key.
|
||||
Since we've strduped it, we know its lifetime... */
|
||||
lookup_success = g_hash_table_lookup_extended(current_parser->child_parsers,
|
||||
name,
|
||||
(gpointer) & next_parser_tag,
|
||||
(gpointer) & next_parser);
|
||||
lookup_success =
|
||||
g_hash_table_lookup_extended(current_parser->child_parsers,
|
||||
name,
|
||||
reinterpret_cast<void**>(&next_parser_tag),
|
||||
reinterpret_cast<void**>(&next_parser));
|
||||
|
||||
|
||||
if (!lookup_success)
|
||||
{
|
||||
/* magic catch all value */
|
||||
lookup_success = g_hash_table_lookup_extended(
|
||||
current_parser->child_parsers, SIXTP_MAGIC_CATCHER,
|
||||
(gpointer) & next_parser_tag, (gpointer) & next_parser);
|
||||
reinterpret_cast<void**>(&next_parser_tag),
|
||||
reinterpret_cast<void**>(&next_parser));
|
||||
if (!lookup_success)
|
||||
{
|
||||
g_critical("Tag <%s> not allowed in current context.",
|
||||
@@ -427,8 +432,7 @@ sixtp_sax_start_handler(void *user_data,
|
||||
/* we're not in the top level node */
|
||||
sixtp_stack_frame *parent_frame =
|
||||
(sixtp_stack_frame *) pdata->stack->next->data;
|
||||
parent_data_from_children = parent_frame->data_from_children;
|
||||
parent_data_from_children = parent_frame->data_for_children;
|
||||
parent_data_from_children = static_cast<decltype(parent_data_from_children)>(parent_frame->data_from_children);
|
||||
}
|
||||
|
||||
pdata->parsing_ok &=
|
||||
@@ -582,8 +586,7 @@ sixtp_sax_end_handler(void *user_data, const xmlChar *name)
|
||||
/* we're not in the top level node */
|
||||
sixtp_stack_frame *parent_frame =
|
||||
(sixtp_stack_frame *) pdata->stack->next->data;
|
||||
parent_data_from_children = parent_frame->data_from_children;
|
||||
parent_data_from_children = parent_frame->data_for_children;
|
||||
parent_data_from_children = static_cast<decltype(parent_data_from_children)>(parent_frame->data_for_children);
|
||||
}
|
||||
|
||||
pdata->parsing_ok &=
|
||||
@@ -765,7 +768,7 @@ static int
|
||||
sixtp_parser_read(void *context, char *buffer, int len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
ret = fread(&buffer[0], sizeof(char), len, (FILE *) context);
|
||||
if (ret < 0)
|
||||
g_warning("Error reading XML file");
|
||||
@@ -780,8 +783,8 @@ sixtp_parse_fd(sixtp *sixtp,
|
||||
gpointer *parse_result)
|
||||
{
|
||||
gboolean ret;
|
||||
xmlParserCtxtPtr context = xmlCreateIOParserCtxt( NULL, NULL,
|
||||
sixtp_parser_read, NULL /*no close */, fd,
|
||||
xmlParserCtxtPtr context = xmlCreateIOParserCtxt( NULL, NULL,
|
||||
sixtp_parser_read, NULL /*no close */, fd,
|
||||
XML_CHAR_ENCODING_NONE);
|
||||
ret = sixtp_parse_file_common(sixtp, context, data_for_top_level,
|
||||
global_data, parse_result);
|
||||
@@ -989,4 +992,13 @@ gnc_is_our_first_xml_chunk(char *chunk, gboolean *with_encoding)
|
||||
return GNC_BOOK_NOT_OURS;
|
||||
}
|
||||
|
||||
void
|
||||
sixtp_run_callback(sixtp_gdv2 *data, const char *type)
|
||||
{
|
||||
if (data->countCallback)
|
||||
{
|
||||
data->countCallback(data, type);
|
||||
}
|
||||
}
|
||||
|
||||
/************************* END OF FILE *********************************/
|
||||
@@ -23,16 +23,52 @@
|
||||
|
||||
#ifndef SIXTP_H
|
||||
#define SIXTP_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-engine.h"
|
||||
}
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-backend-xml.h"
|
||||
|
||||
typedef struct sixtp_gdv2 sixtp_gdv2;
|
||||
typedef void (*countCallbackFn)(sixtp_gdv2 *gd, const char *type);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int accounts_total;
|
||||
int accounts_loaded;
|
||||
|
||||
int books_total;
|
||||
int books_loaded;
|
||||
|
||||
int commodities_total;
|
||||
int commodities_loaded;
|
||||
|
||||
int transactions_total;
|
||||
int transactions_loaded;
|
||||
|
||||
int prices_total;
|
||||
int prices_loaded;
|
||||
|
||||
int schedXactions_total;
|
||||
int schedXactions_loaded;
|
||||
|
||||
int budgets_total;
|
||||
int budgets_loaded;
|
||||
} load_counter;
|
||||
|
||||
struct sixtp_gdv2
|
||||
{
|
||||
QofBook *book;
|
||||
load_counter counter;
|
||||
countCallbackFn countCallback;
|
||||
QofBePercentageFunc gui_display_fn;
|
||||
gboolean exporting;
|
||||
};
|
||||
typedef struct _sixtp_child_result sixtp_child_result;
|
||||
|
||||
typedef gboolean (*sixtp_start_handler)(GSList* sibling_data,
|
||||
@@ -44,23 +80,23 @@ typedef gboolean (*sixtp_start_handler)(GSList* sibling_data,
|
||||
gchar **attrs);
|
||||
|
||||
typedef gboolean (*sixtp_before_child_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);
|
||||
GSList* data_from_children,
|
||||
GSList* sibling_data,
|
||||
gpointer parent_data,
|
||||
gpointer global_data,
|
||||
gpointer *result,
|
||||
const gchar *tag,
|
||||
const gchar *child_tag);
|
||||
|
||||
typedef gboolean (*sixtp_after_child_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,
|
||||
sixtp_child_result *child_result);
|
||||
GSList* data_from_children,
|
||||
GSList* sibling_data,
|
||||
gpointer parent_data,
|
||||
gpointer global_data,
|
||||
gpointer *result,
|
||||
const gchar *tag,
|
||||
const gchar *child_tag,
|
||||
sixtp_child_result *child_result);
|
||||
|
||||
typedef gboolean (*sixtp_end_handler)(gpointer data_for_children,
|
||||
GSList* data_from_children,
|
||||
@@ -71,11 +107,11 @@ typedef gboolean (*sixtp_end_handler)(gpointer data_for_children,
|
||||
const gchar *tag);
|
||||
|
||||
typedef gboolean (*sixtp_characters_handler)(GSList *sibling_data,
|
||||
gpointer parent_data,
|
||||
gpointer global_data,
|
||||
gpointer *result,
|
||||
const char *text,
|
||||
int length);
|
||||
gpointer parent_data,
|
||||
gpointer global_data,
|
||||
gpointer *result,
|
||||
const char *text,
|
||||
int length);
|
||||
|
||||
typedef void (*sixtp_result_handler)(sixtp_child_result *result);
|
||||
|
||||
@@ -163,9 +199,23 @@ typedef struct sixtp_sax_data
|
||||
sixtp *bad_xml_parser;
|
||||
} sixtp_sax_data;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int version; /* backend version number */
|
||||
const char * type_name; /* The XML tag for this type */
|
||||
|
||||
sixtp * (*create_parser) (void);
|
||||
gboolean (*add_item)(sixtp_gdv2 *, gpointer obj);
|
||||
int (*get_count) (QofBook *);
|
||||
gboolean (*write) (FILE*, QofBook*);
|
||||
void (*scrub) (QofBook *);
|
||||
gboolean (*ns) (FILE*);
|
||||
} GncXmlDataType_t;
|
||||
|
||||
|
||||
|
||||
gboolean is_child_result_from_node_named(sixtp_child_result *cr,
|
||||
const char *tag);
|
||||
const char *tag);
|
||||
void sixtp_child_free_data(sixtp_child_result *result);
|
||||
void sixtp_child_result_destroy(sixtp_child_result *r);
|
||||
void sixtp_child_result_print(sixtp_child_result *cr, FILE *f);
|
||||
@@ -216,6 +266,7 @@ QofBookFileType gnc_is_our_xml_file(const char *filename,
|
||||
gboolean *with_encoding);
|
||||
|
||||
QofBookFileType gnc_is_our_first_xml_chunk(char *chunk, gboolean *with_encoding);
|
||||
|
||||
/** Call after loading each record */
|
||||
void sixtp_run_callback(sixtp_gdv2 *data, const char *type);
|
||||
|
||||
#endif /* _SIXTP_H_ */
|
||||
|
||||
@@ -4,33 +4,40 @@ SUBDIRS = test-files
|
||||
test_date_converting_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-date-converting.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-date-converting.cpp
|
||||
|
||||
test_dom_converters1_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-dom-converters1.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-dom-converters1.cpp
|
||||
|
||||
test_kvp_frames_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-kvp-frames.cpp
|
||||
|
||||
test_load_backend_SOURCES = \
|
||||
test-load-backend.cpp
|
||||
test_load_xml2_SOURCES = \
|
||||
test-load-xml2.cpp
|
||||
test_save_in_lang_SOURCES = \
|
||||
test-save-in-lang.cpp
|
||||
|
||||
# the xml backend is now a GModule - this test does
|
||||
# not load it as a module and cannot link to it
|
||||
# and remain portable.
|
||||
@@ -38,151 +45,151 @@ test_kvp_frames_SOURCES = \
|
||||
test_load_example_account_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/io-example-account.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-load-example-account.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-example-account.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-load-example-account.cpp
|
||||
|
||||
test_string_converters_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-string-converters.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-string-converters.cpp
|
||||
|
||||
test_xml_account_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-xml-account.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-xml-account.cpp
|
||||
|
||||
test_xml_commodity_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-xml-commodity.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-xml-commodity.cpp
|
||||
|
||||
test_xml_pricedb_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-xml-pricedb.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-xml-pricedb.cpp
|
||||
|
||||
test_xml_transaction_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-xml-transaction.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-xml-transaction.cpp
|
||||
|
||||
test_xml2_is_file_SOURCES = \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-parsers.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-dom-generators.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.c \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.c \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.c \
|
||||
${top_srcdir}/src/backend/xml/io-utils.c \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.c \
|
||||
test-xml2-is-file.c
|
||||
${top_srcdir}/src/backend/xml/sixtp-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-stack.cpp \
|
||||
${top_srcdir}/src/backend/xml/sixtp-to-dom-parser.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-account-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-budget-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-lot-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-recurrence-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-schedxaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-freqspec-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-transaction-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-commodity-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-book-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-pricedb-xml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-gen.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-gncxml-v2.cpp \
|
||||
${top_srcdir}/src/backend/xml/io-utils.cpp \
|
||||
${top_srcdir}/src/backend/xml/gnc-xml-helper.cpp \
|
||||
test-xml2-is-file.cpp
|
||||
|
||||
TESTS = \
|
||||
test-date-converting \
|
||||
@@ -271,8 +278,8 @@ AM_CPPFLAGS = \
|
||||
|
||||
EXTRA_DIST = \
|
||||
grab-types.pl \
|
||||
test-dom-parser1.c \
|
||||
test-dom-parser1.cpp \
|
||||
test-real-data.sh \
|
||||
test-xml2-is-file.c
|
||||
test-xml2-is-file.cpp
|
||||
|
||||
AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.backend.xml\"
|
||||
|
||||
@@ -18,15 +18,17 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
}
|
||||
|
||||
#include "test-file-stuff.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -33,16 +34,17 @@
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
#include "cashobjects.h"
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-commodity.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
|
||||
#define GNC_V2_STRING "gnc-v2"
|
||||
const gchar *gnc_v2_xml_version_string = GNC_V2_STRING;
|
||||
|
||||
@@ -172,10 +174,10 @@ test_dom_tree_to_timespec(void)
|
||||
}
|
||||
}
|
||||
|
||||
static gchar *
|
||||
static const char *
|
||||
test_gnc_nums_internal(gnc_numeric to_test)
|
||||
{
|
||||
gchar *ret = NULL;
|
||||
const char *ret = NULL;
|
||||
gnc_numeric *to_compare = NULL;
|
||||
xmlNodePtr to_gen = NULL;
|
||||
|
||||
@@ -219,18 +221,16 @@ test_dom_tree_to_gnc_numeric(void)
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
gchar *message = NULL;
|
||||
|
||||
message = test_gnc_nums_internal(get_random_gnc_numeric(GNC_DENOM_AUTO));
|
||||
const char *message =
|
||||
test_gnc_nums_internal(get_random_gnc_numeric(GNC_DENOM_AUTO));
|
||||
|
||||
do_test_args(message == NULL, "dom_tree_to_gnc_numeric",
|
||||
__FILE__, __LINE__, message);
|
||||
}
|
||||
|
||||
{
|
||||
gchar *message = NULL;
|
||||
|
||||
message = test_gnc_nums_internal
|
||||
const char *message = test_gnc_nums_internal
|
||||
(gnc_numeric_create(18768786810LL, 100000));
|
||||
|
||||
do_test_args(message == NULL, "gnc_num 18768786810/100000",
|
||||
@@ -17,7 +17,8 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -26,6 +27,7 @@
|
||||
#include <glib.h>
|
||||
|
||||
#include "test-stuff.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "sixtp.h"
|
||||
@@ -20,8 +20,6 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
#include <kvp_frame.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
@@ -37,10 +35,13 @@ extern "C"
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "test-stuff.h"
|
||||
}
|
||||
|
||||
#include "test-file-stuff.h"
|
||||
#include <kvp_frame.hpp>
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "test-file-stuff.h"
|
||||
#include "test-stuff.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "sixtp-utils.h"
|
||||
/*
|
||||
@@ -49,7 +50,6 @@ extern "C"
|
||||
/***********************************************************************/
|
||||
|
||||
extern KvpFrame* dom_tree_to_kvp_frame(xmlNodePtr node);
|
||||
}
|
||||
|
||||
static int
|
||||
files_return(int ret, const char* msg)
|
||||
@@ -118,7 +118,7 @@ print_dom_tree(gpointer data_for_children, GSList* data_from_children,
|
||||
}
|
||||
|
||||
gboolean
|
||||
check_dom_tree_version(xmlNodePtr node, gchar *verstr)
|
||||
check_dom_tree_version(xmlNodePtr node, const char *verstr)
|
||||
{
|
||||
char *verteststr;
|
||||
|
||||
|
||||
@@ -24,14 +24,13 @@
|
||||
|
||||
#ifndef TEST_FILE_STUFF_H
|
||||
#define TEST_FILE_STUFF_H
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
#include <gnc-commodity.h>
|
||||
#include <gnc-engine.h>
|
||||
}
|
||||
#include <gnc-xml-helper.h>
|
||||
#include <io-gncxml-gen.h>
|
||||
#include <sixtp.h>
|
||||
@@ -51,7 +50,7 @@ gboolean print_dom_tree(gpointer data_for_children, GSList* data_from_children,
|
||||
const gchar *tag);
|
||||
|
||||
/**/
|
||||
gboolean check_dom_tree_version(xmlNodePtr node, gchar *verstr);
|
||||
gboolean check_dom_tree_version(xmlNodePtr node, const char *verstr);
|
||||
gboolean equals_node_val_vs_string(xmlNodePtr node, const gchar* str);
|
||||
gboolean equals_node_val_vs_guid(xmlNodePtr node, const GncGUID *id);
|
||||
gboolean equals_node_val_vs_commodity(xmlNodePtr node,
|
||||
@@ -65,7 +64,4 @@ void
|
||||
test_files_in_dir(int argc, char **argv, gxpf_callback cb,
|
||||
sixtp *parser, const char *parser_tag,
|
||||
QofBook *book);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -8,17 +8,17 @@ extern "C"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
#include "qof.h"
|
||||
}
|
||||
|
||||
#include "test-file-stuff.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
|
||||
#define GNC_V2_STRING "gnc-v2"
|
||||
const gchar *gnc_v2_xml_version_string = GNC_V2_STRING;
|
||||
extern KvpFrame* dom_tree_to_kvp_frame(xmlNodePtr node);
|
||||
}
|
||||
|
||||
static void
|
||||
test_kvp_get_slot(int run,
|
||||
|
||||
@@ -24,11 +24,13 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
#include "qof.h"
|
||||
#include "cashobjects.h"
|
||||
#include "test-stuff.h"
|
||||
}
|
||||
|
||||
#define GNC_LIB_NAME "gncmod-backend-xml"
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
#include <libguile.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -34,14 +34,16 @@
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
}
|
||||
|
||||
#include <libguile.h>
|
||||
#include "test-file-stuff.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "io-example-account.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
static const gchar *da_ending = ".gnucash-xea";
|
||||
|
||||
static void
|
||||
@@ -25,7 +25,8 @@
|
||||
/* @file test-load-xml2.c
|
||||
* @brief test the loading of a version-2 gnucash XML file
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
@@ -40,14 +41,16 @@
|
||||
#include <cashobjects.h>
|
||||
#include <TransLog.h>
|
||||
#include <gnc-engine.h>
|
||||
#include "../gnc-backend-xml.h"
|
||||
#include "../io-gncxml-v2.h"
|
||||
#include <gnc-prefs.h>
|
||||
|
||||
#include <test-stuff.h>
|
||||
#include <unittest-support.h>
|
||||
#include <test-engine-stuff.h>
|
||||
#include <test-file-stuff.h>
|
||||
}
|
||||
|
||||
#include "../gnc-backend-xml.h"
|
||||
#include "../io-gncxml-v2.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
#define GNC_LIB_NAME "gncmod-backend-xml"
|
||||
|
||||
@@ -81,9 +84,9 @@ test_load_file(const char *filename)
|
||||
QofBook *book;
|
||||
Account *root;
|
||||
gboolean ignore_lock;
|
||||
gchar *logdomain = "backend.xml";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||
TestErrorStruct check = { loglevel, logdomain, NULL };
|
||||
const char *logdomain = "backend.xml";
|
||||
GLogLevelFlags loglevel = static_cast<decltype(loglevel)>(G_LOG_LEVEL_WARNING);
|
||||
TestErrorStruct check = { loglevel, const_cast<char*>(logdomain), NULL };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
@@ -35,7 +36,7 @@
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "TransLog.h"
|
||||
|
||||
}
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
const char *possible_envs[] =
|
||||
@@ -17,24 +17,26 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
|
||||
#include "gnc-engine.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
}
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "sixtp-dom-generators.h"
|
||||
|
||||
|
||||
#define GNC_V2_STRING "gnc-v2"
|
||||
const gchar *gnc_v2_xml_version_string = GNC_V2_STRING;
|
||||
|
||||
static char *test_strings[] =
|
||||
static const char *test_strings[] =
|
||||
{
|
||||
"FooBar",
|
||||
"<Ugly crap>",
|
||||
@@ -47,16 +49,13 @@ static char *test_strings[] =
|
||||
static void
|
||||
test_string_converters(void)
|
||||
{
|
||||
char *mark;
|
||||
int i;
|
||||
|
||||
for (i = 0, mark = test_strings[i]; mark; i++, mark = test_strings[i])
|
||||
for (i = 0; test_strings[i]; ++i)
|
||||
{
|
||||
xmlNodePtr test_node;
|
||||
gchar *backout;
|
||||
test_node = text_to_dom_tree("test-string", mark);
|
||||
|
||||
backout = dom_tree_to_text(test_node);
|
||||
const char *mark = test_strings[i];
|
||||
xmlNodePtr test_node = text_to_dom_tree("test-string", mark);
|
||||
char *backout = dom_tree_to_text(test_node);
|
||||
|
||||
do_test_args(
|
||||
g_strcmp0(backout, mark) == 0,
|
||||
@@ -67,12 +66,11 @@ test_string_converters(void)
|
||||
static void
|
||||
test_bad_string (void)
|
||||
{
|
||||
gchar *badstr = "foo\abar";
|
||||
gchar *sanitized = "foo?bar";
|
||||
gchar *backout;
|
||||
const char *badstr = "foo\abar";
|
||||
const char *sanitized = "foo?bar";
|
||||
xmlNodePtr test_node = text_to_dom_tree ("test-string", badstr);
|
||||
|
||||
backout = dom_tree_to_text (test_node);
|
||||
char *backout = dom_tree_to_text (test_node);
|
||||
do_test_args (g_strcmp0 (backout, sanitized) == 0,
|
||||
"string sanitizing", __FILE__, __LINE__,
|
||||
"with string %s", badstr);
|
||||
@@ -21,28 +21,30 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../gnc-xml-helper.h"
|
||||
#include "../gnc-xml.h"
|
||||
#include <gnc-engine.h>
|
||||
#include <cashobjects.h>
|
||||
#include "../sixtp-parsers.h"
|
||||
#include "../sixtp-dom-parsers.h"
|
||||
|
||||
#include <test-stuff.h>
|
||||
#include <test-engine-stuff.h>
|
||||
#include <test-file-stuff.h>
|
||||
#include <unittest-support.h>
|
||||
|
||||
#include "Account.h"
|
||||
#include "Scrub.h"
|
||||
}
|
||||
|
||||
#include "../gnc-xml-helper.h"
|
||||
#include "../gnc-xml.h"
|
||||
#include "../sixtp-parsers.h"
|
||||
#include "../sixtp-dom-parsers.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
static QofBook *sixbook;
|
||||
|
||||
@@ -88,7 +90,7 @@ node_and_account_equal(xmlNodePtr node, Account *act)
|
||||
else if (g_strcmp0((char*)mark->name, "act:type") == 0)
|
||||
{
|
||||
gchar *txt;
|
||||
int type;
|
||||
GNCAccountType type;
|
||||
|
||||
txt = dom_tree_to_text(mark);
|
||||
|
||||
@@ -208,7 +210,7 @@ typedef struct act_data_struct act_data;
|
||||
static gboolean
|
||||
test_add_account(const char *tag, gpointer globaldata, gpointer data)
|
||||
{
|
||||
Account *account = data;
|
||||
Account *account = static_cast<decltype(account)>(data);
|
||||
act_data *gdata = (act_data*)globaldata;
|
||||
gnc_commodity * com;
|
||||
gnc_commodity * new_com;
|
||||
@@ -320,10 +322,11 @@ test_generation()
|
||||
{
|
||||
/* empty some things. */
|
||||
Account *act;
|
||||
gchar *msg = "xaccAccountSetCommodity: assertion `GNC_IS_COMMODITY(com)' failed";
|
||||
gchar *logdomain = "gnc.engine";
|
||||
guint loglevel = G_LOG_LEVEL_CRITICAL;
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
const char *msg = "xaccAccountSetCommodity: assertion `GNC_IS_COMMODITY(com)' failed";
|
||||
const char *logdomain = "gnc.engine";
|
||||
GLogLevelFlags loglevel = static_cast<decltype(loglevel)>(G_LOG_LEVEL_CRITICAL);
|
||||
TestErrorStruct check = { loglevel, const_cast<char*>(logdomain),
|
||||
const_cast<char*>(msg) };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -26,26 +27,24 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "qof.h"
|
||||
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
|
||||
#include "io-gncxml-gen.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
#include "Account.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-utils.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "io-gncxml-gen.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
static QofBook *book;
|
||||
|
||||
static gchar*
|
||||
static const char*
|
||||
node_and_commodity_equal(xmlNodePtr node, const gnc_commodity *com)
|
||||
{
|
||||
xmlNodePtr mark;
|
||||
@@ -180,7 +179,6 @@ test_generation(void)
|
||||
xmlNodePtr test_node;
|
||||
gchar *filename1;
|
||||
int fd;
|
||||
gchar *compare_msg;
|
||||
|
||||
ran_com = get_random_commodity(book);
|
||||
|
||||
@@ -192,9 +190,8 @@ test_generation(void)
|
||||
gnc_commodity_destroy(ran_com);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((compare_msg = node_and_commodity_equal(test_node, ran_com)) !=
|
||||
NULL)
|
||||
auto compare_msg = node_and_commodity_equal(test_node, ran_com);
|
||||
if (compare_msg != nullptr)
|
||||
{
|
||||
failure_args("commodity_xml", __FILE__, __LINE__,
|
||||
"node and commodity were not equal: %s", compare_msg);
|
||||
@@ -21,7 +21,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -29,19 +30,21 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "cashobjects.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-pricedb.h"
|
||||
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-file-stuff.h"
|
||||
}
|
||||
|
||||
#include "gnc-xml-helper.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "sixtp.h"
|
||||
#include "sixtp-parsers.h"
|
||||
#include "sixtp-dom-parsers.h"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
static QofSession *session;
|
||||
static int iter;
|
||||
@@ -49,10 +52,11 @@ static int iter;
|
||||
static gboolean
|
||||
test_add_pricedb (const char *tag, gpointer globaldata, gpointer data)
|
||||
{
|
||||
sixtp_gdv2 *gdata = globaldata;
|
||||
GNCPriceDB *db = gnc_pricedb_get_db (gdata->book);
|
||||
sixtp_gdv2 *gdata = static_cast<decltype(gdata)>(globaldata);
|
||||
GNCPriceDB *db1 = static_cast<decltype(db1)>(data);
|
||||
GNCPriceDB *db2 = gnc_pricedb_get_db (gdata->book);
|
||||
|
||||
do_test_args (gnc_pricedb_equal(data, db),
|
||||
do_test_args (gnc_pricedb_equal(db1, db2),
|
||||
"gnc_pricedb_sixtp_parser_create",
|
||||
__FILE__, __LINE__, "%d", iter);
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -33,24 +34,25 @@
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "../gnc-xml-helper.h"
|
||||
#include "../gnc-xml.h"
|
||||
#include <gnc-engine.h>
|
||||
#include <cashobjects.h>
|
||||
#include "../sixtp-parsers.h"
|
||||
|
||||
#include "../sixtp-dom-parsers.h"
|
||||
#include <TransLog.h>
|
||||
#include "../io-gncxml-gen.h"
|
||||
|
||||
#include <test-stuff.h>
|
||||
#include <test-engine-stuff.h>
|
||||
#include <test-file-stuff.h>
|
||||
#include <unittest-support.h>
|
||||
|
||||
#include <AccountP.h>
|
||||
#include <Transaction.h>
|
||||
#include <TransactionP.h>
|
||||
}
|
||||
|
||||
#include "../gnc-xml-helper.h"
|
||||
#include "../gnc-xml.h"
|
||||
#include "../sixtp-parsers.h"
|
||||
#include "../sixtp-dom-parsers.h"
|
||||
#include "../io-gncxml-gen.h"
|
||||
#include <test-file-stuff.h>
|
||||
|
||||
static QofBook *book;
|
||||
|
||||
@@ -102,7 +104,7 @@ find_appropriate_node(xmlNodePtr node, Split *spl)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
equals_node_val_vs_split_internal(xmlNodePtr node, Split* spl)
|
||||
{
|
||||
xmlNodePtr mark;
|
||||
@@ -199,12 +201,11 @@ equals_node_val_vs_split_internal(xmlNodePtr node, Split* spl)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
equals_node_val_vs_splits(xmlNodePtr node, const Transaction *trn)
|
||||
{
|
||||
xmlNodePtr spl_node;
|
||||
Split *spl_mark;
|
||||
char *msg;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail(node, FALSE);
|
||||
@@ -224,7 +225,7 @@ equals_node_val_vs_splits(xmlNodePtr node, const Transaction *trn)
|
||||
return "no matching split found";
|
||||
}
|
||||
|
||||
msg = equals_node_val_vs_split_internal(spl_node, spl_mark);
|
||||
const char *msg = equals_node_val_vs_split_internal(spl_node, spl_mark);
|
||||
if (msg != NULL)
|
||||
{
|
||||
return msg;
|
||||
@@ -234,7 +235,7 @@ equals_node_val_vs_splits(xmlNodePtr node, const Transaction *trn)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gchar*
|
||||
static const char*
|
||||
node_and_transaction_equal(xmlNodePtr node, Transaction *trn)
|
||||
{
|
||||
xmlNodePtr mark;
|
||||
@@ -315,7 +316,7 @@ node_and_transaction_equal(xmlNodePtr node, Transaction *trn)
|
||||
}
|
||||
else if (g_strcmp0((char*)mark->name, "trn:splits") == 0)
|
||||
{
|
||||
char *msg = equals_node_val_vs_splits (mark, trn);
|
||||
const char *msg = equals_node_val_vs_splits (mark, trn);
|
||||
if (msg != NULL)
|
||||
{
|
||||
return msg;
|
||||
@@ -350,8 +351,8 @@ typedef struct tran_data_struct tran_data;
|
||||
static gboolean
|
||||
test_add_transaction(const char *tag, gpointer globaldata, gpointer data)
|
||||
{
|
||||
Transaction *trans = data;
|
||||
tran_data *gdata = (tran_data*)globaldata;
|
||||
Transaction *trans = static_cast<decltype(trans)>(data);
|
||||
tran_data *gdata = static_cast<decltype(gdata)>(globaldata);
|
||||
gboolean retval = TRUE;
|
||||
|
||||
xaccTransBeginEdit (trans);
|
||||
@@ -379,7 +380,6 @@ test_transaction(void)
|
||||
Transaction *ran_trn;
|
||||
xmlNodePtr test_node;
|
||||
gnc_commodity *com, *new_com;
|
||||
gchar *compare_msg;
|
||||
gchar *filename1;
|
||||
int fd;
|
||||
|
||||
@@ -401,7 +401,7 @@ test_transaction(void)
|
||||
GList * node = list;
|
||||
for ( ; node; node = node->next)
|
||||
{
|
||||
Split * s = node->data;
|
||||
Split * s = static_cast<decltype(s)>(node->data);
|
||||
Account * a = xaccMallocAccount(book);
|
||||
|
||||
xaccAccountBeginEdit (a);
|
||||
@@ -423,9 +423,8 @@ test_transaction(void)
|
||||
really_get_rid_of_transaction(ran_trn);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((compare_msg = node_and_transaction_equal(test_node, ran_trn)) !=
|
||||
NULL)
|
||||
auto compare_msg = node_and_transaction_equal(test_node, ran_trn);
|
||||
if (compare_msg != nullptr)
|
||||
{
|
||||
failure_args("transaction_xml", __FILE__, __LINE__,
|
||||
"node and transaction were not equal: %s",
|
||||
@@ -454,7 +453,7 @@ test_transaction(void)
|
||||
GList * node = xaccTransGetSplitList (ran_trn);
|
||||
for ( ; node; node = node->next)
|
||||
{
|
||||
Split * s = node->data;
|
||||
Split * s = static_cast<decltype(s)>(node->data);
|
||||
Account * a1 = xaccSplitGetAccount(s);
|
||||
Account * a2 = xaccMallocAccount(book);
|
||||
|
||||
@@ -469,10 +468,11 @@ test_transaction(void)
|
||||
sixtp *parser;
|
||||
tran_data data;
|
||||
|
||||
gchar *msg = "[xaccAccountScrubCommodity()] Account \"\" does not have a commodity!";
|
||||
gchar *logdomain = "gnc.engine.scrub";
|
||||
guint loglevel = G_LOG_LEVEL_CRITICAL;
|
||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||
const char *msg = "[xaccAccountScrubCommodity()] Account \"\" does not have a commodity!";
|
||||
const char *logdomain = "gnc.engine.scrub";
|
||||
GLogLevelFlags loglevel = static_cast<decltype(loglevel)>(G_LOG_LEVEL_CRITICAL);
|
||||
TestErrorStruct check = { loglevel, const_cast<char*>(logdomain),
|
||||
const_cast<char*>(msg) };
|
||||
g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
data.trn = ran_trn;
|
||||
@@ -487,11 +487,11 @@ test_transaction(void)
|
||||
__FILE__, __LINE__, "%d", i);
|
||||
}
|
||||
else
|
||||
really_get_rid_of_transaction (data.new_trn);
|
||||
|
||||
/* no handling of circular data structures. We'll do that later */
|
||||
/* sixtp_destroy(parser); */
|
||||
really_get_rid_of_transaction(data.new_trn);
|
||||
}
|
||||
/* no handling of circular data structures. We'll do that later */
|
||||
/* sixtp_destroy(parser); */
|
||||
|
||||
|
||||
g_unlink(filename1);
|
||||
g_free(filename1);
|
||||
@@ -17,15 +17,17 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "config.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "io-gncxml-v2.h"
|
||||
|
||||
#include "test-stuff.h"
|
||||
#include "test-engine-stuff.h"
|
||||
}
|
||||
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "test-file-stuff.h"
|
||||
|
||||
#define FILENAME "Money95bank_fr.gml2"
|
||||
@@ -34,14 +36,13 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
const char *directory = g_getenv("GNC_TEST_FILES");
|
||||
char *filename;
|
||||
|
||||
if (!directory)
|
||||
{
|
||||
directory = "test-files/xml2";
|
||||
}
|
||||
|
||||
filename = malloc(strlen(directory) + 1 + strlen(FILENAME) + 1);
|
||||
char *filename = static_cast<decltype(filename)>(malloc(strlen(directory) + 1 + strlen(FILENAME) + 1));
|
||||
sprintf(filename, "%s/%s", directory, FILENAME);
|
||||
do_test(gnc_is_xml_data_file_v2(filename, NULL), "gnc_is_xml_data_file_v2");
|
||||
|
||||
@@ -1403,4 +1403,3 @@ gxi_selected_enc_activated_cb (GtkTreeView *view, GtkTreePath *path,
|
||||
return;
|
||||
gxi_remove_encoding (data, model, &iter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user