aboutsummaryrefslogtreecommitdiffstats
path: root/membuffer.c
AgeCommit message (Collapse)Author
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Clean up membuffer internal structure names, add strip functionGravatar Linus Torvalds
The "size" member was confusing - it's the size of the allocation, not the size of the current string. The size of the current string is the member called "used". This naming makes perfect sense for the internal implementation, but it's confusing to users who actually do want to get the size of the resulting string at the end. So rename the fields to "alloc" and "len" - which is pretty clear. This also adds a helper function to strip whitespace from the end: "strip_mb()". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Save XML files into a memory buffer rather than directly into a fileGravatar Linus Torvalds
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>