Home | History | Annotate | Download | only in lzo
      1 /* lzo1c.h -- public interface of the LZO1C compression algorithm
      2 
      3    This file is part of the LZO real-time data compression library.
      4 
      5    Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
      6    All Rights Reserved.
      7 
      8    The LZO library is free software; you can redistribute it and/or
      9    modify it under the terms of the GNU General Public License as
     10    published by the Free Software Foundation; either version 2 of
     11    the License, or (at your option) any later version.
     12 
     13    The LZO library is distributed in the hope that it will be useful,
     14    but WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16    GNU General Public License for more details.
     17 
     18    You should have received a copy of the GNU General Public License
     19    along with the LZO library; see the file COPYING.
     20    If not, write to the Free Software Foundation, Inc.,
     21    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     22 
     23    Markus F.X.J. Oberhumer
     24    <markus (at) oberhumer.com>
     25    http://www.oberhumer.com/opensource/lzo/
     26  */
     27 
     28 
     29 #ifndef __LZO1C_H_INCLUDED
     30 #define __LZO1C_H_INCLUDED 1
     31 
     32 #ifndef __LZOCONF_H_INCLUDED
     33 #include "lzoconf.h"
     34 #endif
     35 
     36 #ifdef __cplusplus
     37 extern "C" {
     38 #endif
     39 
     40 
     41 /***********************************************************************
     42 //
     43 ************************************************************************/
     44 
     45 /* Memory required for the wrkmem parameter.
     46  * When the required size is 0, you can also pass a NULL pointer.
     47  */
     48 
     49 #define LZO1C_MEM_COMPRESS      ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
     50 #define LZO1C_MEM_DECOMPRESS    (0)
     51 
     52 
     53 /* compression levels */
     54 #define LZO1C_BEST_SPEED             1
     55 #define LZO1C_BEST_COMPRESSION       9
     56 #define LZO1C_DEFAULT_COMPRESSION  (-1)     /* fastest by default */
     57 
     58 
     59 LZO_EXTERN(int)
     60 lzo1c_compress          ( const lzo_bytep src, lzo_uint  src_len,
     61                                 lzo_bytep dst, lzo_uintp dst_len,
     62                                 lzo_voidp wrkmem,
     63                                 int compression_level );
     64 
     65 /* decompression */
     66 LZO_EXTERN(int)
     67 lzo1c_decompress        ( const lzo_bytep src, lzo_uint  src_len,
     68                                 lzo_bytep dst, lzo_uintp dst_len,
     69                                 lzo_voidp wrkmem /* NOT USED */ );
     70 
     71 /* safe decompression with overrun testing */
     72 LZO_EXTERN(int)
     73 lzo1c_decompress_safe   ( const lzo_bytep src, lzo_uint  src_len,
     74                                 lzo_bytep dst, lzo_uintp dst_len,
     75                                 lzo_voidp wrkmem /* NOT USED */ );
     76 
     77 
     78 /***********************************************************************
     79 //
     80 ************************************************************************/
     81 
     82 LZO_EXTERN(int)
     83 lzo1c_1_compress        ( const lzo_bytep src, lzo_uint  src_len,
     84                                 lzo_bytep dst, lzo_uintp dst_len,
     85                                 lzo_voidp wrkmem );
     86 LZO_EXTERN(int)
     87 lzo1c_2_compress        ( const lzo_bytep src, lzo_uint  src_len,
     88                                 lzo_bytep dst, lzo_uintp dst_len,
     89                                 lzo_voidp wrkmem );
     90 LZO_EXTERN(int)
     91 lzo1c_3_compress        ( const lzo_bytep src, lzo_uint  src_len,
     92                                 lzo_bytep dst, lzo_uintp dst_len,
     93                                 lzo_voidp wrkmem );
     94 LZO_EXTERN(int)
     95 lzo1c_4_compress        ( const lzo_bytep src, lzo_uint  src_len,
     96                                 lzo_bytep dst, lzo_uintp dst_len,
     97                                 lzo_voidp wrkmem );
     98 LZO_EXTERN(int)
     99 lzo1c_5_compress        ( const lzo_bytep src, lzo_uint  src_len,
    100                                 lzo_bytep dst, lzo_uintp dst_len,
    101                                 lzo_voidp wrkmem );
    102 LZO_EXTERN(int)
    103 lzo1c_6_compress        ( const lzo_bytep src, lzo_uint  src_len,
    104                                 lzo_bytep dst, lzo_uintp dst_len,
    105                                 lzo_voidp wrkmem );
    106 LZO_EXTERN(int)
    107 lzo1c_7_compress        ( const lzo_bytep src, lzo_uint  src_len,
    108                                 lzo_bytep dst, lzo_uintp dst_len,
    109                                 lzo_voidp wrkmem );
    110 LZO_EXTERN(int)
    111 lzo1c_8_compress        ( const lzo_bytep src, lzo_uint  src_len,
    112                                 lzo_bytep dst, lzo_uintp dst_len,
    113                                 lzo_voidp wrkmem );
    114 LZO_EXTERN(int)
    115 lzo1c_9_compress        ( const lzo_bytep src, lzo_uint  src_len,
    116                                 lzo_bytep dst, lzo_uintp dst_len,
    117                                 lzo_voidp wrkmem );
    118 
    119 
    120 /***********************************************************************
    121 // better compression ratio at the cost of more memory and time
    122 ************************************************************************/
    123 
    124 #define LZO1C_99_MEM_COMPRESS   ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
    125 
    126 LZO_EXTERN(int)
    127 lzo1c_99_compress       ( const lzo_bytep src, lzo_uint  src_len,
    128                                 lzo_bytep dst, lzo_uintp dst_len,
    129                                 lzo_voidp wrkmem );
    130 
    131 
    132 #define LZO1C_999_MEM_COMPRESS  ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
    133 
    134 LZO_EXTERN(int)
    135 lzo1c_999_compress      ( const lzo_bytep src, lzo_uint  src_len,
    136                                 lzo_bytep dst, lzo_uintp dst_len,
    137                                 lzo_voidp wrkmem );
    138 
    139 
    140 
    141 #ifdef __cplusplus
    142 } /* extern "C" */
    143 #endif
    144 
    145 #endif /* already included */
    146 
    147 
    148 /* vim:set ts=4 et: */
    149