minilzo.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* minilzo.h -- mini subset of the LZO real-time data compression library
  2. This file is part of the LZO real-time data compression library.
  3. Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
  4. All Rights Reserved.
  5. The LZO library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of
  8. the License, or (at your option) any later version.
  9. The LZO library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with the LZO library; see the file COPYING.
  15. If not, write to the Free Software Foundation, Inc.,
  16. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. Markus F.X.J. Oberhumer
  18. <markus@oberhumer.com>
  19. http://www.oberhumer.com/opensource/lzo/
  20. */
  21. /*
  22. * NOTE:
  23. * the full LZO package can be found at
  24. * http://www.oberhumer.com/opensource/lzo/
  25. */
  26. #ifndef __MINILZO_H_INCLUDED
  27. #define __MINILZO_H_INCLUDED 1
  28. #define MINILZO_VERSION 0x20a0 /* 2.10 */
  29. /* we must provide a little more output space in case that compression is not possible */
  30. #define MINILZO_BUFFER_PADDING(x) ((x) / 16 + 64 + 3)
  31. #if defined(__LZOCONF_H_INCLUDED)
  32. # error "you cannot use both LZO and miniLZO"
  33. #endif
  34. /* internal Autoconf configuration file - only used when building miniLZO */
  35. #ifdef MINILZO_HAVE_CONFIG_H
  36. # include <config.h>
  37. #endif
  38. #include <limits.h>
  39. #include <stddef.h>
  40. #ifndef __LZODEFS_H_INCLUDED
  41. #include "lzodefs.h"
  42. #endif
  43. #undef LZO_HAVE_CONFIG_H
  44. #include "lzoconf.h"
  45. #if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
  46. # error "version mismatch in header files"
  47. #endif
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. /***********************************************************************
  52. //
  53. ************************************************************************/
  54. /* Memory required for the wrkmem parameter.
  55. * When the required size is 0, you can also pass a NULL pointer.
  56. */
  57. #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
  58. #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))
  59. #define LZO1X_MEM_DECOMPRESS (0)
  60. /* compression */
  61. LZO_EXTERN(int)
  62. lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
  63. lzo_bytep dst, lzo_uintp dst_len,
  64. lzo_voidp wrkmem );
  65. /* decompression */
  66. LZO_EXTERN(int)
  67. lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
  68. lzo_bytep dst, lzo_uintp dst_len,
  69. lzo_voidp wrkmem /* NOT USED */ );
  70. /* safe decompression with overrun testing */
  71. LZO_EXTERN(int)
  72. lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
  73. lzo_bytep dst, lzo_uintp dst_len,
  74. lzo_voidp wrkmem /* NOT USED */ );
  75. #ifdef __cplusplus
  76. } /* extern "C" */
  77. #endif
  78. #endif /* already included */
  79. /* vim:set ts=4 sw=4 et: */