Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!csd4.csd.uwm.edu!mamba From: mamba@csd4.csd.uwm.edu (Paul A Deisinger) Newsgroups: comp.compression Subject: Re: A new idea! (PKware Data Compression Library) Message-ID: <11408@uwm.edu> Date: 25 Apr 91 15:37:43 GMT References: <1991Apr24.220925.15898@world.std.com> <1991Apr25.054249.28057@cs.uow.edu.au> Sender: news@uwm.edu Organization: University of Wisconsin - Milwaukee Lines: 27 In article <1991Apr25.054249.28057@cs.uow.edu.au> u9039899@cs.uow.edu.au (Darrin Jon Smart) writes: >Here's an idea: How about compiling a C library for compression and >decompression only so that programmers can compress raw data without having >to shell out to other programs. The idea is that one routine takes a block >of data and returns a compressed block of data. Would that be difficult? > >I remember this was done by an LZW compression writer for CP/M, his modules >were pure assembler though. This has been done. There is a library of routines from PKware (Makers of PKzip). These are the implode() and explode() algorythms. They are related to but not identical to the routines used in PKzip with the same name (The library has an adjustable dictionary size of 1,2 or 4k, the one in PKzip has an 8k dictionary) These routines are used by creating a read() and write() routine of your own and passing the addresses of these routines to the library routines which then read and write data as needed. This means you can structure your routines to take and put the data wherever you want, from a buffer to a buffer, a file to the modem, whatever. Disclaimer: I dont' work for PKware, but I have a freind who does. -- Paul Deisinger mamba@csd4.csd.uwm.edu