lzo1x.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* lzo1x.h -- public interface of the LZO1X compression algorithm
  2. This file is part of the LZO real-time data compression library.
  3. Copyright (C) 1996-2015 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. #ifndef __LZO1X_H_INCLUDED
  22. #define __LZO1X_H_INCLUDED 1
  23. #ifndef __LZOCONF_H_INCLUDED
  24. #include <lzo/lzoconf.h>
  25. #endif
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /***********************************************************************
  30. //
  31. ************************************************************************/
  32. /* Memory required for the wrkmem parameter.
  33. * When the required size is 0, you can also pass a NULL pointer.
  34. */
  35. #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
  36. #define LZO1X_MEM_DECOMPRESS (0)
  37. #define LZO1X_MEM_OPTIMIZE (0)
  38. /* decompression */
  39. LZO_EXTERN(int)
  40. lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
  41. lzo_bytep dst, lzo_uintp dst_len,
  42. lzo_voidp wrkmem /* NOT USED */ );
  43. /* safe decompression with overrun testing */
  44. LZO_EXTERN(int)
  45. lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
  46. lzo_bytep dst, lzo_uintp dst_len,
  47. lzo_voidp wrkmem /* NOT USED */ );
  48. /***********************************************************************
  49. //
  50. ************************************************************************/
  51. #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
  52. LZO_EXTERN(int)
  53. lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
  54. lzo_bytep dst, lzo_uintp dst_len,
  55. lzo_voidp wrkmem );
  56. /***********************************************************************
  57. // special compressor versions
  58. ************************************************************************/
  59. /* this version needs only 8 KiB work memory */
  60. #define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32_t) (2048L * lzo_sizeof_dict_t))
  61. LZO_EXTERN(int)
  62. lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len,
  63. lzo_bytep dst, lzo_uintp dst_len,
  64. lzo_voidp wrkmem );
  65. /* this version needs 16 KiB work memory */
  66. #define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32_t) (4096L * lzo_sizeof_dict_t))
  67. LZO_EXTERN(int)
  68. lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len,
  69. lzo_bytep dst, lzo_uintp dst_len,
  70. lzo_voidp wrkmem );
  71. /* use this version if you need a little more compression speed */
  72. #define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32_t) (32768L * lzo_sizeof_dict_t))
  73. LZO_EXTERN(int)
  74. lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len,
  75. lzo_bytep dst, lzo_uintp dst_len,
  76. lzo_voidp wrkmem );
  77. /***********************************************************************
  78. // better compression ratio at the cost of more memory and time
  79. ************************************************************************/
  80. #define LZO1X_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
  81. LZO_EXTERN(int)
  82. lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len,
  83. lzo_bytep dst, lzo_uintp dst_len,
  84. lzo_voidp wrkmem );
  85. /***********************************************************************
  86. //
  87. ************************************************************************/
  88. LZO_EXTERN(int)
  89. lzo1x_999_compress_dict ( const lzo_bytep src, lzo_uint src_len,
  90. lzo_bytep dst, lzo_uintp dst_len,
  91. lzo_voidp wrkmem,
  92. const lzo_bytep dict, lzo_uint dict_len );
  93. LZO_EXTERN(int)
  94. lzo1x_999_compress_level ( const lzo_bytep src, lzo_uint src_len,
  95. lzo_bytep dst, lzo_uintp dst_len,
  96. lzo_voidp wrkmem,
  97. const lzo_bytep dict, lzo_uint dict_len,
  98. lzo_callback_p cb,
  99. int compression_level );
  100. LZO_EXTERN(int)
  101. lzo1x_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
  102. lzo_bytep dst, lzo_uintp dst_len,
  103. lzo_voidp wrkmem /* NOT USED */,
  104. const lzo_bytep dict, lzo_uint dict_len );
  105. /***********************************************************************
  106. // optimize a compressed data block
  107. ************************************************************************/
  108. LZO_EXTERN(int)
  109. lzo1x_optimize ( lzo_bytep src, lzo_uint src_len,
  110. lzo_bytep dst, lzo_uintp dst_len,
  111. lzo_voidp wrkmem /* NOT USED */ );
  112. #ifdef __cplusplus
  113. } /* extern "C" */
  114. #endif
  115. #endif /* already included */
  116. /* vim:set ts=4 sw=4 et: */