31 #include <glib/gi18n.h> 32 #include <glib/gstdio.h> 41 #include <sys/types.h> 58 # define mktemp _mktemp 64 # define g_fopen fopen 74 # include "strptime.h" 77 #include <gnc-backend-prov.hpp> 79 #include <qof-backend.hpp> 80 #include "gnc-xml-backend.hpp" 81 #include "gnc-xml-helper.h" 85 #include "gnc-address-xml-v2.h" 86 #include "gnc-bill-term-xml-v2.h" 87 #include "gnc-customer-xml-v2.h" 88 #include "gnc-employee-xml-v2.h" 89 #include "gnc-entry-xml-v2.h" 90 #include "gnc-invoice-xml-v2.h" 91 #include "gnc-job-xml-v2.h" 92 #include "gnc-order-xml-v2.h" 93 #include "gnc-owner-xml-v2.h" 94 #include "gnc-tax-table-xml-v2.h" 95 #include "gnc-vendor-xml-v2.h" 97 static QofLogModule log_module = GNC_MOD_BACKEND;
121 QofBookFileType xml_type;
130 t = g_fopen (filename,
"r");
138 rc = g_stat (filename, &sbuf);
144 if (sbuf.st_size == 0)
146 PINFO (
" empty file");
150 xml_type = gnc_is_xml_data_file_v2 (filename, NULL);
151 if ((xml_type == GNC_BOOK_XML2_FILE) ||
152 (xml_type == GNC_BOOK_XML1_FILE) ||
153 (xml_type == GNC_BOOK_POST_XML2_0_0_FILE))
158 PINFO (
" %s is not a gnc XML file", filename);
169 business_core_xml_init (
void)
172 gnc_address_xml_initialize ();
173 gnc_billterm_xml_initialize ();
174 gnc_customer_xml_initialize ();
175 gnc_employee_xml_initialize ();
176 gnc_entry_xml_initialize ();
177 gnc_invoice_xml_initialize ();
178 gnc_job_xml_initialize ();
179 gnc_order_xml_initialize ();
180 gnc_owner_xml_initialize ();
181 gnc_taxtable_xml_initialize ();
182 gnc_vendor_xml_initialize ();
185 #ifndef GNC_NO_LOADABLE_MODULES 196 const char* name {
"GnuCash File Backend Version 2"};
204 business_core_xml_init ();
void gnc_module_init_backend_xml(void)
Initialization function which can be used when this module is statically linked into the application...
#define PINFO(format, args...)
Print an informational note.
void qof_backend_register_provider(QofBackendProvider_ptr &&prov)
Let the system know about a new provider of backends.
gchar * gnc_uri_get_path(const gchar *uri)
Extracts the path part from a uri.
G_MODULE_EXPORT void qof_backend_module_init(void)
This is the standardized initialization function of a qof_backend GModule, but compiling this can be ...
QofBackend * create_backend(void)
Return a new, fully initialized backend.
api for Version 1 XML-based file format
api for GnuCash version 2 XML-based file format
All type declarations for the whole Gnucash engine.
Generic api to store and retrieve preferences.
bool type_check(const char *type)
Distinguish two providers with same access method.
Utility functions for convert uri in separate components and back.
load and save data to files