Blame lzotest/wrap.h

Packit Service 5195f2
/* wrap.h -- wrapper functions
Packit Service 5195f2
Packit Service 5195f2
   This file is part of the LZO real-time data compression library.
Packit Service 5195f2
Packit Service 5195f2
   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
Packit Service 5195f2
   All Rights Reserved.
Packit Service 5195f2
Packit Service 5195f2
   The LZO library is free software; you can redistribute it and/or
Packit Service 5195f2
   modify it under the terms of the GNU General Public License as
Packit Service 5195f2
   published by the Free Software Foundation; either version 2 of
Packit Service 5195f2
   the License, or (at your option) any later version.
Packit Service 5195f2
Packit Service 5195f2
   The LZO library is distributed in the hope that it will be useful,
Packit Service 5195f2
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 5195f2
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 5195f2
   GNU General Public License for more details.
Packit Service 5195f2
Packit Service 5195f2
   You should have received a copy of the GNU General Public License
Packit Service 5195f2
   along with the LZO library; see the file COPYING.
Packit Service 5195f2
   If not, write to the Free Software Foundation, Inc.,
Packit Service 5195f2
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit Service 5195f2
Packit Service 5195f2
   Markus F.X.J. Oberhumer
Packit Service 5195f2
   <markus@oberhumer.com>
Packit Service 5195f2
   http://www.oberhumer.com/opensource/lzo/
Packit Service 5195f2
 */
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
/*************************************************************************
Packit Service 5195f2
// compression levels of LZO1X-999 and LZO1Y-999
Packit Service 5195f2
**************************************************************************/
Packit Service 5195f2
Packit Service 5195f2
#if defined(HAVE_LZO1X_H)
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_1_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 1);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_2_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 2);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_3_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 3);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_4_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 4);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_5_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 5);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_6_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 6);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_7_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 7);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_8_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 8);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1x_999_9_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 9);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
#if defined(HAVE_LZO1Y_H)
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_1_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 1);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_2_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 2);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_3_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 3);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_4_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 4);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_5_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 5);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_6_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 6);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_7_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 7);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_8_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 8);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
lzo1y_999_9_compress    ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
Packit Service 5195f2
                                    dict.ptr, dict.len, 0, 9);
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
/*************************************************************************
Packit Service 5195f2
// other wrappers (pseudo compressors)
Packit Service 5195f2
**************************************************************************/
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
memcpy_x_compress       ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    lzo_memcpy(dst, src, src_len);
Packit Service 5195f2
    *dst_len = src_len;
Packit Service 5195f2
    LZO_UNUSED(wrkmem);
Packit Service 5195f2
    return 0;
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
memset_x_compress       ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    lzo_memset(dst, 0, src_len);
Packit Service 5195f2
    *dst_len = src_len;
Packit Service 5195f2
    LZO_UNUSED(src); LZO_UNUSED(wrkmem);
Packit Service 5195f2
    return 0;
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
adler32_x_compress      ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    lzo_uint32_t adler;
Packit Service 5195f2
    adler = lzo_adler32(0, NULL, 0);
Packit Service 5195f2
    adler = lzo_adler32(adler, dst, src_len);
Packit Service 5195f2
    *dst_len = src_len;
Packit Service 5195f2
    LZO_UNUSED(src); LZO_UNUSED(wrkmem);
Packit Service 5195f2
    return 0;
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
LZO_PRIVATE(int)
Packit Service 5195f2
crc32_x_compress        ( const lzo_bytep src, lzo_uint  src_len,
Packit Service 5195f2
                                lzo_bytep dst, lzo_uintp dst_len,
Packit Service 5195f2
                                lzo_voidp wrkmem )
Packit Service 5195f2
{
Packit Service 5195f2
    lzo_uint32_t crc;
Packit Service 5195f2
    crc = lzo_crc32(0, NULL, 0);
Packit Service 5195f2
    crc = lzo_crc32(crc, dst, src_len);
Packit Service 5195f2
    *dst_len = src_len;
Packit Service 5195f2
    LZO_UNUSED(src); LZO_UNUSED(wrkmem);
Packit Service 5195f2
    return 0;
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
#if defined(__LZO_PROFESSIONAL__)
Packit Service 5195f2
#  include "lzopro/t_wrap.ch"
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
/* vim:set ts=4 sw=4 et: */