summaryrefslogtreecommitdiff
path: root/lib/uzlib/tinfgzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uzlib/tinfgzip.c')
-rw-r--r--lib/uzlib/tinfgzip.c24
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;
}