Where can I find an example unzipper using zlib? - c

I'm looking for a bare bones simple example C app for unpacking a zip file using zlib. It must support fairly new version of .zip and must have source right down to the zlib calls.

The zlib-bin source package on my system (linux) has some example programs called "minizip" and "miniunzip" which shows just that.

The zpipe.c example on the zlib.net web site is pretty straight forward. There is also a pretty good description of what it does.

Related

Minimal working example of mixed Julia and C project on Windows

I'm looking for a simple, minimal working example for a Julia project that includes some C code as part of the project. I need the project to compile the C code into a *.dll and then have some Julia code that can successfully call a function from that *.dll on Windows.
I'm having a lot of trouble getting this to work on Windows, and it would be really helpful to just start from some example that I know actually works, and troubleshoot from there why my larger project isn't working.
My use case is calling the portaudio library for low-latency presentation of sounds, using a lock-less multi-threading model. This isn't really possible to write in julia at this point, that I know of: I really need a system level language like C. But I'd like the rest of the project to be in Julia.
This blog post contains pretty much a minimal working example. It compiles a small linker code to GSL and then writes about 10 lines of Julia to use it. It even in that space shows how to pass a Julia-defined function to C.
This link is not a perfect example, but it's very very close. I haven't run this code, but the poster claims that it compiles and runs successfully on Windows.

How are C files included in freeSwitch (kind of framework for calls)?

Today I downloaded Freeswitch that (based on what I read) allows me to have a messaging (audio and video calls) server in my computer. I am not very good in programming. When analysing the files contained in its .zip file, I noticed that almost all the files were written in C++.
However based on my knowledge, C files need to be compiled before they can be used (maybe I am wrong). If so, Why C files??
I ask this question because I was building some kind of web messaging app. I implemented text chat, send image, audio, attachment. I did it using simply HTML, JAVASCRIPT, PHP, SQL and a little XML. When it comes to audio call and Video call, I cannot start (because I found it more complex). So I tried to find an easy alternative that took me to freeswitch.
I do not know if it is up to me to compile them or not.
Note: I did not install it.
Thank you!!
FreeSwitch is an open-source software-based PBX written in C. So yes, it needs to be compiled. However, the FreeSwitch website provides precompiled binaries if you just want to use the FreeSwitch software as-is:
https://freeswitch.org/confluence/display/FREESWITCH/Installation
You don't need the source code unless you are planning on modifying it, in which case you will then have to compile it for any changes to take effect.
FreeSwitch is open-source tool written in C. FreeSwitch uses many libraries. So to compile FreeSwitch you have to first install all dependency of FreeSwitch then you have to configure and make, make install the FreeSwitch Source.
I have wrote many custom module in FreeSwitch using C for Callcenter, conference, class4-switch, class5-switch, class4/5 switch.

Access zip files

How can I access to the contents of a zip file?
I'm trying write a program in C and I want use the libraries used by zip.
You may want to check the open source widely used library ZLIB.
The link provides sample code and the home page provides more information about the libraries, source code, installation and usage.
The Info-zip project has code for that.
Minizip, which is included with zlib is what you need. Look in the 'contribs' directory for the code. There is an example for zip/unzip and is easily included in a project.

C library to read from zip archives

Is there a portable C library to access .zip archives? "gzip" or "zlib" (the closest I could find) only handle compressed data, I need to be able to list the files inside the archive, and access each one individually, and if they're compressed using the 'deflate' method, I can use zlib on it.
Minizip, maybe?
http://www.winimage.com/zLibDll/minizip.html
The zip that comes with Linux and BSD is actually called info-ZIP which is here. Personally I have not tried such a thing but the info-zip front page states "Info-ZIP's primary compression engine has also been spun off into the free zlib compression library", so you might want to check out zlib. The zlib page has a FAQ with a answer to your specific question. I would start by studying how info-zip works. Good luck.
7-zip has a complete SDK, with example sources, and a lot of functionality.
take a look here

Program visible to Linux as normal directory

I'm trying to write program to work as programmable directory, in other words: User, or other systems open that directory and read/write files or dirs. I try to create program to cache most used files in memory (less I/O to HDD), but right now I don't know how to achive that. There are probably some docs about this but I can't find them. I know that there is FUSE, NFS and others, but reading their source is quite difficult. If any one has info about implementation in C lang I'll be very grateful.
Sorry for my English..
FUSE has a C interface - take a look at their Hello World example.
If you want a simple implementation, try Python's FUSE library. A quick tutorial can be found here.
You could have a look at the GIO library — it's part of GTK, but can be used separately. The documentation is pretty thorough, and if you need to do some quick prototyping you can use the PyGTK GIO bindings to mess around before going back and writing it in C.
It's licensed under the LGPL.
If you find it easier to code in Python, it's possible to create a compiled program using cx_Freeze.

Resources