| 1 | /* SPDX-License-Identifier: GPL-2.0+ OR MIT */ |
| 2 | /* |
| 3 | * Copyright (c) 2022 Corellium LLC |
| 4 | * |
| 5 | * Author: Ernesto A. Fernández <[email protected]> |
| 6 | * |
| 7 | * Ported from libzbitmap (https://github.com/eafer/libzbitmap). Only the |
| 8 | * decompression code is included. |
| 9 | */ |
| 10 | |
| 11 | #ifndef _LIBZBITMAP_H |
| 12 | #define _LIBZBITMAP_H |
| 13 | |
| 14 | #include <linux/errno.h> |
| 15 | #include <linux/types.h> |
| 16 | |
| 17 | /** |
| 18 | * zbm_decompress - Decompress an LZBITMAP buffer |
| 19 | * @dest: destination buffer (may be NULL) |
| 20 | * @dest_size: size of the destination buffer |
| 21 | * @src: source buffer |
| 22 | * @src_size: size of the source buffer |
| 23 | * @out_len: on return, the length of the decompressed output |
| 24 | * |
| 25 | * May be called with a NULL destination buffer to retrieve the expected length |
| 26 | * of the decompressed data. Returns 0 on success, or a negative error code in |
| 27 | * case of failure. |
| 28 | */ |
| 29 | int zbm_decompress(void *dest, size_t dest_size, const void *src, size_t src_size, size_t *out_len); |
| 30 | |
| 31 | #endif /* _LIBZBITMAP_H */ |