linux/include/linux/lzo.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LZO_H__
#define __LZO_H__
/*
 *  LZO Public Kernel Interface
 *  A mini subset of the LZO real-time data compression library
 *
 *  Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <[email protected]>
 *
 *  The full LZO package can be found at:
 *  http://www.oberhumer.com/opensource/lzo/
 *
 *  Changed for Linux kernel use by:
 *  Nitin Gupta <[email protected]>
 *  Richard Purdie <[email protected]>
 */

#define LZO1X_1_MEM_COMPRESS
#define LZO1X_MEM_COMPRESS

#define lzo1x_worst_compress(x)

/* This requires 'wrkmem' of size LZO1X_1_MEM_COMPRESS */
int lzo1x_1_compress(const unsigned char *src, size_t src_len,
		     unsigned char *dst, size_t *dst_len, void *wrkmem);

/* This requires 'wrkmem' of size LZO1X_1_MEM_COMPRESS */
int lzorle1x_1_compress(const unsigned char *src, size_t src_len,
		     unsigned char *dst, size_t *dst_len, void *wrkmem);

/* safe decompression with overrun testing */
int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
			  unsigned char *dst, size_t *dst_len);

/*
 * Return values (< 0 = Error)
 */
#define LZO_E_OK
#define LZO_E_ERROR
#define LZO_E_OUT_OF_MEMORY
#define LZO_E_NOT_COMPRESSIBLE
#define LZO_E_INPUT_OVERRUN
#define LZO_E_OUTPUT_OVERRUN
#define LZO_E_LOOKBEHIND_OVERRUN
#define LZO_E_EOF_NOT_FOUND
#define LZO_E_INPUT_NOT_CONSUMED
#define LZO_E_NOT_YET_IMPLEMENTED
#define LZO_E_INVALID_ARGUMENT

#endif