__.___ _.___.___ _.____.___ \ < >___< / __/\__\. \| | .__|_ |_/\_ / \/ /T \ : > | \ / /\ \ \| | | |__ < /T | > \| < | / /__\ \| \| | | /_.___| /__._/| /| | / /__.___\ /______|AnG>__.___\__/_|.__\___/ .:the:smaller:the:better:. Copyright (c) 1998 by ÄúJibzúÄ All Rights Reserved ...aBOUT....................... ...aP_pack..................... ...aP_depack_asm_fast.......... ...aP_depack_asm............... ...aPPRECIATION................ ...aLWAYS THE NEWEST VERSION... ...aND HOW TO REACH ME......... aBOUT: ÄÄÄÄÄÄ aPLib is a compression library based on the compression algorithm used in aPACK (my executable compressor). I made this because some people needed an easy way to compress data-files. The compression speed is the same as aPACK (not too fast .. but that should not really matter), and compression takes up about 1 MB of memory! Decompression on the other hand does not need any extra memory (in situ), and is VERY fast. The two directories DJGPP and WATCOM contain the following files: APDEPACK.H ............ Include file, that contains the decompressor (in 32bit assembler code). APLIB.H ............... Include file, that contains the declaration of aP_pack (the function that packs data). APLIB.LIB / APLIB.A ... The libraries that contain the aP_pack function and all the code needed to pack. So basically you include APLIB.H and link with the library to be able to pack. And you include APDEPACK.H to be able to depack data. Getting data into an input buffer and allocating the output buffer is your responsibility, whereas aP_pack allocates the memory it needs to compress itself. If aP_pack is unable to allocate enough memory, or some error occurs, it will return 0 -- otherwise it returns the compressed size. If you do not have a callback for aP_pack, use NULL instead. The EXAMPLE directory contains a simple packer that uses aPLib to compress a given file, and decompresses it to check that it works. So far aPLib is GREET-WARE for non-profitable use (if nobody charges money for programs that use it) which means that if you use it, then please greet me (well, ain't that cheap!). If you (or anybody else) plans to sell a program that uses aPLib then contact me (look at the end of this file). You may not distribute aPLib without the rest of the files. And you may not edit any of the files (except the header files) or sell aPLib for money (except for charging for the media). #ifndef _COMMON_SENCE *** This software is provided "as is". In no event shall I, the author, *** be liable for any kind of loss or damage arising out of the use, *** abuse or the inability to use this software. USE IT ENTIRELY AT *** YOUR OWN RISK! *** This software comes without any kind of warranty, either expressed *** or implied, including, but not limited to the implied warranties of *** merchantability or fitness for any particular purpose. *** If you don't agree with these terms or if your juristdiction does *** not allow the exclusion of warranty and liability as stated above *** you are NOT allowed to use this software at all. #else Bla bla bla .. the usual stuff - you know it anyway: If anything goes even remotely wrong - blame _yourself_, NOT me! #endif aP_pack: ÄÄÄÄÄÄÄÄ unsigned int aP_pack(unsigned char *source, unsigned char *destination, unsigned int length, void (*callback) (unsigned int, unsigned int)); source - is the data you want to compress. destination - is where the data should be compressed to (It would be a good idea to allocate ((length * 9) / 8) + 16 bytes to be sure that even an uncompressible file can be "compressed" without a page-fault. length - is the number of bytes you want to compress. callback - is a pointer to a function that takes two arguments - the first is the number of input bytes that has been compressed, and the second is how many output bytes they have been compressed to. This function is called every 32nd time the main compression loop is run. If you don't have a callback, use NULL instead. aP_depack_asm_fast: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void aP_depack_asm_fast(unsigned char *source, unsigned char *destination); source - is the compressed data that you want to decompress. destination - is where your want the compressed data decompressed to. aP_depack_asm: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void aP_depack_asm(unsigned char *source, unsigned char *destination); source - is the compressed data that you want to decompress. destination - is where your want the compressed data decompressed to. aPPRECIATION: ÄÄÄÄÄÄÄÄÄÄÄÄÄ .. goes out to the following people: * x-otic for being a great beta-tester (thx mate ;) * d'b for our continous discussions of compression techniques :) * The people who made the Epsilon Compression Page * Pasi 'Albert' Ojala for his info on PuCrunch * RIT Research Labs for making Dos Navigator .. it's the BEST! * LiuTaoTao for making TR .. one of the best debuggers around! * Eugene Suslikov (SEN) for making HIEW .. it ROCKS! * Netscape for making the best internet browser (and releasing the source) * All other people who make good software freely available for non- commercial use! aLWAYS THE NEWEST VERSION: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Get it at: ftp://ftp.elf.stuba.sk/pub/pc/pack/ aND HOW TO REACH ME: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Well, if you have any questions, suggestions or bug-reports about aPLib (or you just like chatting), this email-address should work: jibz@hotmail.com Registration information and -form will be included in one of the next versions!