old-www/LDP/LG/issue30/tag_gzipC.html

155 lines
5.8 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.1pre8">
<TITLE>The Answer Guy 30: Compression Libraries to
Link into a C Program</TITLE>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ========================================================= -->
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- =============================================================== -->
<H1 align="center"><A NAME="answer">
<img src="../gx/dennis/qbubble.gif" alt="" border="0" align="middle">
<a href="./index.html">The Answer Guy</a>
<img src="../gx/dennis/bbubble.gif" alt="" border="0" align="middle">
</A></H1> <BR>
<H4 align="center">By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A> </H4>
<p><hr><p>
<H3><img src="../gx/dennis/qbub.gif" alt="(?)" width="50" height="28"
align="left" border="0"
>Compression Libraries to Link into a C Program</H3>
<p><strong>From Corne van Biljon on the linuxprog mailing list
on 30 May 1998</strong></p>
<!-- begin body -->
<p><strong><img src="../gx/dennis/qbub.gif"width="50" height="28" alt="(?)"
align="left" border="0">
Hello
<br><br>
I would like to zip a file, specified by the user, from within a C
program. Currently I use the <tt>system()</tt> command to invoke
<tt>gzip</tt>. Is there a compression library or routines out there
somewhere, or is there a better way of doing this ?
<br><br>
Thanks
</strong></p>
<blockquote><img src="../gx/dennis/bbub.gif"width="50" height="28" alt="(!)"
align="left" border="0">
I can understand your concerns.
<br><br>
The <tt>system()</tt>, and <tt>popen()</tt> calls are notoriously
insecure and can be used to subvert your program to the users' will.
<br><br>
I would have started with some
<a href="http://www.yahoo.com/">Yahoo!</a> and
<a href="http://altavista.digital.com/">Alta Vista</a> searches
(actually I used
<strong><font color="#66CC66">G</font><font color="#CC6666">o</font><font
color="#FFFF66">o</font><font color="#6666CC">g</font><font
color="#66CC66">l</font><font color="#CC6666">e</font></strong>
--- a new and interesting search
engine at Stanford University:
<a href="http://google.stanford.edu/">http://google.stanford.edu/</a>).
<br><br>
The obvious phrase would be "<tt>+free +compression +library</tt>"
(and reasonable variations).
<br><br>
I get a bunch of links to the
<a href="http://www.pkware.com/">PKware Inc.</a> pages (which are
presumably shareware and/or commercial) and then I find a link
to the zlib pages (which declare that they should <em>not</em> be
confused with the Linux
<tt><a href="http://zlibc.linux.lu/zlibc.html">zlibc</a></tt>
compression libraries).
<br><br>
The zlib home pages are at:
<blockquote>
<a href="http://www.cdrom.com/pub/infozip/zlib/"
>http://www.cdrom.com/pub/infozip/zlib/</a>
</blockquote>
... and appear to be <tt>gzip</tt> compatible, and co-written by the
primary author/maintainer of <tt>gzip</tt>. However the impression I
got from this page is that <tt>zlib</tt> is not under a GPL or is
under an LGPL --- that your <tt>zlib</tt> linked code will not be
encumbered.
<br><br>
Naturally you'll want to read the licenses yourself.
<br><br>
This zlib home page also has numerous links to other
compresssion software and programming resources.
</blockquote>
<!-- end body -->
<!--================================================================-->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1998, James T. Dennis <BR>
Published in <I>Linux Gazette</I> Issue 30 July 1998</H5>
<P> <hr> <P>
<!--================================================================-->
<table width="98%"><tr valign="center" align="center">
<td rowspan="3"><A HREF="./lg_answer30.html"><IMG
SRC="../gx/dennis/answernew.gif"
ALT="[ Answer Guy Index ]"></A></td>
<td><A HREF="tag_SCOkeys.html">SCOkeys</A></td>
<td><A HREF="tag_chroot.html">chroot</A></td>
<td><A HREF="tag_dosemu-db.html">dosemu-db</A></td>
<td><A HREF="tag_NTauth.html">NTauth</A></td>
<td><A HREF="tag_cdr.html">cdr</A></td>
<td><A HREF="tag_3270.html">3270</A></td>
<td><A HREF="linux-questions-only@ssc.comport.html">comport</A></td>
</tr><tr valign="center" align="center">
<td><A HREF="tag_lilostop.html">lilostop</A></td>
<td><A HREF="tag_emulate.html">emulate</A></td>
<td><A HREF="tag_ppadrivers.html">ppadrivers</A></td>
<td><A HREF="tag_database.html">database</A></td>
<td><A HREF="tag_vacation.html">vacation</A></td>
<td><A HREF="tag_nullmodem.html">nullmodem</A></td>
<td><A HREF="tag_lockups.html">lockups</A></td>
</tr><tr valign="center" align="center">
<td><A HREF="tag_gzipC.html">gzipC</A></td>
<td><A HREF="tag_newlook.html">newlook</A></td>
<td><A HREF="tag_c500.html">c500</A></td>
<td><A HREF="tag_solprint.html">solprint</A></td>
<td><A HREF="tag_vc1shell.html">vc1shell</A></td>
<td><A HREF="tag_memleak.html">memleak</A></td>
<td><A HREF="tag_tvcard.html">tvcard</A></td>
</tr></table>
<P> <hr> <P>
<!--================================================================-->
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif"
ALT="[ Table Of Contents ]"></A>
<A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
ALT="[ Front Page ]"></A>
<A HREF="lg_bytes30.html"><IMG SRC="../gx/back2.gif"
ALT="[ Previous Section ]"></A>
<A HREF="./vrenios.html"><IMG SRC="../gx/fwd.gif"
ALT="[ Next Section ]"></A>
<!--startcut ======================================================= -->
</body>
</html>
<!--endcut ========================================================= -->