minilzo.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #if defined(__LZOCONF_H_INCLUDED)
  30. # error "you cannot use both LZO and miniLZO"
  31. #endif
  32. /* internal Autoconf configuration file - only used when building miniLZO */
  33. #ifdef MINILZO_HAVE_CONFIG_H
  34. # include <config.h>
  35. #endif
  36. #include <limits.h>
  37. #include <stddef.h>
  38. #ifndef __LZODEFS_H_INCLUDED
  39. #include "lzodefs.h"
  40. #endif
  41. #undef LZO_HAVE_CONFIG_H
  42. #include "lzoconf.h"
  43. #if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
  44. # error "version mismatch in header files"
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. /***********************************************************************
  50. //
  51. ************************************************************************/
  52. /* Memory required for the wrkmem parameter.
  53. * When the required size is 0, you can also pass a NULL pointer.
  54. */
  55. #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
  56. #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
  57. #define LZO1X_MEM_DECOMPRESS (0)
  58. /* compression */
  59. LZO_EXTERN(int)
  60. lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
  61. lzo_bytep dst, lzo_uintp dst_len,
  62. lzo_voidp wrkmem );
  63. /* decompression */
  64. LZO_EXTERN(int)
  65. lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
  66. lzo_bytep dst, lzo_uintp dst_len,
  67. lzo_voidp wrkmem /* NOT USED */ );
  68. /* safe decompression with overrun testing */
  69. LZO_EXTERN(int)
  70. lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
  71. lzo_bytep dst, lzo_uintp dst_len,
  72. lzo_voidp wrkmem /* NOT USED */ );
  73. #ifdef __cplusplus
  74. } /* extern "C" */
  75. #endif
  76. #endif /* already included */
  77. /* vim:set ts=4 sw=4 et: */