diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-21 21:47:29 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-21 21:47:29 +0100 |
commit | 9a609dc71b03256860b746fd258e37624c54df71 (patch) | |
tree | 1b7ded823d583c69036ce72a2023452723943f13 /src | |
parent | a288a4a4a79d561cb1f52a9fef941a490931ec42 (diff) |
this library implements inflate, not deflate
Diffstat (limited to 'src')
-rw-r--r-- | src/inflate.c (renamed from src/deflate.c) | 8 | ||||
-rw-r--r-- | src/inflate.h (renamed from src/deflate.h) | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/deflate.c b/src/inflate.c index 072cc97..8e83453 100644 --- a/src/deflate.c +++ b/src/inflate.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "lib/deflate.h" +#include "lib/inflate.h" /* * The compressed (inflated) input data. @@ -370,7 +370,7 @@ static int8_t deflate_dynamic_huffman() deflate_lld_lengths + hlit, hdist); } -int16_t deflate(unsigned char *input_buf, uint16_t input_len, +int16_t inflate(unsigned char *input_buf, uint16_t input_len, unsigned char *output_buf, uint16_t output_len) { //uint8_t is_final = input_buf[0] & 0x01; @@ -405,7 +405,7 @@ int16_t deflate(unsigned char *input_buf, uint16_t input_len, return deflate_output_now - output_buf; } -int16_t deflate_zlib(unsigned char *input_buf, uint16_t input_len, +int16_t inflate_zlib(unsigned char *input_buf, uint16_t input_len, unsigned char *output_buf, uint16_t output_len) { if (input_len < 4) { @@ -427,7 +427,7 @@ int16_t deflate_zlib(unsigned char *input_buf, uint16_t input_len, } int16_t ret = - deflate(input_buf + 2, input_len - 2, output_buf, output_len); + inflate(input_buf + 2, input_len - 2, output_buf, output_len); #ifdef DEFLATE_CHECKSUM if (ret >= 0) { diff --git a/src/deflate.h b/src/inflate.h index 4ed28a0..575be4a 100644 --- a/src/deflate.h +++ b/src/inflate.h @@ -17,7 +17,7 @@ #define DEFLATE_ERR_FCHECK (-7) #define DEFLATE_ERR_NLEN (-8) -int16_t deflate(unsigned char *input_buf, uint16_t input_len, +int16_t inflate(unsigned char *input_buf, uint16_t input_len, unsigned char *output_buf, uint16_t output_len); -int16_t deflate_zlib(unsigned char *input_buf, uint16_t input_len, +int16_t inflate_zlib(unsigned char *input_buf, uint16_t input_len, unsigned char *output_buf, uint16_t output_len); |