mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
add file handle interface to docs
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4800 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
8a1d6611c9
commit
442f1e06f9
@ -595,11 +595,9 @@ write_schedXactions( FILE *out, GNCBook *book )
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_book_write_to_xml_file_v2(GNCBook *book, const char *filename)
|
||||
gnc_book_write_to_xml_filehandle_v2(GNCBook *book, FILE *out)
|
||||
{
|
||||
FILE *out;
|
||||
|
||||
out = fopen(filename, "w");
|
||||
if (!out) return FALSE;
|
||||
|
||||
fprintf(out, "<?xml version=\"1.0\"?>\n");
|
||||
fprintf(out, "<" GNC_V2_STRING ">\n");
|
||||
@ -629,6 +627,18 @@ gnc_book_write_to_xml_file_v2(GNCBook *book, const char *filename)
|
||||
write_schedXactions(out, book);
|
||||
|
||||
fprintf(out, "</" GNC_V2_STRING ">\n\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_book_write_to_xml_file_v2(GNCBook *book, const char *filename)
|
||||
{
|
||||
FILE *out;
|
||||
|
||||
out = fopen(filename, "w");
|
||||
gnc_book_write_to_xml_filehandle_v2 (book, out);
|
||||
|
||||
write_emacs_trailer(out);
|
||||
|
||||
if(fclose(out) != 0)
|
||||
|
@ -87,6 +87,7 @@ gboolean gnc_book_load_from_xml_file_v2(
|
||||
void (*countcallback)(const char *type, load_counter count));
|
||||
|
||||
/* write all account info to a file */
|
||||
gboolean gnc_book_write_to_xml_filehandle_v2(GNCBook *book, FILE *fh);
|
||||
gboolean gnc_book_write_to_xml_file_v2(GNCBook *book, const char *filename);
|
||||
|
||||
/* The is_gncxml_file() routine checks to see if the first few
|
||||
|
Loading…
Reference in New Issue
Block a user