Blame | Last modification | View Log | Download | RSS feed
============================================================================miniLZO -- mini subset of the LZO real-time data compression library============================================================================Author : Markus Franz Xaver Johannes Oberhumer<markus@oberhumer.com>http://www.oberhumer.com/opensource/lzo/Version : 2.10Date : 01 Mar 2017I've created miniLZO for projects where it is inconvenient toinclude (or require) the full LZO source code just because youwant to add a little bit of data compression to your application.miniLZO implements the LZO1X-1 compressor and both the standard andsafe LZO1X decompressor. Apart from fast compression it also usefulfor situations where you want to use pre-compressed data files (whichmust have been compressed with LZO1X-999).miniLZO consists of one C source file and three header files:minilzo.cminilzo.h, lzoconf.h, lzodefs.hTo use miniLZO just copy these files into your source directory, addminilzo.c to your Makefile and #include minilzo.h from your program.Note: you also must distribute this file ('README.LZO') with your project.minilzo.o compiles to about 6 KiB (using gcc or Visual C on an i386), andthe sources are about 30 KiB when packed with zip - so there's no moreexcuse that your application doesn't support data compression :-)For more information, documentation, example programs and other supportfiles (like Makefiles and build scripts) please download the full LZOpackage fromhttp://www.oberhumer.com/opensource/lzo/Have fun,MarkusP.S. minilzo.c is generated automatically from the LZO sources andtherefore functionality is completely identicalAppendix A: building miniLZO----------------------------miniLZO is written such a way that it should compile and runout-of-the-box on most machines.If you are running on a very unusual architecture and lzo_init() fails thenyou should first recompile with '-DLZO_DEBUG' to see what causes the failure.The most probable case is something like 'sizeof(void *) != sizeof(size_t)'.After identifying the problem you can compile by adding some defineslike '-DSIZEOF_VOID_P=8' to your Makefile.The best solution is (of course) using Autoconf - if your project usesAutoconf anyway just add '-DMINILZO_HAVE_CONFIG_H' to your compilerflags when compiling minilzo.c. See the LZO distribution for an examplehow to set up configure.ac.Appendix B: list of public functions available in miniLZO---------------------------------------------------------Library initializationlzo_init()Compressionlzo1x_1_compress()Decompressionlzo1x_decompress()lzo1x_decompress_safe()Checksum functionslzo_adler32()Version functionslzo_version()lzo_version_string()lzo_version_date()Portable (but slow) string functionslzo_memcmp()lzo_memcpy()lzo_memmove()lzo_memset()Appendix C: suggested macros for 'configure.ac' when using Autoconf-------------------------------------------------------------------Checks for typedefs and structuresAC_CHECK_TYPE(ptrdiff_t,long)AC_TYPE_SIZE_TAC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF(long long)AC_CHECK_SIZEOF(__int64)AC_CHECK_SIZEOF(void *)AC_CHECK_SIZEOF(size_t)AC_CHECK_SIZEOF(ptrdiff_t)Checks for compiler characteristicsAC_C_CONSTChecks for library functionsAC_CHECK_FUNCS(memcmp memcpy memmove memset)Appendix D: Copyright---------------------LZO and miniLZO are Copyright (C) 1996-2017 Markus Franz Xaver OberhumerAll Rights Reserved.LZO and miniLZO are distributed under the terms of the GNU GeneralPublic License (GPL). See the file COPYING.Special licenses for commercial and other applications whichare not willing to accept the GNU General Public Licenseare available by contacting the author.