diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2023-06-27 00:50:05 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-07-21 19:29:24 +1000 |
| commit | c2b8e6e5d685ce0ef7cd7186f326cac8a39eb2a3 (patch) | |
| tree | 8a5a10808f88e880c47a704fbd326437b139db89 /lib/uzlib/tinfgzip.c | |
| parent | 0900976384f2f881dc727f7b936c2b232e1ee6be (diff) | |
lib/uzlib: Clean up tinf -> uzlib rename.
This library used a mix of "tinf" and "uzlib" to refer to itself. Remove
all use of "tinf" in the public API.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'lib/uzlib/tinfgzip.c')
| -rw-r--r-- | lib/uzlib/tinfgzip.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/uzlib/tinfgzip.c b/lib/uzlib/tinfgzip.c index 22b000df9..3b0feb532 100644 --- a/lib/uzlib/tinfgzip.c +++ b/lib/uzlib/tinfgzip.c @@ -33,7 +33,7 @@ * any source distribution. */ -#include "tinf.h" +#include "uzlib.h" #define FTEXT 1 #define FHCRC 2 @@ -41,38 +41,38 @@ #define FNAME 8 #define FCOMMENT 16 -void tinf_skip_bytes(TINF_DATA *d, int num); -uint16_t tinf_get_uint16(TINF_DATA *d); +void tinf_skip_bytes(uzlib_uncomp_t *d, int num); +uint16_t tinf_get_uint16(uzlib_uncomp_t *d); -void tinf_skip_bytes(TINF_DATA *d, int num) +void tinf_skip_bytes(uzlib_uncomp_t *d, int num) { while (num--) uzlib_get_byte(d); } -uint16_t tinf_get_uint16(TINF_DATA *d) +uint16_t tinf_get_uint16(uzlib_uncomp_t *d) { unsigned int v = uzlib_get_byte(d); v = (uzlib_get_byte(d) << 8) | v; return v; } -int uzlib_gzip_parse_header(TINF_DATA *d) +int uzlib_gzip_parse_header(uzlib_uncomp_t *d) { unsigned char flg; /* -- check format -- */ /* check id bytes */ - if (uzlib_get_byte(d) != 0x1f || uzlib_get_byte(d) != 0x8b) return TINF_DATA_ERROR; + if (uzlib_get_byte(d) != 0x1f || uzlib_get_byte(d) != 0x8b) return UZLIB_DATA_ERROR; /* check method is deflate */ - if (uzlib_get_byte(d) != 8) return TINF_DATA_ERROR; + if (uzlib_get_byte(d) != 8) return UZLIB_DATA_ERROR; /* get flag byte */ flg = uzlib_get_byte(d); /* check that reserved bits are zero */ - if (flg & 0xe0) return TINF_DATA_ERROR; + if (flg & 0xe0) return UZLIB_DATA_ERROR; /* -- find start of compressed data -- */ @@ -99,12 +99,12 @@ int uzlib_gzip_parse_header(TINF_DATA *d) // TODO: Check! // if (hcrc != (tinf_crc32(src, start - src) & 0x0000ffff)) -// return TINF_DATA_ERROR; +// return UZLIB_DATA_ERROR; } /* initialize for crc32 checksum */ - d->checksum_type = TINF_CHKSUM_CRC; + d->checksum_type = UZLIB_CHKSUM_CRC; d->checksum = ~0; - return TINF_OK; + return UZLIB_OK; } |
