mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
minor fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3426 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* ultra super reudimentary right now
|
||||
* this will be very very different in fianl verisn
|
||||
* this will be very very different in final verisn
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -72,6 +72,11 @@ typedef enum
|
||||
|
||||
extern gncLogLevel loglevel[MOD_LAST + 1];
|
||||
|
||||
/* FIXME: these logging functions should proably get replaced by
|
||||
* the glib.h g_error(), etc functions. That way, we would have
|
||||
* unified logging mechanism, instead of having some messages
|
||||
* work one way, and other a different way ...
|
||||
*/
|
||||
void gnc_log (gncModuleType module, gncLogLevel log_level,
|
||||
const char *prefix, const char *function_name,
|
||||
const char *format, ...) G_GNUC_PRINTF(5,6);
|
||||
|
||||
@@ -1100,7 +1100,7 @@ gncxml_new_query_doc (Query *q)
|
||||
/* create a new xml document and poke all account & txn data into it. */
|
||||
|
||||
static xmlDocPtr
|
||||
gncxml_newdoc (AccountGroup *group)
|
||||
gncxml_newdoc (AccountGroup *group, int do_txns)
|
||||
{
|
||||
xmlDocPtr doc;
|
||||
xmlNodePtr ledger_data;
|
||||
@@ -1135,10 +1135,12 @@ gncxml_newdoc (AccountGroup *group)
|
||||
return 0x0;
|
||||
}
|
||||
|
||||
if(!xml_add_txn_and_split_restorers(ledger_data, group)) {
|
||||
PERR ("couldn't txn restore");
|
||||
xmlFreeDoc(doc);
|
||||
return 0x0;
|
||||
if (do_txns) {
|
||||
if(!xml_add_txn_and_split_restorers(ledger_data, group)) {
|
||||
PERR ("couldn't txn restore");
|
||||
xmlFreeDoc(doc);
|
||||
return 0x0;
|
||||
}
|
||||
}
|
||||
|
||||
return doc;
|
||||
@@ -1151,7 +1153,22 @@ gncxml_write_to_buf (AccountGroup *group, char **bufp, int *sz)
|
||||
{
|
||||
xmlDocPtr doc;
|
||||
|
||||
doc = gncxml_newdoc (group);
|
||||
doc = gncxml_newdoc (group, 1);
|
||||
if (!doc) return;
|
||||
|
||||
xmlDocDumpMemory (doc, (xmlChar **)bufp, sz);
|
||||
|
||||
PINFO ("wrote %d bytes", *sz);
|
||||
}
|
||||
|
||||
/* =============================================================== */
|
||||
|
||||
void
|
||||
gncxml_write_group_to_buf (AccountGroup *group, char **bufp, int *sz)
|
||||
{
|
||||
xmlDocPtr doc;
|
||||
|
||||
doc = gncxml_newdoc (group, 0);
|
||||
if (!doc) return;
|
||||
|
||||
xmlDocDumpMemory (doc, (xmlChar **)bufp, sz);
|
||||
@@ -1185,7 +1202,7 @@ gncxml_write(AccountGroup *group, const gchar *filename)
|
||||
|
||||
if (!group || !filename) return FALSE;
|
||||
|
||||
doc = gncxml_newdoc (group);
|
||||
doc = gncxml_newdoc (group, 1);
|
||||
if (!doc) return FALSE;
|
||||
|
||||
xmlIndentTreeOutput = TRUE;
|
||||
|
||||
@@ -44,6 +44,12 @@ gboolean is_gncxml_file(const gchar *name);
|
||||
*/
|
||||
void gncxml_write_to_buf (AccountGroup *group, char **bufp, int *sz);
|
||||
|
||||
/*
|
||||
* write only the account and currency info to the buf, do *not*
|
||||
* write any of the splits or transactions
|
||||
*/
|
||||
void gncxml_write_group_to_buf (AccountGroup *group, char **bufp, int *sz);
|
||||
|
||||
/* write the query terms to memory */
|
||||
void gncxml_write_query_to_buf (Query *q, char **bufp, int *sz);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user