open_memstream on non-linux?

Lubomir I. Ivanov neolit123 at gmail.com
Mon Mar 11 10:09:54 PDT 2013


On 11 March 2013 18:19, Dirk Hohndel <dirk at hohndel.org> wrote:
> There is some discussion and code on working around that here…
>
> http://stackoverflow.com/questions/10305095/can-i-replace-a-call-to-open-memstream-with-a-malloc-and-an-implicit-cast
>
> which looks way overkill to me.
>
> Miika - any way you could reimplement this differently? :-)
>

here is my attempt for miika's reference.

it also now, uses ./ for the temp zip file, since obviously /tmp/
isn't portable to non-UNIX OS. instead i would write the temp file in
the home directory, which we should retrieve in a OS specific way
using e.g. subsurface_get_home_path().

i don't think libzip supports API for working with memory buffers.
but on the other hand temp files can be bad...

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DLD-upload-Avoid-using-open_memstream.patch
Type: application/octet-stream
Size: 1741 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130311/21474122/attachment-0001.obj>


More information about the subsurface mailing list