diff -urN zlib-1.2.3\crc32.c zlib.123\crc32.c --- zlib-1.2.3\crc32.c Mon Jun 13 09:56:08 2005 +++ zlib.123\crc32.c Fri Oct 14 12:18:50 2005 @@ -57,9 +57,13 @@ (((w)&0xff00)<<8)+(((w)&0xff)<<24)) local unsigned long crc32_little OF((unsigned long, const unsigned char FAR *, unsigned)); +# ifndef SHSUCDRD local unsigned long crc32_big OF((unsigned long, const unsigned char FAR *, unsigned)); # define TBLS 8 +# else +# define TBLS 4 +# endif #else # define TBLS 1 #endif /* BYFOUR */ @@ -138,7 +142,7 @@ c = crc_table[0][n]; crc_table[4][n] = REV(c); for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); + c = crc_table[0][(Byte)c] ^ (c >> 8); crc_table[k][n] = c; crc_table[k + 4][n] = REV(c); } @@ -199,6 +203,7 @@ #include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ +#ifndef SHSUCDRD /* ========================================================================= * This function can be used by asm versions of crc32() */ @@ -210,6 +215,7 @@ #endif /* DYNAMIC_CRC_TABLE */ return (const unsigned long FAR *)crc_table; } +#endif /* ========================================================================= */ #define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) @@ -228,6 +234,9 @@ make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ +#ifdef SHSUCDRD + return crc32_little(crc, buf, len); +#else #ifdef BYFOUR if (sizeof(void *) == sizeof(ptrdiff_t)) { u4 endian; @@ -248,14 +257,15 @@ DO1; } while (--len); return crc ^ 0xffffffffUL; +#endif /* SHSUCDRD */ } #ifdef BYFOUR /* ========================================================================= */ #define DOLIT4 c ^= *buf4++; \ - c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ - crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] + c = crc_table[3][(Byte)c] ^ crc_table[2][(Byte)(c >> 8)] ^ \ + crc_table[1][(Byte)(c >> 16)] ^ crc_table[0][(Byte)(c >> 24)] #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 /* ========================================================================= */ @@ -270,7 +280,7 @@ c = (u4)crc; c = ~c; while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + c = crc_table[0][(Byte)(c ^ *buf++)] ^ (c >> 8); len--; } @@ -286,12 +296,13 @@ buf = (const unsigned char FAR *)buf4; if (len) do { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + c = crc_table[0][(Byte)(c ^ *buf++)] ^ (c >> 8); } while (--len); c = ~c; return (unsigned long)c; } +#ifndef SHSUCDRD /* ========================================================================= */ #define DOBIG4 c ^= *++buf4; \ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ @@ -333,6 +344,8 @@ c = ~c; return (unsigned long)(REV(c)); } + +#endif /* SHSUCDRD */ #endif /* BYFOUR */ diff -urN zlib-1.2.3\crc32.h zlib.123\crc32.h --- zlib-1.2.3\crc32.h Mon Jan 06 02:53:34 2003 +++ zlib.123\crc32.h Fri Oct 14 12:14:38 2005 @@ -220,6 +220,7 @@ 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, 0xde0506f1UL +#ifndef SHSUCDRD }, { 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, @@ -436,6 +437,7 @@ 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, 0xf10605deUL +#endif #endif } }; diff -urN zlib-1.2.3\gzi.c zlib.123\gzi.c --- zlib-1.2.3\gzi.c Thu Jan 01 10:00:00 1970 +++ zlib.123\gzi.c Fri Oct 14 12:14:38 2005 @@ -0,0 +1,332 @@ +/* gzio.c -- IO on .gz files + * Copyright (C) 1995-2003 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Stripped down version to just gunzip one file at a time, on 16-bit DOS + * (small model), without any C library functions. (Developed with BC, probably + * requires modifications for other compilers.) + * Jason Hood, March 2005. + */ + +#include "zutil.h" + +#define FILE int +#define EOF (-1) +#define size_t unsigned int +local int errno; +local FILE hopen( const char* ); +local size_t hread( void*, size_t ); +local int hclose( void ); + + +#define Z_BUFSIZE 16384 + +#define gz_magic 0x8b1fu /* gzip magic header */ + +/* gzip flag byte */ +#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define COMMENT 0x10 /* bit 4 set: file comment present */ +#define RESERVED 0xE0 /* bits 5..7: reserved */ + +typedef struct gz_stream { + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE file; /* .gz file */ + uLong crc; /* crc32 of uncompressed data */ + int transparent; /* 1 if input file is not a .gz file */ +} gz_stream; + +local gz_stream s; +local Byte gzbuf[Z_BUFSIZE]; + + int gz_open (const char* path); + int gz_read (voidp buf, unsigned len); + int gz_close (void); +local int get_byte (void); +local void check_header (void); +local uLong getLong (void); + +/* =========================================================================== + Opens a gzip (.gz) file for reading. + gz_open returns -1 if the file could not be opened, 0 if gzip, 1 if not. +*/ +int gz_open(const char* path) +{ + s.crc = // crc32(0L, Z_NULL, 0) == 0 + s.z_err = + s.z_eof = + s.transparent = 0; + + inflateInit2(&(s.stream), -MAX_WBITS); + s.stream.avail_out = Z_BUFSIZE; + + s.file = hopen(path); + + if (s.file == 0) { + return -1; + } + + check_header(); /* skip the .gz header */ + + return s.transparent; +} + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ +local int get_byte(void) +{ + if (s.z_eof) return EOF; + if (s.stream.avail_in == 0) { + errno = 0; + s.stream.avail_in = hread(gzbuf, Z_BUFSIZE); + if (s.stream.avail_in == 0) { + s.z_eof = 1; + if (errno) s.z_err = Z_ERRNO; + return EOF; + } + s.stream.next_in = gzbuf; + } + s.stream.avail_in--; + return *(s.stream.next_in)++; +} + +/* =========================================================================== + Check the gzip header of a gz_stream opened for reading. Set the stream + mode to transparent if the gzip magic header is not present; set s.err + to Z_DATA_ERROR if the magic header is present but the rest of the header + is incorrect. + IN assertion: the stream s has already been created sucessfully. +*/ +local void check_header(void) +{ + int method; /* method byte */ + int flags; /* flags byte */ + uInt len; + int c; + + errno = 0; + s.stream.avail_in = hread(gzbuf, Z_BUFSIZE); + if (s.stream.avail_in == 0 && errno) s.z_err = Z_ERRNO; + s.stream.next_in = gzbuf; + if (s.stream.avail_in < 2 || + *(uInt*)gzbuf != gz_magic) { + s.transparent = 1; + return; + } + s.stream.avail_in -= 2; + s.stream.next_in += 2; + + /* Check the rest of the gzip header */ + method = get_byte(); + flags = get_byte(); + if (method != Z_DEFLATED || (flags & RESERVED) != 0) { + s.z_err = Z_DATA_ERROR; + return; + } + + /* Discard time, xflags and OS code: */ + getLong(); + get_byte(); + get_byte(); + + if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ + len = (uInt)get_byte(); + len += ((uInt)get_byte())<<8; + /* len is garbage if EOF but the loop below will quit anyway */ + while (len-- != 0 && get_byte() != EOF) ; + } + if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ + while ((c = get_byte()) != 0 && c != EOF) ; + } + if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ + while ((c = get_byte()) != 0 && c != EOF) ; + } + if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ + get_byte(); + get_byte(); + } + s.z_err = s.z_eof ? Z_DATA_ERROR : Z_OK; +} + + /* =========================================================================== + * Cleanup then free the given gz_stream. Return a zlib error code. + */ +int gz_close (void) +{ + int err = Z_OK; + + if (hclose()) { + err = Z_ERRNO; + } + if (s.z_err < 0) err = s.z_err; + + return err; +} + +/* =========================================================================== + Reads the given number of uncompressed bytes from the compressed file. + gzread returns the number of bytes actually read (0 for end of file). +*/ +int gz_read (buf, len) + voidp buf; + unsigned len; +{ + Bytef *start = (Bytef*)buf; /* starting point for crc computation */ + Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ + + if (s.z_err == Z_DATA_ERROR || s.z_err == Z_ERRNO) return -1; + if (s.z_err == Z_STREAM_END) return 0; /* EOF */ + + next_out = (Byte*)buf; + s.stream.next_out = (Bytef*)buf; + s.stream.avail_out = len; + + while (s.stream.avail_out != 0) { + + if (s.transparent) { + /* Copy first the lookahead bytes: */ + uInt n = s.stream.avail_in; + if (n > s.stream.avail_out) n = s.stream.avail_out; + if (n > 0) { + zmemcpy(s.stream.next_out, s.stream.next_in, n); + next_out += n; + s.stream.next_out = next_out; + s.stream.next_in += n; + s.stream.avail_out -= n; + s.stream.avail_in -= n; + } + if (s.stream.avail_out > 0) { + s.stream.avail_out -= hread(next_out, s.stream.avail_out); + } + len -= s.stream.avail_out; + if (len == 0) s.z_eof = 1; + return (int)len; + } + if (s.stream.avail_in == 0 && !s.z_eof) { + + errno = 0; + s.stream.avail_in = hread(gzbuf, Z_BUFSIZE); + if (s.stream.avail_in == 0) { + s.z_eof = 1; + if (errno) { + s.z_err = Z_ERRNO; + break; + } + } + s.stream.next_in = gzbuf; + } + s.z_err = inflate(&(s.stream), Z_NO_FLUSH); + + if (s.z_err != Z_OK || s.z_eof) break; + } + s.crc = crc32(s.crc, start, (uInt)(s.stream.next_out - start)); + + if (s.z_err == Z_STREAM_END) { + if (getLong() != s.crc) { + s.z_err = Z_DATA_ERROR; + return -1; + } + } + + return (int)(len - s.stream.avail_out); +} + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets z_err in case + of error. +*/ +#pragma warn -rvl +local uLong getLong (void) +{ +/* + uLong x = (uLong)get_byte(); + int c; + + x += ((uLong)get_byte())<<8; + x += ((uLong)get_byte())<<16; + c = get_byte(); + if (c == EOF) s.z_err = Z_DATA_ERROR; + x += ((uLong)c)<<24; + return x; +*/ + asm { + mov si, offset get_byte // automatically preserved + call si // call near ptr get_byte not working + mov cl, al + call si + mov ch, al + call si + mov dl, al + call si + mov dh, al + cmp al, EOF + xchg cx, ax + jne out + mov word ptr s.z_err, Z_DATA_ERROR + } + out: +} + + +/* =========================================================================== + Simple file functions to remove C library dependence. +*/ +local FILE hopen( const char* name ) +{ + asm { + mov ax, 0x3dc0 + mov dx, name + int 0x21 + jnc out + sub ax, ax + } + out: +} + +local size_t hread( void* buf, size_t len ) +{ + asm { + mov ah, 0x3f + mov bx, word ptr s.file + mov cx, len + mov dx, buf + int 0x21 + jnc out + mov errno, ax + sub ax, ax + } + out: +} + +local int hclose( void ) +{ + asm { + mov ah, 0x3e + mov bx, word ptr s.file + int 0x21 + db 0xd6 //setalc + cbw + } +} + + +// Avoid needing zutil.c +void zmemcpy(Byte FAR_ * dest, const Byte* source, uInt len) +{ + asm { + mov si, source // si & di automatically preserved + les di, dest + mov cx, len + shr cx, 1 + rep movsw + adc cx, cx + rep movsb + } +} diff -urN zlib-1.2.3\inffast.c zlib.123\inffast.c --- zlib-1.2.3\inffast.c Sat Nov 13 16:05:30 2004 +++ zlib.123\inffast.c Fri Oct 14 12:14:38 2005 @@ -80,7 +80,7 @@ unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned char FAR_ *window; /* allocated sliding window, if wsize != 0 */ unsigned long hold; /* local strm->hold */ unsigned bits; /* local strm->bits */ code const FAR *lcode; /* local strm->lencode */ @@ -92,7 +92,7 @@ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ + unsigned char FAR_ *from; /* where to copy match from */ /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; @@ -124,7 +124,7 @@ hold += (unsigned long)(PUP(in)) << bits; bits += 8; } - this = lcode[hold & lmask]; + this = lcode[(uInt)hold & lmask]; dolen: op = (unsigned)(this.bits); hold >>= op; @@ -155,7 +155,7 @@ hold += (unsigned long)(PUP(in)) << bits; bits += 8; } - this = dcode[hold & dmask]; + this = dcode[(uInt)hold & dmask]; dodist: op = (unsigned)(this.bits); hold >>= op; @@ -259,7 +259,7 @@ } } else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((1U << op) - 1))]; + this = dcode[this.val + ((uInt)hold & ((1U << op) - 1))]; goto dodist; } else { @@ -269,7 +269,7 @@ } } else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((1U << op) - 1))]; + this = lcode[this.val + ((uInt)hold & ((1U << op) - 1))]; goto dolen; } else if (op & 32) { /* end-of-block */ diff -urN zlib-1.2.3\inflate.c zlib.123\inflate.c --- zlib-1.2.3\inflate.c Wed Jun 15 07:50:12 2005 +++ zlib.123\inflate.c Fri Oct 14 12:37:12 2005 @@ -91,14 +91,21 @@ # endif #endif +#ifdef SHSUCDRD +local struct inflate_state infst; +local unsigned char FAR_ stwnd[1u << MAX_WBITS]; +#endif + /* function prototypes */ local void fixedtables OF((struct inflate_state FAR *state)); local int updatewindow OF((z_streamp strm, unsigned out)); #ifdef BUILDFIXED void makefixed OF((void)); #endif +#ifndef SHSUCDRD local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, unsigned len)); +#endif int ZEXPORT inflateReset(strm) z_streamp strm; @@ -135,7 +142,7 @@ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; + value &= (1 << bits) - 1; state->hold += value << state->bits; state->bits += bits; return Z_OK; @@ -154,6 +161,7 @@ return Z_VERSION_ERROR; if (strm == Z_NULL) return Z_STREAM_ERROR; strm->msg = Z_NULL; /* in case we return an error */ +#ifndef SHSUCDRD if (strm->zalloc == (alloc_func)0) { strm->zalloc = zcalloc; strm->opaque = (voidpf)0; @@ -162,12 +170,16 @@ state = (struct inflate_state FAR *) ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; +#else + state = &infst; +#endif Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; if (windowBits < 0) { state->wrap = 0; windowBits = -windowBits; } +#ifndef SHSUCDRD else { state->wrap = (windowBits >> 4) + 1; #ifdef GUNZIP @@ -179,11 +191,17 @@ strm->state = Z_NULL; return Z_STREAM_ERROR; } +#endif state->wbits = (unsigned)windowBits; +#ifndef SHSUCDRD state->window = Z_NULL; +#else + state->window = stwnd; +#endif return inflateReset(strm); } +#ifndef SHSUCDRD int ZEXPORT inflateInit_(strm, version, stream_size) z_streamp strm; const char *version; @@ -191,6 +209,7 @@ { return inflateInit2_(strm, DEF_WBITS, version, stream_size); } +#endif /* Return state with length and distance decoding tables and index sizes set to @@ -329,6 +348,7 @@ state = (struct inflate_state FAR *)strm->state; +#ifndef SHSUCDRD /* if it hasn't been done already, allocate space for the window */ if (state->window == Z_NULL) { state->window = (unsigned char FAR *) @@ -336,6 +356,7 @@ sizeof(unsigned char)); if (state->window == Z_NULL) return 1; } +#endif /* if window not in use yet, initialize */ if (state->wsize == 0) { @@ -373,12 +394,17 @@ /* Macros for inflate(): */ /* check function to use adler32() for zlib or crc32() for gzip */ +#ifdef SHSUCDRD +# define UPDATE(check, buf, len) crc32(check, buf, len) +# define adler32(check, buf, len) 1L +#else #ifdef GUNZIP # define UPDATE(check, buf, len) \ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) #else # define UPDATE(check, buf, len) adler32(check, buf, len) #endif +#endif /* check macros for header crc */ #ifdef GUNZIP @@ -563,12 +589,12 @@ unsigned bits; /* bits in bit buffer */ unsigned in, out; /* save starting available input and output */ unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ + unsigned char FAR_ *from; /* where to copy match bytes from */ code this; /* current decoding table entry */ code last; /* parent table entry */ unsigned len; /* length to copy for repeats, bits to drop */ int ret; /* return code */ -#ifdef GUNZIP +#if defined(GUNZIP) && !defined(SHSUCDRD) unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ #endif static const unsigned short order[19] = /* permutation of code lengths */ @@ -591,6 +617,7 @@ state->mode = TYPEDO; break; } +#ifndef SHSUCDRD NEEDBITS(16); #ifdef GUNZIP if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ @@ -770,6 +797,7 @@ } strm->adler = state->check = adler32(0L, Z_NULL, 0); state->mode = TYPE; +#endif case TYPE: if (flush == Z_BLOCK) goto inf_leave; case TYPEDO: @@ -1152,6 +1180,7 @@ return ret; } +#ifndef SHSUCDRD int ZEXPORT inflateEnd(strm) z_streamp strm; { @@ -1366,3 +1395,4 @@ dest->state = (struct internal_state FAR *)copy; return Z_OK; } +#endif diff -urN zlib-1.2.3\inflate.h zlib.123\inflate.h --- zlib-1.2.3\inflate.h Sat Nov 13 15:38:28 2004 +++ zlib.123\inflate.h Fri Oct 14 12:14:38 2005 @@ -89,7 +89,7 @@ unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ + unsigned char FAR_ *window; /* allocated sliding window, if needed */ /* bit accumulator */ unsigned long hold; /* input bit accumulator */ unsigned bits; /* number of bits in "in" */ diff -urN zlib-1.2.3\Makefile.cdr zlib.123\Makefile.cdr --- zlib-1.2.3\Makefile.cdr Thu Jan 01 10:00:00 1970 +++ zlib.123\Makefile.cdr Fri Oct 14 12:14:38 2005 @@ -0,0 +1,53 @@ +# Makefile for zlibcdrd +# Borland C++ +# Last updated: 31-May-2005 + +# To use, do "make -fmakefile.cdr" + +# ------------ Turbo C++, Borland C++ ------------ + +# replace bcc with tcc for Turbo C++ 1.0 +CC=bcc +LD=bcc +AR=tlib + +# compiler flags +# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0 +# BC3.1 does not like -Om. +CFLAGS=-O2 -O-m -Z -ms -DSHSUCDRD -2 + +LDFLAGS=-ms -f- + + +# variables +ZLIB_LIB = zlibcdrd.lib + +OBJ1 = crc32.obj gzi.obj inffast.obj inflate.obj inftrees.obj +OBJP1 = +crc32.obj+gzi.obj+inffast.obj+inflate.obj+inftrees.obj + + +# targets +all: $(ZLIB_LIB) + +.c.obj: + $(CC) -c $(CFLAGS) $*.c + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +gzi.obj: gzi.c zutil.h zlib.h zconf.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h \ + inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + + +$(ZLIB_LIB): $(OBJ1) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + +clean: + -del *.obj + -del *.lib diff -urN zlib-1.2.3\zconf.h zlib.123\zconf.h --- zlib-1.2.3\zconf.h Sat May 28 16:40:36 2005 +++ zlib.123\zconf.h Fri Oct 14 12:14:38 2005 @@ -182,19 +182,22 @@ /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER -# define FAR _far +# define FAR_ _far # else -# define FAR far +# define FAR_ far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ -# define FAR _far +# define FAR_ _far # else -# define FAR far +# define FAR_ far # endif +# endif +# if defined(FAR_) && !defined(SHSUCDRD) +# define FAR FAR_ # endif #endif diff -urN zlib-1.2.3\zlib.h zlib.123\zlib.h --- zlib-1.2.3\zlib.h Mon Jul 18 12:26:50 2005 +++ zlib.123\zlib.h Fri Oct 14 12:28:04 2005 @@ -37,8 +37,8 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 +#define ZLIB_VERSION "1.2.3.f-shsucdrd" +#define ZLIB_VERNUM 0x123f /* The 'zlib' compression library provides in-memory compression and @@ -91,9 +91,11 @@ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ +#ifndef SHSUCDRD alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ +#endif int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ @@ -1342,7 +1344,7 @@ ZLIB_VERSION, sizeof(z_stream)) -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) +#if (!defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)) || defined(SHSUCDRD) struct internal_state {int dummy;}; /* hack for buggy compilers */ #endif diff -urN zlib-1.2.3\zutil.h zlib.123\zutil.h --- zlib-1.2.3\zutil.h Tue Jul 12 06:35:48 2005 +++ zlib.123\zutil.h Fri Oct 14 12:14:38 2005 @@ -232,9 +232,13 @@ # define zmemzero(dest, len) memset(dest, 0, len) # endif #else +# ifdef SHSUCDRD + extern void zmemcpy OF((Byte FAR_ * dest, const Byte* source, uInt len)); +# else extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); extern void zmemzero OF((Bytef* dest, uInt len)); +# endif #endif /* Diagnostic functions */