Date: Tue, 5 Feb 2013 15:46:43 -0500 From: John Baldwin <jhb@freebsd.org> To: current@freebsd.org Subject: [PATCH] open_memstream() and open_wmemstream() Message-ID: <201302051546.43839.jhb@freebsd.org>
next in thread | raw e-mail | index | archive | help
I've written an implementation of open_memstream() and open_wmemstream() along with a set of regression tests. I'm pretty sure open_memstream() is correct, and I believe open_wmemstream() is correct for expected usage. The latter might even do the right thing if you split a multi-byte character across multiple writes. One question I have is if my choice to discard any pending multi-byte state in the stream anytime a seek changes the effective position in the output stream. I think this is correct as stdio will flush any pending data before doing a seek, so if there is a partially parsed character we aren't going to get the rest of it. http://www.FreeBSD.org/~jhb/patches/open_memstream.patch -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302051546.43839.jhb>