dumping libzip

Dirk Hohndel dirk at hohndel.org
Tue Jan 7 15:12:17 UTC 2014


On Wed, 2014-01-08 at 01:07 +0200, Lubomir I. Ivanov wrote:
> >> i think we can.
> >> there is just some basic source code in the lines of "io functions
> >> like fopen", "zipping stuff", "unzipping stuff" and some helper
> >> headers.
> >> we need to include those .o files in our files and simply use the zlib
> >> shared library.
> >
> > Why a shared library? Why not just link them into our executable?
> >
> >> the i/o buffer support from minizip is not part of zlib upstream and
> >> it seems to be only in the minizip upstream.
> >> we technically need that in locations like subsurfacewebservices.cpp
> >> and file.c, but we can still manage to open files instead of buffers.
> >
> > I assumed based on your last set of emails we were planning to use the
> > minizip upstream as starting point.
> >
> 
> we can, but i was concerned about our code base inflation based on
> previous emails in this thread.
> the minizip upstead adds some extra 1k-2k lines of code just for that
> buffer i/o API.
> 
> if we use zlib upsteam minizip does not have support for buffer i/o.

Is it worth the 1-2k? For us it's just a quick detour via a temp file. I
think that's overkill to avoid the temp file.

> >> > d) alternatively, would it make sense to use it ONLY under Windows (so
> >> > that way I can deal with building it locally and create binaries and the
> >> > rest of the OSs can happily keep using their existing libzip)?
> >> >
> >>
> >> i'm not sure - too much abstraction IMHO in the case of using one lib
> >> on one OS and one on the other, but it's doable.
> >> i'd much rather favorite a portable self contained, local library that
> >> has a good API and that can be used everywhere with zlib.
> >
> > OK, spell this out for me some more - what exactly do you mean by "can
> > be used everywhere with zlib"? I just want to make sure there's no
> > misunderstanding here...
> >
> 
> zlib is a core ZIP format library that even runs on Amiga.
> libzip and minizip are filesystem and file management libraries that
> handle file inclusion and extraction in/from ZIP.
> 
> we pretty much need a portable library that works with zlib.

Got it.

> >> p.s. as i side note (and from the C point of view) the minzip stuff is
> >> a little bit more low-level in comparison to libzip.
> >> i've tested that to some extend, but seeing many projects use it i
> >> don't see a problem.
> >
> > Again, can you say a little more about that?
> >
> > Thanks
> 
> 
> not that difficult to maintain compared to libzip.
> it's just the standard:
> 
> my_struct *zip = open_my_zip_file(...)
> if (zip) {
>     puts("ok good to go");
> }
> 
> but slightly more verbose at it has better, but lower level API than libzip.
> i can ensure that if i'm about to send patches for that to test
> everything beforehand.
> ( and where schedule permits to do so :(   )

Please send patches. This sounds like the right thing to do.

/D



More information about the subsurface mailing list