Coder Social home page Coder Social logo

junzip's Introduction

JUnzip

Minimalistic zip/unzip library released into public domain. There is now also simple demo for creating a zip file with or without compression!

Written by Joonas Pihlajamaa ([email protected]). For details about this project, see:

http://codeandlife.com/2014/01/01/unzip-library-for-c/

Compiling

The codebase is very lean and should be easy to understand, and port to any system. Compiling the example on most systems with zlib installed:

gcc -DHAVE_ZLIB junzip_demo.c junzip.c -lz -o junzip_demo

If you don't want the zlib dependency but need decompression, puff.c by Mark Adler (part of zlib contrib suite) is included and you can include it instead of zlib:

gcc -DHAVE_PUFF junzip_demo.c junzip.c puff.c -o junzip_demo

You can also compile a "no compression" version without either above dependencies and use clang as well as gcc:

clang junzip_demo.c junzip.c -o junzip_demo

Makefile

On Windows, MinGW requires -mno-ms-bitfields compilation flags, so you may want to use the supplied Makefile and build the junzip_demo and other utilities in one go:

make

You can make the zlib-enabled versions easily as well to get fast decompression and compression support to jzip_demo (not just store):

make HAVE_ZLIB=1

Or the lighter but bit slower puff.c powered decompression without the zlib dependency (and no compression, just store in jzip_demo):

make HAVE_PUFF=1

A small make_clang.bat is also provided just for laughs.

Included executables

Warning, both the jzip_demo and junzip_demo WILL overwrite files silently! Zip demo assumes last parameter is the target and overwrites that file, and unzip demo overwrites any files already within the directory with contents of the zip. Be careful!

  • junzip_demo file.zip unzips the file.zip
  • jzip_demo file1 file2 output.zip creates a zip file
  • junzip_dump file.zip dumps the headers in file.zip
  • junzip_test checks if structures are the right size

Github: https://github.com/jokkebk/JUnzip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.