Save XML files into a memory buffer rather than directly into a file

This introduces a "struct membuffer" abstraction that you can write
things into, and makes the XML saving code write to the memory buffer
rather than a file.

The UDDF export already really wanted this: it used to write to a file,
only to then read that file back into memory, delete the file, and then
*rewrite* the file after doing the magic xslt transform.

But the longer-term reason for this is that I want to try to write other
formats, and I want to try to share most helpers.  And those other
formats will need this memory buffer model.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2014-01-16 09:03:11 +07:00 committed by Dirk Hohndel
parent 2e08f75618
commit 96a4fd1bb2
6 changed files with 404 additions and 241 deletions

View file

@ -83,6 +83,7 @@ SOURCES = \
gettextfromc.cpp \
libdivecomputer.c \
main.cpp \
membuffer.c \
parse-xml.c \
planner.c \
profile.c \