#include "fastlz.h"
#include <stdint.h>
#define FASTLZ_SAFE
#if defined(FASTLZ_USE_SAFE_DECOMPRESSOR) && (FASTLZ_USE_SAFE_DECOMPRESSOR == 0)
#undef FASTLZ_SAFE
#endif
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2))
#define FASTLZ_LIKELY(c) …
#define FASTLZ_UNLIKELY(c) …
#else
#define FASTLZ_LIKELY …
#define FASTLZ_UNLIKELY …
#endif
#if defined(FASTLZ_SAFE)
#define FASTLZ_BOUND_CHECK(cond) …
#else
#define FASTLZ_BOUND_CHECK …
#endif
#define MAX_COPY …
#define MAX_LEN …
#define MAX_L1_DISTANCE …
#define MAX_L2_DISTANCE …
#define MAX_FARDISTANCE …
#define FASTLZ_READU16(p) …
#define HASH_LOG …
#define HASH_SIZE …
#define HASH_MASK …
#define HASH_FUNCTION(v, p) …
int fastlz1_compress(const void* input, int length, void* output) { … }
#if defined(FASTLZ_USE_MEMMOVE) && (FASTLZ_USE_MEMMOVE == 0)
static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) {
do {
*dest++ = *src++;
} while (--count);
}
static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) {
return fastlz_memmove(dest, src, count);
}
#else
#include <string.h>
static void fastlz_memmove(uint8_t* dest, const uint8_t* src, uint32_t count) { … }
static void fastlz_memcpy(uint8_t* dest, const uint8_t* src, uint32_t count) { … }
#endif
int fastlz1_decompress(const void* input, int length, void* output,
int maxout) { … }
int fastlz2_compress(const void* input, int length, void* output) { … }
int fastlz2_decompress(const void* input, int length, void* output,
int maxout) { … }
int fastlz_compress(const void* input, int length, void* output) { … }
int fastlz_decompress(const void* input, int length, void* output, int maxout) { … }
int fastlz_compress_level(int level, const void* input, int length,
void* output) { … }