From 5da14042f70711ea5cf66e034699730335462f66 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 14:08:03 +0200 Subject: Merging upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- src/fluent-bit/lib/snappy-fef67ac/snappy.h | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/fluent-bit/lib/snappy-fef67ac/snappy.h (limited to 'src/fluent-bit/lib/snappy-fef67ac/snappy.h') diff --git a/src/fluent-bit/lib/snappy-fef67ac/snappy.h b/src/fluent-bit/lib/snappy-fef67ac/snappy.h new file mode 100644 index 000000000..519120231 --- /dev/null +++ b/src/fluent-bit/lib/snappy-fef67ac/snappy.h @@ -0,0 +1,39 @@ +#ifndef _LINUX_SNAPPY_H +#define _LINUX_SNAPPY_H 1 + +#include +#include + +/* Only needed for compression. This preallocates the worst case */ +struct snappy_env { + unsigned short *hash_table; + void *scratch; + void *scratch_output; +}; + +struct iovec; +int snappy_init_env(struct snappy_env *env); +int snappy_init_env_sg(struct snappy_env *env, bool sg); +void snappy_free_env(struct snappy_env *env); +int snappy_uncompress_iov(struct iovec *iov_in, int iov_in_len, + size_t input_len, char *uncompressed); +int snappy_uncompress(const char *compressed, size_t n, char *uncompressed); +int snappy_compress(struct snappy_env *env, + const char *input, + size_t input_length, + char *compressed, + size_t *compressed_length); +int snappy_compress_iov(struct snappy_env *env, + struct iovec *iov_in, + int iov_in_len, + size_t input_length, + struct iovec *iov_out, + int *iov_out_len, + size_t *compressed_length); +bool snappy_uncompressed_length(const char *buf, size_t len, size_t *result); +size_t snappy_max_compressed_length(size_t source_len); + + + + +#endif -- cgit v1.2.3