3
0

liblzo_interface.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. This file is part of the LZO real-time data compression library.
  3. Copyright (C) 1996..2008 Markus Franz Xaver Johannes Oberhumer
  4. All Rights Reserved.
  5. Markus F.X.J. Oberhumer <markus@oberhumer.com>
  6. http://www.oberhumer.com/opensource/lzo/
  7. The LZO library is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License as
  9. published by the Free Software Foundation; either version 2 of
  10. the License, or (at your option) any later version.
  11. The LZO library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with the LZO library; see the file COPYING.
  17. If not, write to the Free Software Foundation, Inc.,
  18. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. #define LZO1X
  21. #undef LZO1Y
  22. #undef assert
  23. /*
  24. static void die_at(int line)
  25. {
  26. bb_error_msg_and_die("internal error at %d", line);
  27. }
  28. #define assert(v) if (!(v)) die_at(__LINE__)
  29. */
  30. #define assert(v) ((void)0)
  31. int lzo1x_1_compress(const uint8_t* src, unsigned src_len,
  32. uint8_t* dst, unsigned* dst_len,
  33. void* wrkmem);
  34. int lzo1x_1_15_compress(const uint8_t* src, unsigned src_len,
  35. uint8_t* dst, unsigned* dst_len,
  36. void* wrkmem);
  37. int lzo1x_999_compress_level(const uint8_t* in, unsigned in_len,
  38. uint8_t* out, unsigned* out_len,
  39. void* wrkmem,
  40. int compression_level);
  41. /* decompression */
  42. //int lzo1x_decompress(const uint8_t* src, unsigned src_len,
  43. // uint8_t* dst, unsigned* dst_len,
  44. // void* wrkmem /* NOT USED */);
  45. /* safe decompression with overrun testing */
  46. int lzo1x_decompress_safe(const uint8_t* src, unsigned src_len,
  47. uint8_t* dst, unsigned* dst_len,
  48. void* wrkmem /* NOT USED */);
  49. #define LZO_E_OK 0
  50. #define LZO_E_ERROR (-1)
  51. #define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */
  52. #define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
  53. #define LZO_E_INPUT_OVERRUN (-4)
  54. #define LZO_E_OUTPUT_OVERRUN (-5)
  55. #define LZO_E_LOOKBEHIND_OVERRUN (-6)
  56. #define LZO_E_EOF_NOT_FOUND (-7)
  57. #define LZO_E_INPUT_NOT_CONSUMED (-8)
  58. #define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
  59. /* lzo-2.03/include/lzo/lzoconf.h */
  60. #define LZO_VERSION 0x2030