minilzo.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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-2014 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
  27. #define __MINILZO_H 1
  28. #define MINILZO_VERSION 0x2080
  29. #ifdef __LZOCONF_H
  30. # error "you cannot use both LZO and miniLZO"
  31. #endif
  32. #undef LZO_HAVE_CONFIG_H
  33. #include "lzoconf.h"
  34. #if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
  35. # error "version mismatch in header files"
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. /***********************************************************************
  41. //
  42. ************************************************************************/
  43. /* Memory required for the wrkmem parameter.
  44. * When the required size is 0, you can also pass a NULL pointer.
  45. */
  46. #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
  47. #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
  48. #define LZO1X_MEM_DECOMPRESS (0)
  49. /* compression */
  50. LZO_EXTERN(int)
  51. lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
  52. lzo_bytep dst, lzo_uintp dst_len,
  53. lzo_voidp wrkmem );
  54. /* decompression */
  55. LZO_EXTERN(int)
  56. lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
  57. lzo_bytep dst, lzo_uintp dst_len,
  58. lzo_voidp wrkmem /* NOT USED */ );
  59. /* safe decompression with overrun testing */
  60. LZO_EXTERN(int)
  61. lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
  62. lzo_bytep dst, lzo_uintp dst_len,
  63. lzo_voidp wrkmem /* NOT USED */ );
  64. #ifdef __cplusplus
  65. } /* extern "C" */
  66. #endif
  67. #endif /* already included */