|
kusano |
7d535a |
|
|
kusano |
7d535a |
============================================================================
|
|
kusano |
7d535a |
miniLZO -- mini subset of the LZO real-time data compression library
|
|
kusano |
7d535a |
============================================================================
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Author : Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
<markus@oberhumer.com></markus@oberhumer.com>
|
|
kusano |
7d535a |
http://www.oberhumer.com/opensource/lzo/
|
|
kusano |
7d535a |
Version : 2.03
|
|
kusano |
7d535a |
Date : 30 Apr 2008
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
I've created miniLZO for projects where it is inconvenient to
|
|
kusano |
7d535a |
include (or require) the full LZO source code just because you
|
|
kusano |
7d535a |
want to add a little bit of data compression to your application.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
miniLZO implements the LZO1X-1 compressor and both the standard and
|
|
kusano |
7d535a |
safe LZO1X decompressor. Apart from fast compression it also useful
|
|
kusano |
7d535a |
for situations where you want to use pre-compressed data files (which
|
|
kusano |
7d535a |
must have been compressed with LZO1X-999).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
miniLZO consists of one C source file and three header files:
|
|
kusano |
7d535a |
minilzo.c
|
|
kusano |
7d535a |
minilzo.h, lzoconf.h, lzodefs.h
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
To use miniLZO just copy these files into your source directory, add
|
|
kusano |
7d535a |
minilzo.c to your Makefile and #include minilzo.h from your program.
|
|
kusano |
7d535a |
Note: you also must distribute this file (`README.LZO') with your project.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
|
|
kusano |
7d535a |
the sources are about 30 kB when packed with zip - so there's no more
|
|
kusano |
7d535a |
excuse that your application doesn't support data compression :-)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
For more information, documentation, example programs and other support
|
|
kusano |
7d535a |
files (like Makefiles and build scripts) please download the full LZO
|
|
kusano |
7d535a |
package from
|
|
kusano |
7d535a |
http://www.oberhumer.com/opensource/lzo/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Have fun,
|
|
kusano |
7d535a |
Markus
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
P.S. minilzo.c is generated automatically from the LZO sources and
|
|
kusano |
7d535a |
therefore functionality is completely identical
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Appendix A: building miniLZO
|
|
kusano |
7d535a |
----------------------------
|
|
kusano |
7d535a |
miniLZO is written such a way that it should compile and run
|
|
kusano |
7d535a |
out-of-the-box on most machines.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
If you are running on a very unusual architecture and lzo_init() fails then
|
|
kusano |
7d535a |
you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
|
|
kusano |
7d535a |
The most probable case is something like `sizeof(char *) != sizeof(long)'.
|
|
kusano |
7d535a |
After identifying the problem you can compile by adding some defines
|
|
kusano |
7d535a |
like `-DSIZEOF_CHAR_P=8' to your Makefile.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The best solution is (of course) using Autoconf - if your project uses
|
|
kusano |
7d535a |
Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
|
|
kusano |
7d535a |
flags when compiling minilzo.c. See the LZO distribution for an example
|
|
kusano |
7d535a |
how to set up configure.in.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Appendix B: list of public functions available in miniLZO
|
|
kusano |
7d535a |
---------------------------------------------------------
|
|
kusano |
7d535a |
Library initialization
|
|
kusano |
7d535a |
lzo_init()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Compression
|
|
kusano |
7d535a |
lzo1x_1_compress()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Decompression
|
|
kusano |
7d535a |
lzo1x_decompress()
|
|
kusano |
7d535a |
lzo1x_decompress_safe()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Checksum functions
|
|
kusano |
7d535a |
lzo_adler32()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Version functions
|
|
kusano |
7d535a |
lzo_version()
|
|
kusano |
7d535a |
lzo_version_string()
|
|
kusano |
7d535a |
lzo_version_date()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Portable (but slow) string functions
|
|
kusano |
7d535a |
lzo_memcmp()
|
|
kusano |
7d535a |
lzo_memcpy()
|
|
kusano |
7d535a |
lzo_memmove()
|
|
kusano |
7d535a |
lzo_memset()
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Appendix C: suggested macros for `configure.in' when using Autoconf
|
|
kusano |
7d535a |
-------------------------------------------------------------------
|
|
kusano |
7d535a |
Checks for typedefs and structures
|
|
kusano |
7d535a |
AC_CHECK_TYPE(ptrdiff_t,long)
|
|
kusano |
7d535a |
AC_TYPE_SIZE_T
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(short)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(int)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(long)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(long long)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(__int64)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(void *)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(size_t)
|
|
kusano |
7d535a |
AC_CHECK_SIZEOF(ptrdiff_t)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Checks for compiler characteristics
|
|
kusano |
7d535a |
AC_C_CONST
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Checks for library functions
|
|
kusano |
7d535a |
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Appendix D: Copyright
|
|
kusano |
7d535a |
---------------------
|
|
kusano |
7d535a |
LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
|
kusano |
7d535a |
2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
LZO and miniLZO are distributed under the terms of the GNU General
|
|
kusano |
7d535a |
Public License (GPL). See the file COPYING.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Special licenses for commercial and other applications which
|
|
kusano |
7d535a |
are not willing to accept the GNU General Public License
|
|
kusano |
7d535a |
are available by contacting the author.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|