2 ============================================================================
3 miniLZO -- mini subset of the LZO real-time data compression library
4 ============================================================================
6 Author : Markus Franz Xaver Johannes Oberhumer
8 http://www.oberhumer.com/opensource/lzo/
12 I've created miniLZO for projects where it is inconvenient to
13 include (or require) the full LZO source code just because you
14 want to add a little bit of data compression to your application.
16 miniLZO implements the LZO1X-1 compressor and both the standard and
17 safe LZO1X decompressor. Apart from fast compression it also useful
18 for situations where you want to use pre-compressed data files (which
19 must have been compressed with LZO1X-999).
21 miniLZO consists of one C source file and three header files:
23 minilzo.h, lzoconf.h, lzodefs.h
25 To use miniLZO just copy these files into your source directory, add
26 minilzo.c to your Makefile and #include minilzo.h from your program.
27 Note: you also must distribute this file ('README.LZO') with your project.
29 minilzo.o compiles to about 6 KiB (using gcc or Visual C on an i386), and
30 the sources are about 30 KiB when packed with zip - so there's no more
31 excuse that your application doesn't support data compression :-)
33 For more information, documentation, example programs and other support
34 files (like Makefiles and build scripts) please download the full LZO
36 http://www.oberhumer.com/opensource/lzo/
42 P.S. minilzo.c is generated automatically from the LZO sources and
43 therefore functionality is completely identical
46 Appendix A: building miniLZO
47 ----------------------------
48 miniLZO is written such a way that it should compile and run
49 out-of-the-box on most machines.
51 If you are running on a very unusual architecture and lzo_init() fails then
52 you should first recompile with '-DLZO_DEBUG' to see what causes the failure.
53 The most probable case is something like 'sizeof(void *) != sizeof(size_t)'.
54 After identifying the problem you can compile by adding some defines
55 like '-DSIZEOF_VOID_P=8' to your Makefile.
57 The best solution is (of course) using Autoconf - if your project uses
58 Autoconf anyway just add '-DMINILZO_HAVE_CONFIG_H' to your compiler
59 flags when compiling minilzo.c. See the LZO distribution for an example
60 how to set up configure.ac.
63 Appendix B: list of public functions available in miniLZO
64 ---------------------------------------------------------
65 Library initialization
73 lzo1x_decompress_safe()
83 Portable (but slow) string functions
90 Appendix C: suggested macros for 'configure.ac' when using Autoconf
91 -------------------------------------------------------------------
92 Checks for typedefs and structures
93 AC_CHECK_TYPE(ptrdiff_t,long)
95 AC_CHECK_SIZEOF(short)
98 AC_CHECK_SIZEOF(long long)
99 AC_CHECK_SIZEOF(__int64)
100 AC_CHECK_SIZEOF(void *)
101 AC_CHECK_SIZEOF(size_t)
102 AC_CHECK_SIZEOF(ptrdiff_t)
104 Checks for compiler characteristics
107 Checks for library functions
108 AC_CHECK_FUNCS(memcmp memcpy memmove memset)
111 Appendix D: Copyright
112 ---------------------
113 LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001,
114 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
115 Markus Franz Xaver Oberhumer <markus@oberhumer.com>.
117 LZO and miniLZO are distributed under the terms of the GNU General
118 Public License (GPL). See the file COPYING.
120 Special licenses for commercial and other applications which
121 are not willing to accept the GNU General Public License
122 are available by contacting the author.