#ifndef LIBBZ3_H
#define LIBBZ3_H
#include <stddef.h>
#include <stdint.h>
#ifndef BZIP3_VISIBLE
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
#define BZIP3_VISIBLE __attribute__((visibility("default")))
#else
#define BZIP3_VISIBLE
#endif
#endif
#if defined(BZIP3_DLL_EXPORT) && (BZIP3_DLL_EXPORT == 1)
#define BZIP3_API __declspec(dllexport) BZIP3_VISIBLE
#elif defined(BZIP3_DLL_IMPORT) && (BZIP3_DLL_IMPORT == 1)
#define BZIP3_API __declspec(dllimport) BZIP3_VISIBLE
#else
#define BZIP3_API BZIP3_VISIBLE
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define BZ3_OK 0
#define BZ3_ERR_OUT_OF_BOUNDS -1
#define BZ3_ERR_BWT -2
#define BZ3_ERR_CRC -3
#define BZ3_ERR_MALFORMED_HEADER -4
#define BZ3_ERR_TRUNCATED_DATA -5
#define BZ3_ERR_DATA_TOO_BIG -6
#define BZ3_ERR_INIT -7
#define BZ3_ERR_DATA_SIZE_TOO_SMALL -8
struct bz3_state;
BZIP3_API const char * bz3_version(void);
BZIP3_API int8_t bz3_last_error(struct bz3_state * state);
BZIP3_API const char * bz3_strerror(struct bz3_state * state);
BZIP3_API struct bz3_state * bz3_new(int32_t block_size);
BZIP3_API void bz3_free(struct bz3_state * state);
BZIP3_API size_t bz3_bound(size_t input_size);
BZIP3_API int bz3_compress(uint32_t block_size, const uint8_t * in, uint8_t * out, size_t in_size, size_t * out_size);
BZIP3_API int bz3_decompress(const uint8_t * in, uint8_t * out, size_t in_size, size_t * out_size);
BZIP3_API size_t bz3_min_memory_needed(int32_t block_size);
BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size);
BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, size_t buffer_size, int32_t compressed_size, int32_t orig_size);
BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n);
BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], size_t buffer_sizes[], int32_t sizes[],
int32_t orig_sizes[], int32_t n);
BZIP3_API int bz3_orig_size_sufficient_for_decode(const uint8_t * block, size_t block_size, int32_t orig_size);
#ifdef __cplusplus
}
#endif
#endif