lzo1c.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* lzo1c.h -- public interface of the LZO1C 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 __LZO1C_H_INCLUDED
  22. #define __LZO1C_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 LZO1C_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
  36. #define LZO1C_MEM_DECOMPRESS (0)
  37. /* compression levels */
  38. #define LZO1C_BEST_SPEED 1
  39. #define LZO1C_BEST_COMPRESSION 9
  40. #define LZO1C_DEFAULT_COMPRESSION (-1) /* fastest by default */
  41. LZO_EXTERN(int)
  42. lzo1c_compress ( const lzo_bytep src, lzo_uint src_len,
  43. lzo_bytep dst, lzo_uintp dst_len,
  44. lzo_voidp wrkmem,
  45. int compression_level );
  46. /* decompression */
  47. LZO_EXTERN(int)
  48. lzo1c_decompress ( const lzo_bytep src, lzo_uint src_len,
  49. lzo_bytep dst, lzo_uintp dst_len,
  50. lzo_voidp wrkmem /* NOT USED */ );
  51. /* safe decompression with overrun testing */
  52. LZO_EXTERN(int)
  53. lzo1c_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
  54. lzo_bytep dst, lzo_uintp dst_len,
  55. lzo_voidp wrkmem /* NOT USED */ );
  56. /***********************************************************************
  57. //
  58. ************************************************************************/
  59. LZO_EXTERN(int)
  60. lzo1c_1_compress ( const lzo_bytep src, lzo_uint src_len,
  61. lzo_bytep dst, lzo_uintp dst_len,
  62. lzo_voidp wrkmem );
  63. LZO_EXTERN(int)
  64. lzo1c_2_compress ( const lzo_bytep src, lzo_uint src_len,
  65. lzo_bytep dst, lzo_uintp dst_len,
  66. lzo_voidp wrkmem );
  67. LZO_EXTERN(int)
  68. lzo1c_3_compress ( const lzo_bytep src, lzo_uint src_len,
  69. lzo_bytep dst, lzo_uintp dst_len,
  70. lzo_voidp wrkmem );
  71. LZO_EXTERN(int)
  72. lzo1c_4_compress ( const lzo_bytep src, lzo_uint src_len,
  73. lzo_bytep dst, lzo_uintp dst_len,
  74. lzo_voidp wrkmem );
  75. LZO_EXTERN(int)
  76. lzo1c_5_compress ( const lzo_bytep src, lzo_uint src_len,
  77. lzo_bytep dst, lzo_uintp dst_len,
  78. lzo_voidp wrkmem );
  79. LZO_EXTERN(int)
  80. lzo1c_6_compress ( const lzo_bytep src, lzo_uint src_len,
  81. lzo_bytep dst, lzo_uintp dst_len,
  82. lzo_voidp wrkmem );
  83. LZO_EXTERN(int)
  84. lzo1c_7_compress ( const lzo_bytep src, lzo_uint src_len,
  85. lzo_bytep dst, lzo_uintp dst_len,
  86. lzo_voidp wrkmem );
  87. LZO_EXTERN(int)
  88. lzo1c_8_compress ( const lzo_bytep src, lzo_uint src_len,
  89. lzo_bytep dst, lzo_uintp dst_len,
  90. lzo_voidp wrkmem );
  91. LZO_EXTERN(int)
  92. lzo1c_9_compress ( const lzo_bytep src, lzo_uint src_len,
  93. lzo_bytep dst, lzo_uintp dst_len,
  94. lzo_voidp wrkmem );
  95. /***********************************************************************
  96. // better compression ratio at the cost of more memory and time
  97. ************************************************************************/
  98. #define LZO1C_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
  99. LZO_EXTERN(int)
  100. lzo1c_99_compress ( const lzo_bytep src, lzo_uint src_len,
  101. lzo_bytep dst, lzo_uintp dst_len,
  102. lzo_voidp wrkmem );
  103. #define LZO1C_999_MEM_COMPRESS ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
  104. LZO_EXTERN(int)
  105. lzo1c_999_compress ( const lzo_bytep src, lzo_uint src_len,
  106. lzo_bytep dst, lzo_uintp dst_len,
  107. lzo_voidp wrkmem );
  108. #ifdef __cplusplus
  109. } /* extern "C" */
  110. #endif
  111. #endif /* already included */
  112. /* vim:set ts=4 sw=4 et: */