Skip to content

Commit c2b8e6e

Browse files
jimmodpgeorge
authored andcommitted
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 <[email protected]>
1 parent 0900976 commit c2b8e6e

File tree

10 files changed

+117
-137
lines changed

10 files changed

+117
-137
lines changed

lib/uzlib/adler32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
3737
*/
3838

39-
#include "tinf.h"
39+
#include "uzlib.h"
4040

4141
#define A32_BASE 65521
4242
#define A32_NMAX 5552

lib/uzlib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
3737
*/
3838

39-
#include "tinf.h"
39+
#include "uzlib.h"
4040

4141
static const unsigned int tinf_crc32tab[16] = {
4242
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190,

lib/uzlib/tinf.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/uzlib/tinf_compat.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/uzlib/tinfgzip.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,46 @@
3333
* any source distribution.
3434
*/
3535

36-
#include "tinf.h"
36+
#include "uzlib.h"
3737

3838
#define FTEXT 1
3939
#define FHCRC 2
4040
#define FEXTRA 4
4141
#define FNAME 8
4242
#define FCOMMENT 16
4343

44-
void tinf_skip_bytes(TINF_DATA *d, int num);
45-
uint16_t tinf_get_uint16(TINF_DATA *d);
44+
void tinf_skip_bytes(uzlib_uncomp_t *d, int num);
45+
uint16_t tinf_get_uint16(uzlib_uncomp_t *d);
4646

47-
void tinf_skip_bytes(TINF_DATA *d, int num)
47+
void tinf_skip_bytes(uzlib_uncomp_t *d, int num)
4848
{
4949
while (num--) uzlib_get_byte(d);
5050
}
5151

52-
uint16_t tinf_get_uint16(TINF_DATA *d)
52+
uint16_t tinf_get_uint16(uzlib_uncomp_t *d)
5353
{
5454
unsigned int v = uzlib_get_byte(d);
5555
v = (uzlib_get_byte(d) << 8) | v;
5656
return v;
5757
}
5858

59-
int uzlib_gzip_parse_header(TINF_DATA *d)
59+
int uzlib_gzip_parse_header(uzlib_uncomp_t *d)
6060
{
6161
unsigned char flg;
6262

6363
/* -- check format -- */
6464

6565
/* check id bytes */
66-
if (uzlib_get_byte(d) != 0x1f || uzlib_get_byte(d) != 0x8b) return TINF_DATA_ERROR;
66+
if (uzlib_get_byte(d) != 0x1f || uzlib_get_byte(d) != 0x8b) return UZLIB_DATA_ERROR;
6767

6868
/* check method is deflate */
69-
if (uzlib_get_byte(d) != 8) return TINF_DATA_ERROR;
69+
if (uzlib_get_byte(d) != 8) return UZLIB_DATA_ERROR;
7070

7171
/* get flag byte */
7272
flg = uzlib_get_byte(d);
7373

7474
/* check that reserved bits are zero */
75-
if (flg & 0xe0) return TINF_DATA_ERROR;
75+
if (flg & 0xe0) return UZLIB_DATA_ERROR;
7676

7777
/* -- find start of compressed data -- */
7878

@@ -99,12 +99,12 @@ int uzlib_gzip_parse_header(TINF_DATA *d)
9999

100100
// TODO: Check!
101101
// if (hcrc != (tinf_crc32(src, start - src) & 0x0000ffff))
102-
// return TINF_DATA_ERROR;
102+
// return UZLIB_DATA_ERROR;
103103
}
104104

105105
/* initialize for crc32 checksum */
106-
d->checksum_type = TINF_CHKSUM_CRC;
106+
d->checksum_type = UZLIB_CHKSUM_CRC;
107107
d->checksum = ~0;
108108

109-
return TINF_OK;
109+
return UZLIB_OK;
110110
}

0 commit comments

Comments
 (0)