zip icon indicating copy to clipboard operation
zip copied to clipboard

Q: Design for enabling/disabling inflate, deflate + symlink

Open JCash opened this issue 1 year ago • 1 comments

Thanks for this great project btw, I forgot to say in my last communication!

In my case, my targets may not have all the common I/O api's (such as symlink). Aso, I don't actually need/want to create zip archives, so it'd be good to strip that extra size from the executable.

It'd be beneficial to control this by excluding the functionality using defines.

I'd like to hear your preferences around this before I delve any deeper on this subject.

inflate/deflate

While some of the MINIZ defines may help, I think it might be good to have the defines be "owned" by your library itself.

For the extract/compress I think it's good to use a inflate/deflate wording e.g.:

  • ZIP_ENABLE_INFLATE / ZIP_ENABLE_DEFLATE

symlink

As for the stdio functions, it's less clear, as we need it for reading files, so we can't have a "diable stdio". Instead, since the problematic function in our case is the symlink function, I propose adding something like:

  • ZIP_HAVE_SYMLINK

and if that isn't set, it should extract using full copies instead.

JCash avatar Dec 01 '24 16:12 JCash

How about ZIP_WITH_...:

  • ...SYMLINK
  • ...INFLATE
  • ...DEFLATE

kuba-- avatar Dec 01 '24 20:12 kuba--