mirror of https://github.com/madler/zlib.git
parent
7c2a874e50
commit
13a294f044
71 changed files with 10334 additions and 4007 deletions
@ -0,0 +1,783 @@ |
||||
/* inffas86.c is a hand tuned assembler version of
|
||||
* |
||||
* inffast.c -- fast decoding |
||||
* Copyright (C) 1995-2003 Mark Adler |
||||
* For conditions of distribution and use, see copyright notice in zlib.h |
||||
* |
||||
* Copyright (C) 2003 Chris Anderson <christop@charm.net> |
||||
* Please use the copyright conditions above. |
||||
* |
||||
* Mar-13-2003 -- Most of this is derived from inffast.S which is derived from |
||||
* the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at |
||||
* the moment. I have successfully compiled and tested this code with gcc2.96, |
||||
* gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S |
||||
* compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX |
||||
* enabled. I will attempt to merge the MMX code into this version. Newer |
||||
* versions of this and inffast.S can be found at |
||||
* http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
|
||||
*/ |
||||
|
||||
#include "zutil.h" |
||||
#include "inftrees.h" |
||||
#include "inflate.h" |
||||
#include "inffast.h" |
||||
|
||||
/* Mark Adler's comments from inffast.c: */ |
||||
|
||||
/*
|
||||
Decode literal, length, and distance codes and write out the resulting |
||||
literal and match bytes until either not enough input or output is |
||||
available, an end-of-block is encountered, or a data error is encountered. |
||||
When large enough input and output buffers are supplied to inflate(), for |
||||
example, a 16K input buffer and a 64K output buffer, more than 95% of the |
||||
inflate execution time is spent in this routine. |
||||
|
||||
Entry assumptions: |
||||
|
||||
state->mode == LEN |
||||
strm->avail_in >= 6 |
||||
strm->avail_out >= 258 |
||||
start >= strm->avail_out |
||||
state->bits < 8 |
||||
|
||||
On return, state->mode is one of: |
||||
|
||||
LEN -- ran out of enough output space or enough available input |
||||
TYPE -- reached end of block code, inflate() to interpret next block |
||||
BAD -- error in block data |
||||
|
||||
Notes: |
||||
|
||||
- The maximum input bits used by a length/distance pair is 15 bits for the |
||||
length code, 5 bits for the length extra, 15 bits for the distance code, |
||||
and 13 bits for the distance extra. This totals 48 bits, or six bytes. |
||||
Therefore if strm->avail_in >= 6, then there is enough input to avoid |
||||
checking for available input while decoding. |
||||
|
||||
- The maximum bytes that a single length/distance pair can output is 258 |
||||
bytes, which is the maximum length that can be coded. inflate_fast() |
||||
requires strm->avail_out >= 258 for each loop to avoid checking for |
||||
output space. |
||||
*/ |
||||
void inflate_fast(strm, start) |
||||
z_streamp strm; |
||||
unsigned start; /* inflate()'s starting value for strm->avail_out */ |
||||
{ |
||||
struct inflate_state FAR *state; |
||||
struct inffast_ar { |
||||
void *esp; /* esp save */ |
||||
unsigned char FAR *in; /* local strm->next_in */ |
||||
unsigned char FAR *last; /* while in < last, enough input available */ |
||||
unsigned char FAR *out; /* local strm->next_out */ |
||||
unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ |
||||
unsigned char FAR *end; /* while out < end, enough space available */ |
||||
unsigned wsize; /* window size or zero if not using window */ |
||||
unsigned write; /* window write index */ |
||||
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 */ |
||||
code const FAR *dcode; /* local strm->distcode */ |
||||
unsigned lmask; /* mask for first level of length codes */ |
||||
unsigned dmask; /* mask for first level of distance codes */ |
||||
unsigned len; /* match length, unused bytes */ |
||||
unsigned dist; /* match distance */ |
||||
unsigned status; /* this is set when state changes */ |
||||
} ar; |
||||
|
||||
/* copy state to local variables */ |
||||
state = (struct inflate_state FAR *)strm->state; |
||||
ar.in = strm->next_in; |
||||
ar.last = ar.in + (strm->avail_in - 5); |
||||
ar.out = strm->next_out; |
||||
ar.beg = ar.out - (start - strm->avail_out); |
||||
ar.end = ar.out + (strm->avail_out - 257); |
||||
ar.wsize = state->wsize; |
||||
ar.write = state->write; |
||||
ar.window = state->window; |
||||
ar.hold = state->hold; |
||||
ar.bits = state->bits; |
||||
ar.lcode = state->lencode; |
||||
ar.dcode = state->distcode; |
||||
ar.lmask = (1U << state->lenbits) - 1; |
||||
ar.dmask = (1U << state->distbits) - 1; |
||||
|
||||
/* decode literals and length/distances until end-of-block or not enough
|
||||
input data or output space */ |
||||
|
||||
/* align in on 2 byte boundary */ |
||||
if (((unsigned long)(void *)ar.in & 0x1) != 0) { |
||||
ar.hold += (unsigned long)*ar.in++ << ar.bits; |
||||
ar.bits += 8; |
||||
} |
||||
|
||||
#if defined( __GNUC__ ) || defined( __ICC ) |
||||
__asm__ __volatile__ ( |
||||
" leal %0, %%eax\n" |
||||
" pushf\n" |
||||
" pushl %%ebp\n" |
||||
" movl %%esp, (%%eax)\n" |
||||
" movl %%eax, %%esp\n" |
||||
" movl 4(%%esp), %%esi\n" /* esi = in */ |
||||
" movl 12(%%esp), %%edi\n" /* edi = out */ |
||||
" movl 36(%%esp), %%edx\n" /* edx = hold */ |
||||
" movl 40(%%esp), %%ebx\n" /* ebx = bits */ |
||||
" movl 44(%%esp), %%ebp\n" /* ebp = lcode */ |
||||
|
||||
" cld\n" |
||||
" jmp .L_do_loop\n" |
||||
|
||||
".L_while_test:\n" |
||||
" cmpl %%edi, 20(%%esp)\n" |
||||
" jbe .L_break_loop\n" |
||||
" cmpl %%esi, 8(%%esp)\n" |
||||
" jbe .L_break_loop\n" |
||||
|
||||
".L_do_loop:\n" |
||||
" cmpb $15, %%bl\n" |
||||
" ja .L_get_length_code\n" /* if (15 < bits) */ |
||||
|
||||
" xorl %%eax, %%eax\n" |
||||
" lodsw\n" /* al = *(ushort *)in++ */ |
||||
" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ |
||||
" addb $16, %%bl\n" /* bits += 16 */ |
||||
" shll %%cl, %%eax\n" |
||||
" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ |
||||
|
||||
".L_get_length_code:\n" |
||||
" movl 52(%%esp), %%eax\n" /* eax = lmask */ |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */ |
||||
|
||||
".L_dolen:\n" |
||||
" movb %%ah, %%cl\n" /* cl = this.bits */ |
||||
" subb %%ah, %%bl\n" /* bits -= this.bits */ |
||||
" shrl %%cl, %%edx\n" /* hold >>= this.bits */ |
||||
|
||||
" testb %%al, %%al\n" |
||||
" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ |
||||
|
||||
" shrl $16, %%eax\n" /* output this.val char */ |
||||
" stosb\n" |
||||
" jmp .L_while_test\n" |
||||
|
||||
".L_test_for_length_base:\n" |
||||
" movl %%eax, %%ecx\n" /* len = this */ |
||||
" shrl $16, %%ecx\n" /* len = this.val */ |
||||
" movl %%ecx, 60(%%esp)\n" /* len = this */ |
||||
" movb %%al, %%cl\n" |
||||
|
||||
" testb $16, %%al\n" |
||||
" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */ |
||||
" andb $15, %%cl\n" /* op &= 15 */ |
||||
" jz .L_decode_distance\n" /* if (!op) */ |
||||
" cmpb %%cl, %%bl\n" |
||||
" jae .L_add_bits_to_len\n" /* if (op <= bits) */ |
||||
|
||||
" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ |
||||
" xorl %%eax, %%eax\n" |
||||
" lodsw\n" /* al = *(ushort *)in++ */ |
||||
" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ |
||||
" addb $16, %%bl\n" /* bits += 16 */ |
||||
" shll %%cl, %%eax\n" |
||||
" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ |
||||
" movb %%ch, %%cl\n" /* move op back to ecx */ |
||||
|
||||
".L_add_bits_to_len:\n" |
||||
" movl $1, %%eax\n" |
||||
" shll %%cl, %%eax\n" |
||||
" decl %%eax\n" |
||||
" subb %%cl, %%bl\n" |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" shrl %%cl, %%edx\n" |
||||
" addl %%eax, 60(%%esp)\n" /* len += hold & mask[op] */ |
||||
|
||||
".L_decode_distance:\n" |
||||
" cmpb $15, %%bl\n" |
||||
" ja .L_get_distance_code\n" /* if (15 < bits) */ |
||||
|
||||
" xorl %%eax, %%eax\n" |
||||
" lodsw\n" /* al = *(ushort *)in++ */ |
||||
" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ |
||||
" addb $16, %%bl\n" /* bits += 16 */ |
||||
" shll %%cl, %%eax\n" |
||||
" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ |
||||
|
||||
".L_get_distance_code:\n" |
||||
" movl 56(%%esp), %%eax\n" /* eax = dmask */ |
||||
" movl 48(%%esp), %%ecx\n" /* ecx = dcode */ |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" movl (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */ |
||||
|
||||
".L_dodist:\n" |
||||
" movl %%eax, %%ebp\n" /* dist = this */ |
||||
" shrl $16, %%ebp\n" /* dist = this.val */ |
||||
" movb %%ah, %%cl\n" |
||||
" subb %%ah, %%bl\n" /* bits -= this.bits */ |
||||
" shrl %%cl, %%edx\n" /* hold >>= this.bits */ |
||||
" movb %%al, %%cl\n" /* cl = this.op */ |
||||
|
||||
" testb $16, %%al\n" /* if ((op & 16) == 0) */ |
||||
" jz .L_test_for_second_level_dist\n" |
||||
" andb $15, %%cl\n" /* op &= 15 */ |
||||
" jz .L_check_dist_one\n" |
||||
" cmpb %%cl, %%bl\n" |
||||
" jae .L_add_bits_to_dist\n" /* if (op <= bits) 97.6% */ |
||||
|
||||
" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ |
||||
" xorl %%eax, %%eax\n" |
||||
" lodsw\n" /* al = *(ushort *)in++ */ |
||||
" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ |
||||
" addb $16, %%bl\n" /* bits += 16 */ |
||||
" shll %%cl, %%eax\n" |
||||
" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ |
||||
" movb %%ch, %%cl\n" /* move op back to ecx */ |
||||
|
||||
".L_add_bits_to_dist:\n" |
||||
" movl $1, %%eax\n" |
||||
" shll %%cl, %%eax\n" |
||||
" decl %%eax\n" /* (1 << op) - 1 */ |
||||
" subb %%cl, %%bl\n" |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" shrl %%cl, %%edx\n" |
||||
" addl %%eax, %%ebp\n" /* dist += hold & ((1 << op) - 1) */ |
||||
|
||||
".L_check_window:\n" |
||||
" movl %%esi, 4(%%esp)\n" /* save in so from can use it's reg */ |
||||
" movl %%edi, %%eax\n" |
||||
" subl 16(%%esp), %%eax\n" /* nbytes = out - beg */ |
||||
|
||||
" cmpl %%ebp, %%eax\n" |
||||
" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */ |
||||
|
||||
" movl 60(%%esp), %%ecx\n" |
||||
" movl %%edi, %%esi\n" |
||||
" subl %%ebp, %%esi\n" /* from = out - dist */ |
||||
|
||||
" subl $3, %%ecx\n" /* copy from to out */ |
||||
" movb (%%esi), %%al\n" |
||||
" movb %%al, (%%edi)\n" |
||||
" movb 1(%%esi), %%al\n" |
||||
" movb 2(%%esi), %%ah\n" |
||||
" addl $3, %%esi\n" |
||||
" movb %%al, 1(%%edi)\n" |
||||
" movb %%ah, 2(%%edi)\n" |
||||
" addl $3, %%edi\n" |
||||
" rep movsb\n" |
||||
|
||||
" movl 4(%%esp), %%esi\n" /* move in back to %esi, toss from */ |
||||
" movl 44(%%esp), %%ebp\n" /* ebp = lcode */ |
||||
" jmp .L_while_test\n" |
||||
|
||||
".L_check_dist_one:\n" |
||||
" cmpl $1, %%ebp\n" /* if dist 1, is a memset */ |
||||
" jne .L_check_window\n" |
||||
" cmpl %%edi, 16(%%esp)\n" |
||||
" je .L_check_window\n" |
||||
|
||||
" decl %%edi\n" |
||||
" movl 60(%%esp), %%ecx\n" |
||||
" movb (%%edi), %%al\n" |
||||
" subl $3, %%ecx\n" |
||||
|
||||
" movb %%al, 1(%%edi)\n" /* memset out with from[-1] */ |
||||
" movb %%al, 2(%%edi)\n" |
||||
" movb %%al, 3(%%edi)\n" |
||||
" addl $4, %%edi\n" |
||||
" rep stosb\n" |
||||
" movl 44(%%esp), %%ebp\n" /* ebp = lcode */ |
||||
" jmp .L_while_test\n" |
||||
|
||||
".L_test_for_second_level_length:\n" |
||||
" testb $64, %%al\n" |
||||
" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */ |
||||
|
||||
" movl $1, %%eax\n" |
||||
" shll %%cl, %%eax\n" |
||||
" decl %%eax\n" |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" addl 60(%%esp), %%eax\n" /* eax += this.val */ |
||||
" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/ |
||||
" jmp .L_dolen\n" |
||||
|
||||
".L_test_for_second_level_dist:\n" |
||||
" testb $64, %%al\n" |
||||
" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */ |
||||
|
||||
" movl $1, %%eax\n" |
||||
" shll %%cl, %%eax\n" |
||||
" decl %%eax\n" |
||||
" andl %%edx, %%eax\n" /* eax &= hold */ |
||||
" addl %%ebp, %%eax\n" /* eax += this.val */ |
||||
" movl 48(%%esp), %%ecx\n" /* ecx = dcode */ |
||||
" movl (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/ |
||||
" jmp .L_dodist\n" |
||||
|
||||
".L_clip_window:\n" |
||||
" movl %%eax, %%ecx\n" |
||||
" movl 24(%%esp), %%eax\n" /* prepare for dist compare */ |
||||
" negl %%ecx\n" /* nbytes = -nbytes */ |
||||
" movl 32(%%esp), %%esi\n" /* from = window */ |
||||
|
||||
" cmpl %%ebp, %%eax\n" |
||||
" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */ |
||||
|
||||
" addl %%ebp, %%ecx\n" /* nbytes = dist - nbytes */ |
||||
" cmpl $0, 28(%%esp)\n" |
||||
" jne .L_wrap_around_window\n" /* if (write != 0) */ |
||||
|
||||
" subl %%ecx, %%eax\n" |
||||
" addl %%eax, %%esi\n" /* from += wsize - nbytes */ |
||||
|
||||
" movl 60(%%esp), %%eax\n" |
||||
" cmpl %%ecx, %%eax\n" |
||||
" jbe .L_do_copy1\n" /* if (nbytes >= len) */ |
||||
|
||||
" subl %%ecx, %%eax\n" /* len -= nbytes */ |
||||
" rep movsb\n" |
||||
" movl %%edi, %%esi\n" |
||||
" subl %%ebp, %%esi\n" /* from = out - dist */ |
||||
" jmp .L_do_copy1\n" |
||||
|
||||
" cmpl %%ecx, %%eax\n" |
||||
" jbe .L_do_copy1\n" /* if (nbytes >= len) */ |
||||
|
||||
" subl %%ecx, %%eax\n" /* len -= nbytes */ |
||||
" rep movsb\n" |
||||
" movl %%edi, %%esi\n" |
||||
" subl %%ebp, %%esi\n" /* from = out - dist */ |
||||
" jmp .L_do_copy1\n" |
||||
|
||||
".L_wrap_around_window:\n" |
||||
" movl 28(%%esp), %%eax\n" |
||||
" cmpl %%eax, %%ecx\n" |
||||
" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */ |
||||
|
||||
" addl 24(%%esp), %%esi\n" |
||||
" addl %%eax, %%esi\n" |
||||
" subl %%ecx, %%esi\n" /* from += wsize + write - nbytes */ |
||||
" subl %%eax, %%ecx\n" /* nbytes -= write */ |
||||
|
||||
" movl 60(%%esp), %%eax\n" |
||||
" cmpl %%ecx, %%eax\n" |
||||
" jbe .L_do_copy1\n" /* if (nbytes >= len) */ |
||||
|
||||
" subl %%ecx, %%eax\n" /* len -= nbytes */ |
||||
" rep movsb\n" |
||||
" movl 32(%%esp), %%esi\n" /* from = window */ |
||||
" movl 28(%%esp), %%ecx\n" /* nbytes = write */ |
||||
" cmpl %%ecx, %%eax\n" |
||||
" jbe .L_do_copy1\n" /* if (nbytes >= len) */ |
||||
|
||||
" subl %%ecx, %%eax\n" /* len -= nbytes */ |
||||
" rep movsb\n" |
||||
" movl %%edi, %%esi\n" |
||||
" subl %%ebp, %%esi\n" /* from = out - dist */ |
||||
" jmp .L_do_copy1\n" |
||||
|
||||
".L_contiguous_in_window:\n" |
||||
" addl %%eax, %%esi\n" |
||||
" subl %%ecx, %%esi\n" /* from += write - nbytes */ |
||||
|
||||
" movl 60(%%esp), %%eax\n" |
||||
" cmpl %%ecx, %%eax\n" |
||||
" jbe .L_do_copy1\n" /* if (nbytes >= len) */ |
||||
|
||||
" subl %%ecx, %%eax\n" /* len -= nbytes */ |
||||
" rep movsb\n" |
||||
" movl %%edi, %%esi\n" |
||||
" subl %%ebp, %%esi\n" /* from = out - dist */ |
||||
|
||||
".L_do_copy1:\n" |
||||
" movl %%eax, %%ecx\n" |
||||
" rep movsb\n" |
||||
|
||||
" movl 4(%%esp), %%esi\n" /* move in back to %esi, toss from */ |
||||
" movl 44(%%esp), %%ebp\n" /* ebp = lcode */ |
||||
" jmp .L_while_test\n" |
||||
|
||||
".L_test_for_end_of_block:\n" |
||||
" testb $32, %%al\n" |
||||
" jz .L_invalid_literal_length_code\n" |
||||
" movl $1, 68(%%esp)\n" |
||||
" jmp .L_break_loop_with_status\n" |
||||
|
||||
".L_invalid_literal_length_code:\n" |
||||
" movl $2, 68(%%esp)\n" |
||||
" jmp .L_break_loop_with_status\n" |
||||
|
||||
".L_invalid_distance_code:\n" |
||||
" movl $3, 68(%%esp)\n" |
||||
" jmp .L_break_loop_with_status\n" |
||||
|
||||
".L_invalid_distance_too_far:\n" |
||||
" movl 4(%%esp), %%esi\n" |
||||
" movl $4, 68(%%esp)\n" |
||||
" jmp .L_break_loop_with_status\n" |
||||
|
||||
".L_break_loop:\n" |
||||
" movl $0, 68(%%esp)\n" |
||||
|
||||
".L_break_loop_with_status:\n" |
||||
/* put in, out, bits, and hold back into ar and pop esp */ |
||||
" movl %%esi, 4(%%esp)\n" |
||||
" movl %%edi, 12(%%esp)\n" |
||||
" movl %%ebx, 40(%%esp)\n" |
||||
" movl %%edx, 36(%%esp)\n" |
||||
" movl (%%esp), %%esp\n" |
||||
" popl %%ebp\n" |
||||
" popf\n" |
||||
: |
||||
: "m" (ar) |
||||
: "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi" |
||||
); |
||||
#elif defined( _MSC_VER ) |
||||
__asm { |
||||
lea eax, ar |
||||
pushfd |
||||
push ebp |
||||
mov [eax], esp |
||||
mov esp, eax |
||||
mov esi, [esp+4] /* esi = in */ |
||||
mov edi, [esp+12] /* edi = out */ |
||||
mov edx, [esp+36] /* edx = hold */ |
||||
mov ebx, [esp+40] /* ebx = bits */ |
||||
mov ebp, [esp+44] /* ebp = lcode */ |
||||
|
||||
cld |
||||
jmp L_do_loop |
||||
|
||||
L_while_test: |
||||
cmp [esp+20], edi |
||||
jbe L_break_loop |
||||
cmp [esp+8], esi |
||||
jbe L_break_loop |
||||
|
||||
L_do_loop: |
||||
cmp bl, 15 |
||||
ja L_get_length_code /* if (15 < bits) */ |
||||
|
||||
xor eax, eax |
||||
lodsw /* al = *(ushort *)in++ */ |
||||
mov cl, bl /* cl = bits, needs it for shifting */ |
||||
add bl, 16 /* bits += 16 */ |
||||
shl eax, cl |
||||
or edx, eax /* hold |= *((ushort *)in)++ << bits */ |
||||
|
||||
L_get_length_code: |
||||
mov eax, [esp+52] /* eax = lmask */ |
||||
and eax, edx /* eax &= hold */ |
||||
mov eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */ |
||||
|
||||
L_dolen: |
||||
mov cl, ah /* cl = this.bits */ |
||||
sub bl, ah /* bits -= this.bits */ |
||||
shr edx, cl /* hold >>= this.bits */ |
||||
|
||||
test al, al |
||||
jnz L_test_for_length_base /* if (op != 0) 45.7% */ |
||||
|
||||
shr eax, 16 /* output this.val char */ |
||||
stosb |
||||
jmp L_while_test |
||||
|
||||
L_test_for_length_base: |
||||
mov ecx, eax /* len = this */ |
||||
shr ecx, 16 /* len = this.val */ |
||||
mov [esp+60], ecx /* len = this */ |
||||
mov cl, al |
||||
|
||||
test al, 16 |
||||
jz L_test_for_second_level_length /* if ((op & 16) == 0) 8% */ |
||||
and cl, 15 /* op &= 15 */ |
||||
jz L_decode_distance /* if (!op) */ |
||||
cmp bl, cl |
||||
jae L_add_bits_to_len /* if (op <= bits) */ |
||||
|
||||
mov ch, cl /* stash op in ch, freeing cl */ |
||||
xor eax, eax |
||||
lodsw /* al = *(ushort *)in++ */ |
||||
mov cl, bl /* cl = bits, needs it for shifting */ |
||||
add bl, 16 /* bits += 16 */ |
||||
shl eax, cl |
||||
or edx, eax /* hold |= *((ushort *)in)++ << bits */ |
||||
mov cl, ch /* move op back to ecx */ |
||||
|
||||
L_add_bits_to_len: |
||||
mov eax, 1 |
||||
shl eax, cl |
||||
dec eax |
||||
sub bl, cl |
||||
and eax, edx /* eax &= hold */ |
||||
shr edx, cl |
||||
add [esp+60], eax /* len += hold & mask[op] */ |
||||
|
||||
L_decode_distance: |
||||
cmp bl, 15 |
||||
ja L_get_distance_code /* if (15 < bits) */ |
||||
|
||||
xor eax, eax |
||||
lodsw /* al = *(ushort *)in++ */ |
||||
mov cl, bl /* cl = bits, needs it for shifting */ |
||||
add bl, 16 /* bits += 16 */ |
||||
shl eax, cl |
||||
or edx, eax /* hold |= *((ushort *)in)++ << bits */ |
||||
|
||||
L_get_distance_code: |
||||
mov eax, [esp+56] /* eax = dmask */ |
||||
mov ecx, [esp+48] /* ecx = dcode */ |
||||
and eax, edx /* eax &= hold */ |
||||
mov eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */ |
||||
|
||||
L_dodist: |
||||
mov ebp, eax /* dist = this */ |
||||
shr ebp, 16 /* dist = this.val */ |
||||
mov cl, ah |
||||
sub bl, ah /* bits -= this.bits */ |
||||
shr edx, cl /* hold >>= this.bits */ |
||||
mov cl, al /* cl = this.op */ |
||||
|
||||
test al, 16 /* if ((op & 16) == 0) */ |
||||
jz L_test_for_second_level_dist |
||||
and cl, 15 /* op &= 15 */ |
||||
jz L_check_dist_one |
||||
cmp bl, cl |
||||
jae L_add_bits_to_dist /* if (op <= bits) 97.6% */ |
||||
|
||||
mov ch, cl /* stash op in ch, freeing cl */ |
||||
xor eax, eax |
||||
lodsw /* al = *(ushort *)in++ */ |
||||
mov cl, bl /* cl = bits, needs it for shifting */ |
||||
add bl, 16 /* bits += 16 */ |
||||
shl eax, cl |
||||
or edx, eax /* hold |= *((ushort *)in)++ << bits */ |
||||
mov cl, ch /* move op back to ecx */ |
||||
|
||||
L_add_bits_to_dist: |
||||
mov eax, 1 |
||||
shl eax, cl |
||||
dec eax /* (1 << op) - 1 */ |
||||
sub bl, cl |
||||
and eax, edx /* eax &= hold */ |
||||
shr edx, cl |
||||
add ebp, eax /* dist += hold & ((1 << op) - 1) */ |
||||
|
||||
L_check_window: |
||||
mov [esp+4], esi /* save in so from can use it's reg */ |
||||
mov eax, edi |
||||
sub eax, [esp+16] /* nbytes = out - beg */ |
||||
|
||||
cmp eax, ebp |
||||
jb L_clip_window /* if (dist > nbytes) 4.2% */ |
||||
|
||||
mov ecx, [esp+60] |
||||
mov esi, edi |
||||
sub esi, ebp /* from = out - dist */ |
||||
|
||||
sub ecx, 3 /* copy from to out */ |
||||
mov al, [esi] |
||||
mov [edi], al |
||||
mov al, [esi+1] |
||||
mov ah, [esi+2] |
||||
add esi, 3 |
||||
mov [edi+1], al |
||||
mov [edi+2], ah |
||||
add edi, 3 |
||||
rep movsb |
||||
|
||||
mov esi, [esp+4] /* move in back to %esi, toss from */ |
||||
mov ebp, [esp+44] /* ebp = lcode */ |
||||
jmp L_while_test |
||||
|
||||
L_check_dist_one: |
||||
cmp ebp, 1 /* if dist 1, is a memset */ |
||||
jne L_check_window |
||||
cmp [esp+16], edi |
||||
je L_check_window |
||||
|
||||
dec edi |
||||
mov ecx, [esp+60] |
||||
mov al, [edi] |
||||
sub ecx, 3 |
||||
|
||||
mov [edi+1], al /* memset out with from[-1] */ |
||||
mov [edi+2], al |
||||
mov [edi+3], al |
||||
add edi, 4 |
||||
rep stosb |
||||
mov ebp, [esp+44] /* ebp = lcode */ |
||||
jmp L_while_test |
||||
|
||||
L_test_for_second_level_length: |
||||
test al, 64 |
||||
jnz L_test_for_end_of_block /* if ((op & 64) != 0) */ |
||||
|
||||
mov eax, 1 |
||||
shl eax, cl |
||||
dec eax |
||||
and eax, edx /* eax &= hold */ |
||||
add eax, [esp+60] /* eax += this.val */ |
||||
mov eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/ |
||||
jmp L_dolen |
||||
|
||||
L_test_for_second_level_dist: |
||||
test al, 64 |
||||
jnz L_invalid_distance_code /* if ((op & 64) != 0) */ |
||||
|
||||
mov eax, 1 |
||||
shl eax, cl |
||||
dec eax |
||||
and eax, edx /* eax &= hold */ |
||||
add eax, ebp /* eax += this.val */ |
||||
mov ecx, [esp+48] /* ecx = dcode */ |
||||
mov eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/ |
||||
jmp L_dodist |
||||
|
||||
L_clip_window: |
||||
mov ecx, eax |
||||
mov eax, [esp+24] /* prepare for dist compare */ |
||||
neg ecx /* nbytes = -nbytes */ |
||||
mov esi, [esp+32] /* from = window */ |
||||
|
||||
cmp eax, ebp |
||||
jb L_invalid_distance_too_far /* if (dist > wsize) */ |
||||
|
||||
add ecx, ebp /* nbytes = dist - nbytes */ |
||||
cmp dword ptr [esp+28], 0 |
||||
jne L_wrap_around_window /* if (write != 0) */ |
||||
|
||||
sub eax, ecx |
||||
add esi, eax /* from += wsize - nbytes */ |
||||
|
||||
mov eax, [esp+60] |
||||
cmp eax, ecx |
||||
jbe L_do_copy1 /* if (nbytes >= len) */ |
||||
|
||||
sub eax, ecx /* len -= nbytes */ |
||||
rep movsb |
||||
mov esi, edi |
||||
sub esi, ebp /* from = out - dist */ |
||||
jmp L_do_copy1 |
||||
|
||||
cmp eax, ecx |
||||
jbe L_do_copy1 /* if (nbytes >= len) */ |
||||
|
||||
sub eax, ecx /* len -= nbytes */ |
||||
rep movsb |
||||
mov esi, edi |
||||
sub esi, ebp /* from = out - dist */ |
||||
jmp L_do_copy1 |
||||
|
||||
L_wrap_around_window: |
||||
mov eax, [esp+28] |
||||
cmp ecx, eax |
||||
jbe L_contiguous_in_window /* if (write >= nbytes) */ |
||||
|
||||
add esi, [esp+24] |
||||
add esi, eax |
||||
sub esi, ecx /* from += wsize + write - nbytes */ |
||||
sub ecx, eax /* nbytes -= write */ |
||||
|
||||
mov eax, [esp+60] |
||||
cmp eax, ecx |
||||
jbe L_do_copy1 /* if (nbytes >= len) */ |
||||
|
||||
sub eax, ecx /* len -= nbytes */ |
||||
rep movsb |
||||
mov esi, [esp+32] /* from = window */ |
||||
mov ecx, [esp+28] /* nbytes = write */ |
||||
cmp eax, ecx |
||||
jbe L_do_copy1 /* if (nbytes >= len) */ |
||||
|
||||
sub eax, ecx /* len -= nbytes */ |
||||
rep movsb |
||||
mov esi, edi |
||||
sub esi, ebp /* from = out - dist */ |
||||
jmp L_do_copy1 |
||||
|
||||
L_contiguous_in_window: |
||||
add esi, eax |
||||
sub esi, ecx /* from += write - nbytes */ |
||||
|
||||
mov eax, [esp+60] |
||||
cmp eax, ecx |
||||
jbe L_do_copy1 /* if (nbytes >= len) */ |
||||
|
||||
sub eax, ecx /* len -= nbytes */ |
||||
rep movsb |
||||
mov esi, edi |
||||
sub esi, ebp /* from = out - dist */ |
||||
|
||||
L_do_copy1: |
||||
mov ecx, eax |
||||
rep movsb |
||||
|
||||
mov esi, [esp+4] /* move in back to %esi, toss from */ |
||||
mov ebp, [esp+44] /* ebp = lcode */ |
||||
jmp L_while_test |
||||
|
||||
L_test_for_end_of_block: |
||||
test al, 32 |
||||
jz L_invalid_literal_length_code |
||||
mov dword ptr [esp+68], 1 |
||||
jmp L_break_loop_with_status |
||||
|
||||
L_invalid_literal_length_code: |
||||
mov dword ptr [esp+68], 2 |
||||
jmp L_break_loop_with_status |
||||
|
||||
L_invalid_distance_code: |
||||
mov dword ptr [esp+68], 3 |
||||
jmp L_break_loop_with_status |
||||
|
||||
L_invalid_distance_too_far: |
||||
mov esi, [esp+4] |
||||
mov dword ptr [esp+68], 4 |
||||
jmp L_break_loop_with_status |
||||
|
||||
L_break_loop: |
||||
mov dword ptr [esp+68], 0 |
||||
|
||||
L_break_loop_with_status: |
||||
/* put in, out, bits, and hold back into ar and pop esp */ |
||||
mov [esp+4], esi |
||||
mov [esp+12], edi |
||||
mov [esp+40], ebx |
||||
mov [esp+36], edx |
||||
mov esp, [esp] |
||||
pop ebp |
||||
popfd |
||||
} |
||||
#endif |
||||
|
||||
if (ar.status > 1) { |
||||
if (ar.status == 2) |
||||
strm->msg = "invalid literal/length code"; |
||||
else if (ar.status == 3) |
||||
strm->msg = "invalid distance code"; |
||||
else |
||||
strm->msg = "invalid distance too far back"; |
||||
state->mode = BAD; |
||||
} |
||||
else if ( ar.status == 1 ) { |
||||
state->mode = TYPE; |
||||
} |
||||
|
||||
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */ |
||||
ar.len = ar.bits >> 3; |
||||
ar.in -= ar.len; |
||||
ar.bits -= ar.len << 3; |
||||
ar.hold &= (1U << ar.bits) - 1; |
||||
|
||||
/* update state and return */ |
||||
strm->next_in = ar.in; |
||||
strm->next_out = ar.out; |
||||
strm->avail_in = (unsigned)(ar.in < ar.last ? 5 + (ar.last - ar.in) : |
||||
5 - (ar.in - ar.last)); |
||||
strm->avail_out = (unsigned)(ar.out < ar.end ? 257 + (ar.end - ar.out) : |
||||
257 - (ar.out - ar.end)); |
||||
state->hold = ar.hold; |
||||
state->bits = ar.bits; |
||||
return; |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,104 @@ |
||||
|
||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) |
||||
|
||||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence |
||||
*/ |
||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) |
||||
{ |
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
* unpredictable manner on 16-bit systems; not a problem |
||||
* with any known compiler so far, though */ |
||||
|
||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; |
||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); |
||||
} |
||||
|
||||
/***********************************************************************
|
||||
* Update the encryption keys with the next byte of plain text |
||||
*/ |
||||
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) |
||||
{ |
||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c); |
||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff; |
||||
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; |
||||
{ |
||||
register int keyshift = (int)((*(pkeys+1)) >> 24); |
||||
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); |
||||
} |
||||
return c; |
||||
} |
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Initialize the encryption keys and the random header according to |
||||
* the given password. |
||||
*/ |
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) |
||||
{ |
||||
*(pkeys+0) = 305419896L; |
||||
*(pkeys+1) = 591751049L; |
||||
*(pkeys+2) = 878082192L; |
||||
while (*passwd != '\0') { |
||||
update_keys(pkeys,pcrc_32_tab,(int)*passwd); |
||||
passwd++; |
||||
} |
||||
} |
||||
|
||||
#define zdecode(pkeys,pcrc_32_tab,c) \ |
||||
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) |
||||
|
||||
#define zencode(pkeys,pcrc_32_tab,c,t) \ |
||||
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) |
||||
|
||||
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED |
||||
|
||||
#define RAND_HEAD_LEN 12 |
||||
/* "last resort" source for second part of crypt seed pattern */ |
||||
# ifndef ZCR_SEED2 |
||||
# define ZCR_SEED2 (unsigned long)3141592654L /* use PI as default pattern */ |
||||
# endif |
||||
|
||||
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) |
||||
const char *passwd; /* password string */ |
||||
unsigned char *buf; /* where to write header */ |
||||
int bufSize; |
||||
unsigned long* pkeys; |
||||
const unsigned long* pcrc_32_tab; |
||||
unsigned long crcForCrypting; |
||||
{ |
||||
int n; /* index in random header */ |
||||
int t; /* temporary */ |
||||
int c; /* random byte */ |
||||
unsigned char header[RAND_HEAD_LEN-2]; /* random header */ |
||||
static unsigned calls = 0; /* ensure different random header each time */ |
||||
|
||||
if (bufSize<RAND_HEAD_LEN) |
||||
return 0; |
||||
|
||||
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
|
||||
* output of rand() to get less predictability, since rand() is |
||||
* often poorly implemented. |
||||
*/ |
||||
if (++calls == 1) |
||||
{ |
||||
srand((unsigned)(time(NULL) ^ ZCR_SEED2)); |
||||
} |
||||
init_keys(passwd, pkeys, pcrc_32_tab); |
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++) |
||||
{ |
||||
c = (rand() >> 7) & 0xff; |
||||
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); |
||||
} |
||||
/* Encrypt random header (last two bytes is high word of crc) */ |
||||
init_keys(passwd, pkeys, pcrc_32_tab); |
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++) |
||||
{ |
||||
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); |
||||
} |
||||
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); |
||||
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); |
||||
return n; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,177 @@ |
||||
/* ioapi.c -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API |
||||
|
||||
Version 0.21, March 10th, 2003 |
||||
|
||||
Copyright (C) 1998-2003 Gilles Vollant |
||||
*/ |
||||
|
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
#include <string.h> |
||||
|
||||
#include "zlib.h" |
||||
#include "ioapi.h" |
||||
|
||||
|
||||
|
||||
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ |
||||
|
||||
#ifndef SEEK_CUR |
||||
#define SEEK_CUR 1 |
||||
#endif |
||||
|
||||
#ifndef SEEK_END |
||||
#define SEEK_END 2 |
||||
#endif |
||||
|
||||
#ifndef SEEK_SET |
||||
#define SEEK_SET 0 |
||||
#endif |
||||
|
||||
voidpf ZCALLBACK fopen_file_func OF(( |
||||
voidpf opaque, |
||||
const char* filename, |
||||
int mode)); |
||||
|
||||
uLong ZCALLBACK fread_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
void* buf, |
||||
uLong size)); |
||||
|
||||
uLong ZCALLBACK fwrite_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
const void* buf, |
||||
uLong size)); |
||||
|
||||
long ZCALLBACK ftell_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
long ZCALLBACK fseek_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
uLong offset, |
||||
int origin)); |
||||
|
||||
int ZCALLBACK fclose_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
int ZCALLBACK ferror_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) |
||||
voidpf opaque; |
||||
const char* filename; |
||||
int mode; |
||||
{ |
||||
FILE* file = NULL; |
||||
const char* mode_fopen = NULL; |
||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) |
||||
mode_fopen = "rb"; |
||||
else |
||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING) |
||||
mode_fopen = "r+b"; |
||||
else |
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE) |
||||
mode_fopen = "wb"; |
||||
|
||||
if ((filename!=NULL) && (mode_fopen != NULL)) |
||||
file = fopen(filename, mode_fopen); |
||||
return file; |
||||
} |
||||
|
||||
|
||||
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
void* buf; |
||||
uLong size; |
||||
{ |
||||
uLong ret; |
||||
ret = fread(buf, 1, (size_t)size, (FILE *)stream); |
||||
return ret; |
||||
} |
||||
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
const void* buf; |
||||
uLong size; |
||||
{ |
||||
uLong ret; |
||||
ret = fwrite(buf, 1, (size_t)size, (FILE *)stream); |
||||
return ret; |
||||
} |
||||
|
||||
long ZCALLBACK ftell_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
long ret; |
||||
ret = ftell((FILE *)stream); |
||||
return ret; |
||||
} |
||||
|
||||
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
uLong offset; |
||||
int origin; |
||||
{ |
||||
int fseek_origin=0; |
||||
long ret; |
||||
switch (origin) |
||||
{ |
||||
case ZLIB_FILEFUNC_SEEK_CUR : |
||||
fseek_origin = SEEK_CUR; |
||||
break; |
||||
case ZLIB_FILEFUNC_SEEK_END : |
||||
fseek_origin = SEEK_END; |
||||
break; |
||||
case ZLIB_FILEFUNC_SEEK_SET : |
||||
fseek_origin = SEEK_SET; |
||||
break; |
||||
default: return -1; |
||||
} |
||||
ret = 0; |
||||
fseek((FILE *)stream, offset, fseek_origin); |
||||
return ret; |
||||
} |
||||
|
||||
int ZCALLBACK fclose_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
int ret; |
||||
ret = fclose((FILE *)stream); |
||||
return ret; |
||||
} |
||||
|
||||
int ZCALLBACK ferror_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
int ret; |
||||
ret = ferror((FILE *)stream); |
||||
return ret; |
||||
} |
||||
|
||||
void fill_fopen_filefunc (pzlib_filefunc_def) |
||||
zlib_filefunc_def* pzlib_filefunc_def; |
||||
{ |
||||
pzlib_filefunc_def->zopen_file = fopen_file_func; |
||||
pzlib_filefunc_def->zread_file = fread_file_func; |
||||
pzlib_filefunc_def->zwrite_file = fwrite_file_func; |
||||
pzlib_filefunc_def->ztell_file = ftell_file_func; |
||||
pzlib_filefunc_def->zseek_file = fseek_file_func; |
||||
pzlib_filefunc_def->zclose_file = fclose_file_func; |
||||
pzlib_filefunc_def->zerror_file = ferror_file_func; |
||||
pzlib_filefunc_def->opaque = NULL; |
||||
} |
@ -0,0 +1,75 @@ |
||||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API |
||||
|
||||
Version 0.21, March 10th, 2003 |
||||
|
||||
Copyright (C) 1998-2003 Gilles Vollant |
||||
*/ |
||||
|
||||
#ifndef _ZLIBIOAPI_H |
||||
#define _ZLIBIOAPI_H |
||||
|
||||
|
||||
#define ZLIB_FILEFUNC_SEEK_CUR (1) |
||||
#define ZLIB_FILEFUNC_SEEK_END (2) |
||||
#define ZLIB_FILEFUNC_SEEK_SET (0) |
||||
|
||||
#define ZLIB_FILEFUNC_MODE_READ (1) |
||||
#define ZLIB_FILEFUNC_MODE_WRITE (2) |
||||
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) |
||||
|
||||
#define ZLIB_FILEFUNC_MODE_EXISTING (4) |
||||
#define ZLIB_FILEFUNC_MODE_CREATE (8) |
||||
|
||||
|
||||
#ifndef ZCALLBACK |
||||
|
||||
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) |
||||
#define ZCALLBACK CALLBACK |
||||
#else |
||||
#define ZCALLBACK |
||||
#endif |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); |
||||
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); |
||||
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); |
||||
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); |
||||
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); |
||||
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); |
||||
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); |
||||
|
||||
typedef struct zlib_filefunc_def_s |
||||
{ |
||||
open_file_func zopen_file; |
||||
read_file_func zread_file; |
||||
write_file_func zwrite_file; |
||||
tell_file_func ztell_file; |
||||
seek_file_func zseek_file; |
||||
close_file_func zclose_file; |
||||
testerror_file_func zerror_file; |
||||
voidpf opaque; |
||||
} zlib_filefunc_def; |
||||
|
||||
|
||||
|
||||
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); |
||||
|
||||
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) |
||||
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) |
||||
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) |
||||
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) |
||||
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) |
||||
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,271 @@ |
||||
/* iowin32.c -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API |
||||
This IO API version uses the Win32 API (for Microsoft Windows) |
||||
|
||||
Version 0.21, March 10th, 2003 |
||||
|
||||
Copyright (C) 1998-2003 Gilles Vollant |
||||
*/ |
||||
|
||||
#include <windows.h> |
||||
#include <stdlib.h> |
||||
|
||||
#include "zlib.h" |
||||
#include "ioapi.h" |
||||
#include "iowin32.h" |
||||
|
||||
#ifndef INVALID_HANDLE_VALUE |
||||
#define INVALID_HANDLE_VALUE (0xFFFFFFFF) |
||||
#endif |
||||
|
||||
#ifndef INVALID_SET_FILE_POINTER |
||||
#define INVALID_SET_FILE_POINTER ((DWORD)-1) |
||||
#endif |
||||
|
||||
voidpf ZCALLBACK win32_open_file_func OF(( |
||||
voidpf opaque, |
||||
const char* filename, |
||||
int mode)); |
||||
|
||||
uLong ZCALLBACK win32_read_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
void* buf, |
||||
uLong size)); |
||||
|
||||
uLong ZCALLBACK win32_write_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
const void* buf, |
||||
uLong size)); |
||||
|
||||
long ZCALLBACK win32_tell_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
long ZCALLBACK win32_seek_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream, |
||||
uLong offset, |
||||
int origin)); |
||||
|
||||
long ZCALLBACK win32_close_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
int ZCALLBACK win32_error_file_func OF(( |
||||
voidpf opaque, |
||||
voidpf stream)); |
||||
|
||||
typedef struct |
||||
{ |
||||
HANDLE hf; |
||||
int error; |
||||
} WIN32FILE_IOWIN; |
||||
|
||||
voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) |
||||
voidpf opaque; |
||||
const char* filename; |
||||
int mode; |
||||
{ |
||||
const char* mode_fopen = NULL; |
||||
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; |
||||
HANDLE hFile = 0; |
||||
voidpf ret=NULL; |
||||
|
||||
dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; |
||||
|
||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) |
||||
{ |
||||
dwDesiredAccess = GENERIC_READ; |
||||
dwCreationDisposition = OPEN_EXISTING; |
||||
dwShareMode = FILE_SHARE_READ; |
||||
} |
||||
else |
||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING) |
||||
{ |
||||
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; |
||||
dwCreationDisposition = OPEN_EXISTING; |
||||
} |
||||
else |
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE) |
||||
{ |
||||
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; |
||||
dwCreationDisposition = CREATE_ALWAYS; |
||||
} |
||||
|
||||
if ((filename!=NULL) && (dwDesiredAccess != 0)) |
||||
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, |
||||
dwCreationDisposition, dwFlagsAndAttributes, NULL); |
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) |
||||
hFile = NULL; |
||||
|
||||
if (hFile != NULL) |
||||
{ |
||||
WIN32FILE_IOWIN w32fiow; |
||||
w32fiow.hf = hFile; |
||||
w32fiow.error = 0; |
||||
ret = malloc(sizeof(WIN32FILE_IOWIN)); |
||||
if (ret==NULL) |
||||
CloseHandle(hFile); |
||||
else *((WIN32FILE_IOWIN*)ret) = w32fiow; |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
|
||||
uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
void* buf; |
||||
uLong size; |
||||
{ |
||||
uLong ret=0; |
||||
HANDLE hFile = NULL; |
||||
if (stream!=NULL) |
||||
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; |
||||
if (hFile != NULL) |
||||
if (!ReadFile(hFile, buf, size, &ret, NULL)) |
||||
{ |
||||
DWORD dwErr = GetLastError(); |
||||
if (dwErr == ERROR_HANDLE_EOF) |
||||
dwErr = 0; |
||||
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; |
||||
} |
||||
|
||||
return ret; |
||||
} |
||||
|
||||
|
||||
uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
const void* buf; |
||||
uLong size; |
||||
{ |
||||
uLong ret=0; |
||||
HANDLE hFile = NULL; |
||||
if (stream!=NULL) |
||||
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; |
||||
|
||||
if (hFile !=NULL) |
||||
if (!WriteFile(hFile, buf, size, &ret, NULL)) |
||||
{ |
||||
DWORD dwErr = GetLastError(); |
||||
if (dwErr == ERROR_HANDLE_EOF) |
||||
dwErr = 0; |
||||
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; |
||||
} |
||||
|
||||
return ret; |
||||
} |
||||
|
||||
long ZCALLBACK win32_tell_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
long ret=-1; |
||||
HANDLE hFile = NULL; |
||||
if (stream!=NULL) |
||||
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; |
||||
if (hFile != NULL) |
||||
{ |
||||
DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); |
||||
if (dwSet == INVALID_SET_FILE_POINTER) |
||||
{ |
||||
DWORD dwErr = GetLastError(); |
||||
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; |
||||
ret = -1; |
||||
} |
||||
else |
||||
ret=(long)dwSet; |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
uLong offset; |
||||
int origin; |
||||
{ |
||||
DWORD dwMoveMethod=0xFFFFFFFF; |
||||
HANDLE hFile = NULL; |
||||
|
||||
long ret=-1; |
||||
if (stream!=NULL) |
||||
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; |
||||
switch (origin) |
||||
{ |
||||
case ZLIB_FILEFUNC_SEEK_CUR : |
||||
dwMoveMethod = FILE_CURRENT; |
||||
break; |
||||
case ZLIB_FILEFUNC_SEEK_END : |
||||
dwMoveMethod = FILE_END; |
||||
break; |
||||
case ZLIB_FILEFUNC_SEEK_SET : |
||||
dwMoveMethod = FILE_BEGIN; |
||||
break; |
||||
default: return -1; |
||||
} |
||||
|
||||
if (hFile != NULL) |
||||
{ |
||||
DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); |
||||
if (dwSet == INVALID_SET_FILE_POINTER) |
||||
{ |
||||
DWORD dwErr = GetLastError(); |
||||
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; |
||||
ret = -1; |
||||
} |
||||
else |
||||
ret=0; |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
long ZCALLBACK win32_close_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
long ret=-1; |
||||
|
||||
if (stream!=NULL) |
||||
{ |
||||
HANDLE hFile; |
||||
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; |
||||
if (hFile != NULL) |
||||
{ |
||||
CloseHandle(hFile); |
||||
ret=0; |
||||
} |
||||
free(stream); |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
int ZCALLBACK win32_error_file_func (opaque, stream) |
||||
voidpf opaque; |
||||
voidpf stream; |
||||
{ |
||||
int ret=-1; |
||||
if (stream!=NULL) |
||||
{ |
||||
ret = ((WIN32FILE_IOWIN*)stream) -> error; |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
void fill_win32_filefunc (pzlib_filefunc_def) |
||||
zlib_filefunc_def* pzlib_filefunc_def; |
||||
{ |
||||
pzlib_filefunc_def->zopen_file = win32_open_file_func; |
||||
pzlib_filefunc_def->zread_file = win32_read_file_func; |
||||
pzlib_filefunc_def->zwrite_file = win32_write_file_func; |
||||
pzlib_filefunc_def->ztell_file = win32_tell_file_func; |
||||
pzlib_filefunc_def->zseek_file = win32_seek_file_func; |
||||
pzlib_filefunc_def->zclose_file = win32_close_file_func; |
||||
pzlib_filefunc_def->zerror_file = win32_error_file_func; |
||||
pzlib_filefunc_def->opaque=NULL; |
||||
} |
@ -0,0 +1,19 @@ |
||||
/* iowin32.h -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API |
||||
This IO API version uses the Win32 API (for Microsoft Windows) |
||||
|
||||
Version 0.21, March 10th, 2003 |
||||
|
||||
Copyright (C) 1998-2003 Gilles Vollant |
||||
*/ |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
@ -1,37 +0,0 @@ |
||||
|
||||
UnZip 0.15 additionnal library |
||||
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with |
||||
PKZip 2.04g, WinZip, InfoZip tools and compatible. |
||||
|
||||
Multi volume ZipFile (span) are not supported, and old compression used by old |
||||
PKZip 1.x are not supported. |
||||
|
||||
See probdesc.zip from PKWare for specification of .ZIP format. |
||||
|
||||
What is Unzip |
||||
The Zlib library support the deflate compression and the creation of gzip (.gz) |
||||
file. Zlib is free and small. |
||||
The .Zip format, which can contain several compressed files (.gz can containt |
||||
only one file) is a very popular format. This is why I've written a package for reading file compressed in Zipfile. |
||||
|
||||
Using Unzip package |
||||
|
||||
You need source of Zlib (get zlib111.zip and read zlib.h). |
||||
Get unzlb015.zip and read unzip.h (whith documentation of unzip functions) |
||||
|
||||
The Unzip package is only two file : unzip.h and unzip.c. But it use the Zlib |
||||
files. |
||||
unztst.c is a simple sample program, which list file in a zipfile and display |
||||
README.TXT or FILE_ID.DIZ (if these files are found). |
||||
miniunz.c is a mini unzip program. |
||||
|
||||
I'm also currenlyt writing a zipping portion (zip.h, zip.c and test with minizip.c) |
||||
|
||||
Please email me for feedback. |
||||
I hope my source is compatible with Unix system, but I need your help for be sure |
||||
|
||||
Latest revision : Mar 04th, 1998 |
||||
|
||||
Check http://www.winimage.com/zLibDll/unzip.html for up to date info. |
@ -1,15 +0,0 @@ |
||||
unzOpen @61 |
||||
unzClose @62 |
||||
unzGetGlobalInfo @63 |
||||
unzGetCurrentFileInfo @64 |
||||
unzGoToFirstFile @65 |
||||
unzGoToNextFile @66 |
||||
unzOpenCurrentFile @67 |
||||
unzReadCurrentFile @68 |
||||
unztell @70 |
||||
unzeof @71 |
||||
unzCloseCurrentFile @72 |
||||
unzGetGlobalComment @73 |
||||
unzStringFileNameCompare @74 |
||||
unzLocateFile @75 |
||||
unzGetLocalExtrafield @76 |
@ -1,5 +0,0 @@ |
||||
zipOpen @80 |
||||
zipOpenNewFileInZip @81 |
||||
zipWriteInFileInZip @82 |
||||
zipCloseFileInZip @83 |
||||
zipClose @84 |
@ -1,651 +0,0 @@ |
||||
# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4> |
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00 |
||||
# ** DO NOT EDIT ** |
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 |
||||
# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602 |
||||
|
||||
CFG=zlibvc - Win32 Release |
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE, |
||||
!MESSAGE use the Export Makefile command and run |
||||
!MESSAGE |
||||
!MESSAGE NMAKE /f "zlibvc.mak". |
||||
!MESSAGE |
||||
!MESSAGE You can specify a configuration when running NMAKE |
||||
!MESSAGE by defining the macro CFG on the command line. For example: |
||||
!MESSAGE |
||||
!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release" |
||||
!MESSAGE |
||||
!MESSAGE Possible choices for configuration are: |
||||
!MESSAGE |
||||
!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") |
||||
!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") |
||||
!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\ |
||||
"Win32 (ALPHA) Dynamic-Link Library") |
||||
!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\ |
||||
"Win32 (x86) Dynamic-Link Library") |
||||
!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\ |
||||
"Win32 (x86) Dynamic-Link Library") |
||||
!MESSAGE |
||||
|
||||
# Begin Project |
||||
# PROP Scc_ProjName "" |
||||
# PROP Scc_LocalPath "" |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir ".\Release" |
||||
# PROP BASE Intermediate_Dir ".\Release" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir ".\Release" |
||||
# PROP Intermediate_Dir ".\Release" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
CPP=cl.exe |
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c |
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c |
||||
# SUBTRACT CPP /YX |
||||
MTL=midl.exe |
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32 |
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
RSC=rc.exe |
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG" |
||||
# ADD RSC /l 0x40c /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 |
||||
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" |
||||
# SUBTRACT LINK32 /pdb:none |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 1 |
||||
# PROP BASE Output_Dir ".\Debug" |
||||
# PROP BASE Intermediate_Dir ".\Debug" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 1 |
||||
# PROP Output_Dir ".\Debug" |
||||
# PROP Intermediate_Dir ".\Debug" |
||||
# PROP Target_Dir "" |
||||
CPP=cl.exe |
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c |
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c |
||||
# SUBTRACT CPP /YX |
||||
MTL=midl.exe |
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32 |
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 |
||||
RSC=rc.exe |
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG" |
||||
# ADD RSC /l 0x40c /d "_DEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 |
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "zlibvc__" |
||||
# PROP BASE Intermediate_Dir "zlibvc__" |
||||
# PROP BASE Ignore_Export_Lib 0 |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "zlibvc__" |
||||
# PROP Intermediate_Dir "zlibvc__" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
MTL=midl.exe |
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
CPP=cl.exe |
||||
# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c |
||||
# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c |
||||
# SUBTRACT CPP /YX |
||||
RSC=rc.exe |
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG" |
||||
# ADD RSC /l 0x40c /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll" |
||||
# SUBTRACT BASE LINK32 /pdb:none |
||||
# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll" |
||||
# SUBTRACT LINK32 /pdb:none |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "zlibvc_0" |
||||
# PROP BASE Intermediate_Dir "zlibvc_0" |
||||
# PROP BASE Ignore_Export_Lib 0 |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "zlibvc_0" |
||||
# PROP Intermediate_Dir "zlibvc_0" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
CPP=cl.exe |
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c |
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c |
||||
# SUBTRACT CPP /YX |
||||
MTL=midl.exe |
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
RSC=rc.exe |
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG" |
||||
# ADD RSC /l 0x40c /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" |
||||
# SUBTRACT BASE LINK32 /pdb:none |
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll" |
||||
# SUBTRACT LINK32 /pdb:none |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "zlibvc_1" |
||||
# PROP BASE Intermediate_Dir "zlibvc_1" |
||||
# PROP BASE Ignore_Export_Lib 0 |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "zlibvc_1" |
||||
# PROP Intermediate_Dir "zlibvc_1" |
||||
# PROP Ignore_Export_Lib 0 |
||||
# PROP Target_Dir "" |
||||
CPP=cl.exe |
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c |
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c |
||||
# SUBTRACT CPP /YX |
||||
MTL=midl.exe |
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
||||
RSC=rc.exe |
||||
# ADD BASE RSC /l 0x40c /d "NDEBUG" |
||||
# ADD RSC /l 0x40c /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" |
||||
# SUBTRACT BASE LINK32 /pdb:none |
||||
# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll" |
||||
# SUBTRACT LINK32 /pdb:none |
||||
|
||||
!ENDIF |
||||
|
||||
# Begin Target |
||||
|
||||
# Name "zlibvc - Win32 Release" |
||||
# Name "zlibvc - Win32 Debug" |
||||
# Name "zlibvc - Win32 ReleaseAxp" |
||||
# Name "zlibvc - Win32 ReleaseWithoutAsm" |
||||
# Name "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
# Begin Group "Source Files" |
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\adler32.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_ADLER=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\compress.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_COMPR=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\crc32.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_CRC32=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\deflate.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_DEFLA=\ |
||||
".\deflate.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\gvmat32c.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\gzio.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_GZIO_=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infblock.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFBL=\ |
||||
".\infblock.h"\ |
||||
".\infcodes.h"\ |
||||
".\inftrees.h"\ |
||||
".\infutil.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infcodes.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFCO=\ |
||||
".\infblock.h"\ |
||||
".\infcodes.h"\ |
||||
".\inffast.h"\ |
||||
".\inftrees.h"\ |
||||
".\infutil.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\inffast.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFFA=\ |
||||
".\infblock.h"\ |
||||
".\infcodes.h"\ |
||||
".\inffast.h"\ |
||||
".\inftrees.h"\ |
||||
".\infutil.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\inflate.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFLA=\ |
||||
".\infblock.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\inftrees.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFTR=\ |
||||
".\inftrees.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infutil.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_INFUT=\ |
||||
".\infblock.h"\ |
||||
".\infcodes.h"\ |
||||
".\inftrees.h"\ |
||||
".\infutil.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\trees.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_TREES=\ |
||||
".\deflate.h"\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\uncompr.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_UNCOM=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\unzip.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zip.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zlib.rc |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zlibvc.def |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zutil.c |
||||
|
||||
!IF "$(CFG)" == "zlibvc - Win32 Release" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp" |
||||
|
||||
DEP_CPP_ZUTIL=\ |
||||
".\zconf.h"\ |
||||
".\zlib.h"\ |
||||
".\zutil.h"\ |
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" |
||||
|
||||
!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" |
||||
|
||||
!ENDIF |
||||
|
||||
# End Source File |
||||
# End Group |
||||
# Begin Group "Header Files" |
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\deflate.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infblock.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infcodes.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\inffast.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\inftrees.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\infutil.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zconf.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zlib.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\zutil.h |
||||
# End Source File |
||||
# End Group |
||||
# Begin Group "Resource Files" |
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" |
||||
# End Group |
||||
# End Target |
||||
# End Project |
@ -1,41 +0,0 @@ |
||||
Microsoft Developer Studio Workspace File, Format Version 5.00 |
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! |
||||
|
||||
############################################################################### |
||||
|
||||
Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4> |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<4> |
||||
{{{ |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
||||
Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4> |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<4> |
||||
{{{ |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
||||
Global: |
||||
|
||||
Package=<5> |
||||
{{{ |
||||
}}} |
||||
|
||||
Package=<3> |
||||
{{{ |
||||
}}} |
||||
|
||||
############################################################################### |
||||
|
@ -0,0 +1,149 @@ |
||||
|
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
#include <windows.h> |
||||
#include "zlib.h" |
||||
|
||||
int ReadFileMemory(const char* filename,long* plFileSize,void** pFilePtr) |
||||
{ |
||||
FILE* stream; |
||||
void* ptr; |
||||
int retVal=1; |
||||
stream=fopen(filename, "rb"); |
||||
if (stream==NULL) |
||||
return 0; |
||||
|
||||
fseek(stream,0,SEEK_END); |
||||
|
||||
*plFileSize=ftell(stream); |
||||
fseek(stream,0,SEEK_SET); |
||||
ptr=malloc((*plFileSize)+1); |
||||
if (ptr==NULL) |
||||
retVal=0; |
||||
else |
||||
{ |
||||
if (fread(ptr, 1, *plFileSize,stream) != (*plFileSize)) |
||||
retVal=0; |
||||
} |
||||
fclose(stream); |
||||
*pFilePtr=ptr; |
||||
return retVal; |
||||
} |
||||
|
||||
int main(int argc, char *argv[]) |
||||
{ |
||||
int BlockSizeCompress=0x8000; |
||||
int BlockSizeUncompress=0x8000; |
||||
int cprLevel=Z_DEFAULT_COMPRESSION ; |
||||
long lFileSize; |
||||
unsigned char* FilePtr; |
||||
long lBufferSizeCpr; |
||||
long lBufferSizeUncpr; |
||||
long lCompressedSize=0; |
||||
unsigned char* CprPtr; |
||||
unsigned char* UncprPtr; |
||||
long lSizeCpr,lSizeUncpr; |
||||
DWORD dwGetTick; |
||||
|
||||
if (argc<=1) |
||||
{ |
||||
printf("run TestZlib <File> [BlockSizeCompress] [BlockSizeUncompress] [compres. level]\n"); |
||||
return 0; |
||||
} |
||||
|
||||
if (ReadFileMemory(argv[1],&lFileSize,&FilePtr)==0) |
||||
{ |
||||
printf("error reading %s\n",argv[1]); |
||||
return 1; |
||||
} |
||||
else printf("file %s read, %u bytes\n",argv[1],lFileSize); |
||||
|
||||
if (argc>=3) |
||||
BlockSizeCompress=atol(argv[2]); |
||||
|
||||
if (argc>=4) |
||||
BlockSizeUncompress=atol(argv[3]); |
||||
|
||||
if (argc>=5) |
||||
cprLevel=(int)atol(argv[4]); |
||||
|
||||
lBufferSizeCpr = lFileSize + (lFileSize/0x10) + 0x200; |
||||
lBufferSizeUncpr = lBufferSizeCpr; |
||||
|
||||
CprPtr=(unsigned char*)malloc(lBufferSizeCpr + BlockSizeCompress); |
||||
UncprPtr=(unsigned char*)malloc(lBufferSizeUncpr + BlockSizeUncompress); |
||||
|
||||
dwGetTick=GetTickCount(); |
||||
{ |
||||
z_stream zcpr; |
||||
int ret=Z_OK; |
||||
long lOrigToDo = lFileSize; |
||||
long lOrigDone = 0; |
||||
int step=0; |
||||
memset(&zcpr,0,sizeof(z_stream)); |
||||
deflateInit(&zcpr,cprLevel); |
||||
|
||||
zcpr.next_in = FilePtr; |
||||
zcpr.next_out = CprPtr; |
||||
|
||||
|
||||
do |
||||
{ |
||||
long all_read_before = zcpr.total_in; |
||||
zcpr.avail_in = min(lOrigToDo,BlockSizeCompress); |
||||
zcpr.avail_out = BlockSizeCompress; |
||||
ret=deflate(&zcpr,(zcpr.avail_in==lOrigToDo) ? Z_FINISH : Z_SYNC_FLUSH); |
||||
lOrigDone += (zcpr.total_in-all_read_before); |
||||
lOrigToDo -= (zcpr.total_in-all_read_before); |
||||
step++; |
||||
} while (ret==Z_OK); |
||||
|
||||
lSizeCpr=zcpr.total_out; |
||||
deflateEnd(&zcpr); |
||||
dwGetTick=GetTickCount()-dwGetTick; |
||||
printf("total compress size = %u, in %u step\n",lSizeCpr,step); |
||||
printf("time = %u msec = %f sec\n\n",dwGetTick,dwGetTick/(double)1000.); |
||||
} |
||||
|
||||
dwGetTick=GetTickCount(); |
||||
{ |
||||
z_stream zcpr; |
||||
int ret=Z_OK; |
||||
long lOrigToDo = lSizeCpr; |
||||
long lOrigDone = 0; |
||||
int step=0; |
||||
memset(&zcpr,0,sizeof(z_stream)); |
||||
inflateInit(&zcpr); |
||||
|
||||
zcpr.next_in = CprPtr; |
||||
zcpr.next_out = UncprPtr; |
||||
|
||||
|
||||
do |
||||
{ |
||||
long all_read_before = zcpr.total_in; |
||||
zcpr.avail_in = min(lOrigToDo,BlockSizeUncompress); |
||||
zcpr.avail_out = BlockSizeUncompress; |
||||
ret=inflate(&zcpr,Z_SYNC_FLUSH); |
||||
lOrigDone += (zcpr.total_in-all_read_before); |
||||
lOrigToDo -= (zcpr.total_in-all_read_before); |
||||
step++; |
||||
} while (ret==Z_OK); |
||||
|
||||
lSizeUncpr=zcpr.total_out; |
||||
inflateEnd(&zcpr); |
||||
dwGetTick=GetTickCount()-dwGetTick; |
||||
printf("total uncompress size = %u, in %u step\n",lSizeUncpr,step); |
||||
printf("time = %u msec = %f sec\n\n",dwGetTick,dwGetTick/(double)1000.); |
||||
} |
||||
|
||||
if (lSizeUncpr==lFileSize) |
||||
{ |
||||
if (memcmp(FilePtr,UncprPtr,lFileSize)==0) |
||||
printf("compare ok\n"); |
||||
|
||||
} |
||||
|
||||
return 0; |
||||
|
||||
} |
@ -0,0 +1,21 @@ |
||||
Microsoft Visual Studio Solution File, Format Version 7.00 |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfiguration) = preSolution |
||||
ConfigName.0 = Debug |
||||
ConfigName.1 = Release |
||||
EndGlobalSection |
||||
GlobalSection(ProjectDependencies) = postSolution |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfiguration) = postSolution |
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug.ActiveCfg = Debug|Win32 |
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug.Build.0 = Debug|Win32 |
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release.ActiveCfg = Release|Win32 |
||||
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release.Build.0 = Release|Win32 |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityAddIns) = postSolution |
||||
EndGlobalSection |
||||
EndGlobal |
@ -0,0 +1,124 @@ |
||||
<?xml version="1.0" encoding = "Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.00" |
||||
Name="testzlib" |
||||
ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" |
||||
Keyword="Win32Proj"> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="Debug" |
||||
IntermediateDirectory="Debug" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" |
||||
MinimalRebuild="TRUE" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="5" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="4"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/testzlib.exe" |
||||
LinkIncremental="2" |
||||
GenerateDebugInformation="TRUE" |
||||
ProgramDatabaseFile="$(OutDir)/testzlib.pdb" |
||||
SubSystem="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="Release" |
||||
IntermediateDirectory="Release" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="2" |
||||
InlineFunctionExpansion="1" |
||||
OmitFramePointers="TRUE" |
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" |
||||
StringPooling="TRUE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="3"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/testzlib.exe" |
||||
LinkIncremental="1" |
||||
GenerateDebugInformation="TRUE" |
||||
SubSystem="1" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
OptimizeForWindows98="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> |
||||
<File |
||||
RelativePath="testzlib.c"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc"> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> |
||||
</Filter> |
||||
<File |
||||
RelativePath="zlib.lib"> |
||||
</File> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,17 @@ |
||||
For create the 16 and 32 bits DLL of Zlib 1.20 |
||||
|
||||
For the 16 bits : |
||||
unzip zlib120.zip and copy file from contrib\vstudio\vc15_16 and from contrib\minizip in the same directory |
||||
open zlib16.mak with Microsoft Visual C++ 1.52 |
||||
|
||||
|
||||
For the 32 bits : |
||||
unzip zlib120.zip and copy file from contrib\vstudio\vc70_32 and from contrib\minizip in the same directory |
||||
You can also need unzip http://www.winimage.com/zLibDll/crtdll.zip |
||||
|
||||
If you are using x86, use target Release |
||||
open zlibvc.sln with Microsoft Visual C++ 7.0 (Visual Studio .net) |
||||
|
||||
|
||||
Note : You don't need recompile yourself. There is compiled .LIB in |
||||
http://www.winimage.com/zLibDll |
@ -0,0 +1,94 @@ |
||||
LIBRARY "zlib" |
||||
|
||||
DESCRIPTION '"""zlib data compression library"""' |
||||
|
||||
EXETYPE WINDOWS |
||||
|
||||
VERSION 1.20 |
||||
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE |
||||
DATA PRELOAD MOVEABLE SINGLE |
||||
|
||||
|
||||
HEAPSIZE 32768,8192 |
||||
|
||||
EXPORTS |
||||
adler32 @1 |
||||
compress @2 |
||||
crc32 @3 |
||||
deflate @4 |
||||
deflateCopy @5 |
||||
deflateEnd @6 |
||||
deflateInit2_ @7 |
||||
deflateInit_ @8 |
||||
deflateParams @9 |
||||
deflateReset @10 |
||||
deflateSetDictionary @11 |
||||
gzclose @12 |
||||
gzdopen @13 |
||||
gzerror @14 |
||||
gzflush @15 |
||||
gzopen @16 |
||||
gzread @17 |
||||
gzwrite @18 |
||||
inflate @19 |
||||
inflateEnd @20 |
||||
inflateInit2_ @21 |
||||
inflateInit_ @22 |
||||
inflateReset @23 |
||||
inflateSetDictionary @24 |
||||
inflateSync @25 |
||||
uncompress @26 |
||||
zlibVersion @27 |
||||
_gzprintf @28 |
||||
gzputc @29 |
||||
gzgetc @30 |
||||
gzseek @31 |
||||
gzrewind @32 |
||||
gztell @33 |
||||
gzeof @34 |
||||
gzsetparams @35 |
||||
zError @36 |
||||
inflateSyncPoint @37 |
||||
get_crc_table @38 |
||||
compress2 @39 |
||||
gzputs @40 |
||||
gzgets @41 |
||||
inflateCopy @42 |
||||
inflateBackInit_ @43 |
||||
inflateBack @44 |
||||
inflateBackEnd @45 |
||||
compressBound @46 |
||||
|
||||
unzOpen @61 |
||||
unzClose @62 |
||||
unzGetGlobalInfo @63 |
||||
unzGetCurrentFileInfo @64 |
||||
unzGoToFirstFile @65 |
||||
unzGoToNextFile @66 |
||||
unzOpenCurrentFile @67 |
||||
unzReadCurrentFile @68 |
||||
unzOpenCurrentFile3 @69 |
||||
unztell @70 |
||||
unzeof @71 |
||||
unzCloseCurrentFile @72 |
||||
unzGetGlobalComment @73 |
||||
unzStringFileNameCompare @74 |
||||
unzLocateFile @75 |
||||
unzGetLocalExtrafield @76 |
||||
unzOpen2 @77 |
||||
unzOpenCurrentFile2 @78 |
||||
unzOpenCurrentFilePassword @79 |
||||
|
||||
zipOpen @80 |
||||
zipOpenNewFileInZip @81 |
||||
zipWriteInFileInZip @82 |
||||
zipCloseFileInZip @83 |
||||
zipClose @84 |
||||
zipOpenNewFileInZip2 @86 |
||||
zipCloseFileInZipRaw @87 |
||||
zipOpen2 @88 |
||||
zipOpenNewFileInZip3 @89 |
||||
|
||||
unzGetFilePos @100 |
||||
unzGoToFilePos @101 |
@ -0,0 +1,256 @@ |
||||
# Microsoft Visual C++ generated build script - Do not modify
|
||||
|
||||
PROJ = ZLIB16
|
||||
DEBUG = 0
|
||||
PROGTYPE = 1
|
||||
CALLER =
|
||||
ARGS =
|
||||
DLLS =
|
||||
D_RCDEFINES = -d_DEBUG
|
||||
R_RCDEFINES = -dNDEBUG
|
||||
ORIGIN = MSVC
|
||||
ORIGIN_VER = 1.00
|
||||
PROJPATH = c:\zlib\
|
||||
USEMFC = 0
|
||||
CC = cl
|
||||
CPP = cl
|
||||
CXX = cl
|
||||
CCREATEPCHFLAG =
|
||||
CPPCREATEPCHFLAG =
|
||||
CUSEPCHFLAG =
|
||||
CPPUSEPCHFLAG =
|
||||
FIRSTC = ADLER32.C
|
||||
FIRSTCPP =
|
||||
RC = rc
|
||||
CFLAGS_D_WDLL = /nologo /G2 /W3 /Zi /ALw /Od /D "_DEBUG" /D "WINDOWS" /D "ZLIB_DLL" /FR /GD /Fd"ZLIB.PDB"
|
||||
CFLAGS_R_WDLL = /nologo /W3 /ALw /O1 /D "NDEBUG" /D "WINDOWS" /D "ZLIB_DLL" /FR /GD
|
||||
LFLAGS_D_WDLL = /NOLOGO /ONERROR:NOEXE /NOD /PACKC:61440 /CO /NOE /ALIGN:16 /MAP:FULL
|
||||
LFLAGS_R_WDLL = /NOLOGO /ONERROR:NOEXE /NOD /PACKC:61440 /NOE /ALIGN:16 /MAP:FULL
|
||||
LIBS_D_WDLL = oldnames libw commdlg shell olecli olesvr ldllcew
|
||||
LIBS_R_WDLL = oldnames libw commdlg shell olecli olesvr ldllcew
|
||||
RCFLAGS = /nologo
|
||||
RESFLAGS = /nologo
|
||||
RUNFLAGS =
|
||||
DEFFILE = ZLIB16.DEF
|
||||
OBJS_EXT =
|
||||
LIBS_EXT =
|
||||
!if "$(DEBUG)" == "1" |
||||
CFLAGS = $(CFLAGS_D_WDLL)
|
||||
LFLAGS = $(LFLAGS_D_WDLL)
|
||||
LIBS = $(LIBS_D_WDLL)
|
||||
MAPFILE = nul
|
||||
RCDEFINES = $(D_RCDEFINES)
|
||||
!else |
||||
CFLAGS = $(CFLAGS_R_WDLL)
|
||||
LFLAGS = $(LFLAGS_R_WDLL)
|
||||
LIBS = $(LIBS_R_WDLL)
|
||||
MAPFILE = nul
|
||||
RCDEFINES = $(R_RCDEFINES)
|
||||
!endif |
||||
!if [if exist MSVC.BND del MSVC.BND] |
||||
!endif |
||||
SBRS = ADLER32.SBR \
|
||||
COMPRESS.SBR \
|
||||
CRC32.SBR \
|
||||
DEFLATE.SBR \
|
||||
GZIO.SBR \
|
||||
INFFAST.SBR \
|
||||
INFLATE.SBR \
|
||||
TREES.SBR \
|
||||
UNCOMPR.SBR \
|
||||
ZUTIL.SBR \
|
||||
ZIP.SBR \
|
||||
UNZIP.SBR \
|
||||
INFBACK.SBR \
|
||||
IOAPI.SBR \
|
||||
INFTREES.SBR
|
||||
|
||||
|
||||
ADLER32_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
COMPRESS_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
CRC32_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\crc32.h
|
||||
|
||||
|
||||
DEFLATE_DEP = c:\zlib\deflate.h \
|
||||
c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
GZIO_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
INFFAST_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\inftrees.h \
|
||||
c:\zlib\inflate.h \
|
||||
c:\zlib\inffast.h
|
||||
|
||||
|
||||
INFLATE_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\inftrees.h \
|
||||
c:\zlib\inflate.h \
|
||||
c:\zlib\inffast.h \
|
||||
c:\zlib\inffixed.h
|
||||
|
||||
|
||||
TREES_DEP = c:\zlib\deflate.h \
|
||||
c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\trees.h
|
||||
|
||||
|
||||
UNCOMPR_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
ZUTIL_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h
|
||||
|
||||
|
||||
ZLIB16_RCDEP =
|
||||
|
||||
ZIP_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\zip.h \
|
||||
c:\zlib\ioapi.h
|
||||
|
||||
|
||||
UNZIP_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\unzip.h \
|
||||
c:\zlib\ioapi.h
|
||||
|
||||
|
||||
INFBACK_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\inftrees.h \
|
||||
c:\zlib\inflate.h \
|
||||
c:\zlib\inffast.h \
|
||||
c:\zlib\inffixed.h
|
||||
|
||||
|
||||
IOAPI_DEP = c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\ioapi.h
|
||||
|
||||
|
||||
INFTREES_DEP = c:\zlib\zutil.h \
|
||||
c:\zlib\zlib.h \
|
||||
c:\zlib\zconf.h \
|
||||
c:\zlib\inftrees.h
|
||||
|
||||
|
||||
all: $(PROJ).DLL $(PROJ).BSC |
||||
|
||||
ADLER32.OBJ: ADLER32.C $(ADLER32_DEP) |
||||
$(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c ADLER32.C
|
||||
|
||||
COMPRESS.OBJ: COMPRESS.C $(COMPRESS_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c COMPRESS.C
|
||||
|
||||
CRC32.OBJ: CRC32.C $(CRC32_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c CRC32.C
|
||||
|
||||
DEFLATE.OBJ: DEFLATE.C $(DEFLATE_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c DEFLATE.C
|
||||
|
||||
GZIO.OBJ: GZIO.C $(GZIO_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c GZIO.C
|
||||
|
||||
INFFAST.OBJ: INFFAST.C $(INFFAST_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c INFFAST.C
|
||||
|
||||
INFLATE.OBJ: INFLATE.C $(INFLATE_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c INFLATE.C
|
||||
|
||||
TREES.OBJ: TREES.C $(TREES_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c TREES.C
|
||||
|
||||
UNCOMPR.OBJ: UNCOMPR.C $(UNCOMPR_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c UNCOMPR.C
|
||||
|
||||
ZUTIL.OBJ: ZUTIL.C $(ZUTIL_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ZUTIL.C
|
||||
|
||||
ZLIB16.RES: ZLIB16.RC $(ZLIB16_RCDEP) |
||||
$(RC) $(RCFLAGS) $(RCDEFINES) -r ZLIB16.RC
|
||||
|
||||
ZIP.OBJ: ZIP.C $(ZIP_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ZIP.C
|
||||
|
||||
UNZIP.OBJ: UNZIP.C $(UNZIP_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c UNZIP.C
|
||||
|
||||
INFBACK.OBJ: INFBACK.C $(INFBACK_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c INFBACK.C
|
||||
|
||||
IOAPI.OBJ: IOAPI.C $(IOAPI_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c IOAPI.C
|
||||
|
||||
INFTREES.OBJ: INFTREES.C $(INFTREES_DEP) |
||||
$(CC) $(CFLAGS) $(CUSEPCHFLAG) /c INFTREES.C
|
||||
|
||||
|
||||
$(PROJ).DLL:: ZLIB16.RES |
||||
|
||||
$(PROJ).DLL:: ADLER32.OBJ COMPRESS.OBJ CRC32.OBJ DEFLATE.OBJ GZIO.OBJ INFFAST.OBJ \
|
||||
INFLATE.OBJ TREES.OBJ UNCOMPR.OBJ ZUTIL.OBJ ZIP.OBJ UNZIP.OBJ INFBACK.OBJ IOAPI.OBJ \
|
||||
INFTREES.OBJ $(OBJS_EXT) $(DEFFILE)
|
||||
echo >NUL @<<$(PROJ).CRF
|
||||
ADLER32.OBJ + |
||||
COMPRESS.OBJ + |
||||
CRC32.OBJ + |
||||
DEFLATE.OBJ + |
||||
GZIO.OBJ + |
||||
INFFAST.OBJ + |
||||
INFLATE.OBJ + |
||||
TREES.OBJ + |
||||
UNCOMPR.OBJ + |
||||
ZUTIL.OBJ + |
||||
ZIP.OBJ + |
||||
UNZIP.OBJ + |
||||
INFBACK.OBJ + |
||||
IOAPI.OBJ + |
||||
INFTREES.OBJ + |
||||
$(OBJS_EXT) |
||||
$(PROJ).DLL |
||||
$(MAPFILE) |
||||
C:\MSVC\LIB\+ |
||||
C:\MSVC\MFC\LIB\+ |
||||
E:\PROGRAMFILES\MICROSOFTVISUALSTUDIO.NET\FRAMEWORKSDK\LIB\+ |
||||
$(LIBS) |
||||
$(DEFFILE); |
||||
<< |
||||
link $(LFLAGS) @$(PROJ).CRF
|
||||
$(RC) $(RESFLAGS) ZLIB16.RES $@
|
||||
@copy $(PROJ).CRF MSVC.BND
|
||||
implib /nowep $(PROJ).LIB $(PROJ).DLL
|
||||
|
||||
$(PROJ).DLL:: ZLIB16.RES |
||||
if not exist MSVC.BND $(RC) $(RESFLAGS) ZLIB16.RES $@
|
||||
|
||||
run: $(PROJ).DLL |
||||
$(PROJ) $(RUNFLAGS)
|
||||
|
||||
|
||||
$(PROJ).BSC: $(SBRS) |
||||
bscmake @<<
|
||||
/o$@ $(SBRS) |
||||
<< |
@ -0,0 +1,33 @@ |
||||
#include <windows.h> |
||||
#include <ver.h> |
||||
|
||||
#define IDR_VERSION1 1 |
||||
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE |
||||
FILEVERSION 1,2,0,0 |
||||
PRODUCTVERSION 1,2,0,0 |
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK |
||||
FILEFLAGS 0 |
||||
FILEOS VOS_DOS_WINDOWS16 |
||||
FILETYPE VFT_DLL |
||||
FILESUBTYPE 0 // not used |
||||
BEGIN |
||||
BLOCK "StringFileInfo" |
||||
BEGIN |
||||
BLOCK "040904E4" |
||||
//language ID = U.S. English, char set = Windows, Multilingual |
||||
|
||||
BEGIN |
||||
VALUE "FileDescription", "zlib data compression library\0" |
||||
VALUE "FileVersion", "1.2.0\0" |
||||
VALUE "InternalName", "zlib16\0" |
||||
VALUE "OriginalFilename", "zlib16.dll\0" |
||||
VALUE "ProductName", "ZLib16.DLL\0" |
||||
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" |
||||
VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" |
||||
END |
||||
END |
||||
BLOCK "VarFileInfo" |
||||
BEGIN |
||||
VALUE "Translation", 0x0409, 1252 |
||||
END |
||||
END |
@ -0,0 +1,905 @@ |
||||
; |
||||
; gvmat32.asm -- Asm portion of the optimized longest_match for 32 bits x86 |
||||
; Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant. |
||||
; File written by Gilles Vollant, by modifiying the longest_match |
||||
; from Jean-loup Gailly in deflate.c |
||||
; It need wmask == 0x7fff |
||||
; (assembly code is faster with a fixed wmask) |
||||
; |
||||
; For Visual C++ 4.2 and ML 6.11c (version in directory \MASM611C of Win95 DDK) |
||||
; I compile with : "ml /coff /Zi /c gvmat32.asm" |
||||
; |
||||
|
||||
;uInt longest_match_7fff(s, cur_match) |
||||
; deflate_state *s; |
||||
; IPos cur_match; /* current match */ |
||||
|
||||
NbStack equ 76 |
||||
cur_match equ dword ptr[esp+NbStack-0] |
||||
str_s equ dword ptr[esp+NbStack-4] |
||||
; 5 dword on top (ret,ebp,esi,edi,ebx) |
||||
adrret equ dword ptr[esp+NbStack-8] |
||||
pushebp equ dword ptr[esp+NbStack-12] |
||||
pushedi equ dword ptr[esp+NbStack-16] |
||||
pushesi equ dword ptr[esp+NbStack-20] |
||||
pushebx equ dword ptr[esp+NbStack-24] |
||||
|
||||
chain_length equ dword ptr [esp+NbStack-28] |
||||
limit equ dword ptr [esp+NbStack-32] |
||||
best_len equ dword ptr [esp+NbStack-36] |
||||
window equ dword ptr [esp+NbStack-40] |
||||
prev equ dword ptr [esp+NbStack-44] |
||||
scan_start equ word ptr [esp+NbStack-48] |
||||
wmask equ dword ptr [esp+NbStack-52] |
||||
match_start_ptr equ dword ptr [esp+NbStack-56] |
||||
nice_match equ dword ptr [esp+NbStack-60] |
||||
scan equ dword ptr [esp+NbStack-64] |
||||
|
||||
windowlen equ dword ptr [esp+NbStack-68] |
||||
match_start equ dword ptr [esp+NbStack-72] |
||||
strend equ dword ptr [esp+NbStack-76] |
||||
NbStackAdd equ (NbStack-24) |
||||
|
||||
.386p |
||||
|
||||
name gvmatch |
||||
.MODEL FLAT |
||||
|
||||
|
||||
|
||||
; all the +4 offsets are due to the addition of pending_buf_size (in zlib |
||||
; in the deflate_state structure since the asm code was first written |
||||
; (if you compile with zlib 1.0.4 or older, remove the +4). |
||||
; Note : these value are good with a 8 bytes boundary pack structure |
||||
dep_chain_length equ 70h+4 |
||||
dep_window equ 2ch+4 |
||||
dep_strstart equ 60h+4 |
||||
dep_prev_length equ 6ch+4 |
||||
dep_nice_match equ 84h+4 |
||||
dep_w_size equ 20h+4 |
||||
dep_prev equ 34h+4 |
||||
dep_w_mask equ 28h+4 |
||||
dep_good_match equ 80h+4 |
||||
dep_match_start equ 64h+4 |
||||
dep_lookahead equ 68h+4 |
||||
|
||||
|
||||
_TEXT segment |
||||
|
||||
IFDEF NOUNDERLINE |
||||
public longest_match_7fff |
||||
public longest_match_686 |
||||
; public match_init |
||||
ELSE |
||||
public _longest_match_7fff |
||||
public _longest_match_686 |
||||
; public _match_init |
||||
ENDIF |
||||
|
||||
MAX_MATCH equ 258 |
||||
MIN_MATCH equ 3 |
||||
MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) |
||||
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE |
||||
;match_init proc near |
||||
; ret |
||||
;match_init endp |
||||
ELSE |
||||
;_match_init proc near |
||||
; ret |
||||
;_match_init endp |
||||
ENDIF |
||||
|
||||
|
||||
IFDEF NOUNDERLINE |
||||
longest_match_7fff proc near |
||||
ELSE |
||||
_longest_match_7fff proc near |
||||
ENDIF |
||||
|
||||
mov edx,[esp+4] |
||||
|
||||
|
||||
|
||||
push ebp |
||||
push edi |
||||
push esi |
||||
push ebx |
||||
|
||||
sub esp,NbStackAdd |
||||
|
||||
; initialize or check the variables used in match.asm. |
||||
mov ebp,edx |
||||
|
||||
; chain_length = s->max_chain_length |
||||
; if (prev_length>=good_match) chain_length >>= 2 |
||||
mov edx,[ebp+dep_chain_length] |
||||
mov ebx,[ebp+dep_prev_length] |
||||
cmp [ebp+dep_good_match],ebx |
||||
ja noshr |
||||
shr edx,2 |
||||
noshr: |
||||
; we increment chain_length because in the asm, the --chain_lenght is in the beginning of the loop |
||||
inc edx |
||||
mov edi,[ebp+dep_nice_match] |
||||
mov chain_length,edx |
||||
mov eax,[ebp+dep_lookahead] |
||||
cmp eax,edi |
||||
; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; |
||||
jae nolookaheadnicematch |
||||
mov edi,eax |
||||
nolookaheadnicematch: |
||||
; best_len = s->prev_length |
||||
mov best_len,ebx |
||||
|
||||
; window = s->window |
||||
mov esi,[ebp+dep_window] |
||||
mov ecx,[ebp+dep_strstart] |
||||
mov window,esi |
||||
|
||||
mov nice_match,edi |
||||
; scan = window + strstart |
||||
add esi,ecx |
||||
mov scan,esi |
||||
; dx = *window |
||||
mov dx,word ptr [esi] |
||||
; bx = *(window+best_len-1) |
||||
mov bx,word ptr [esi+ebx-1] |
||||
add esi,MAX_MATCH-1 |
||||
; scan_start = *scan |
||||
mov scan_start,dx |
||||
; strend = scan + MAX_MATCH-1 |
||||
mov strend,esi |
||||
; bx = scan_end = *(window+best_len-1) |
||||
|
||||
; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? |
||||
; s->strstart - (IPos)MAX_DIST(s) : NIL; |
||||
|
||||
mov esi,[ebp+dep_w_size] |
||||
sub esi,MIN_LOOKAHEAD |
||||
; here esi = MAX_DIST(s) |
||||
sub ecx,esi |
||||
ja nodist |
||||
xor ecx,ecx |
||||
nodist: |
||||
mov limit,ecx |
||||
|
||||
; prev = s->prev |
||||
mov edx,[ebp+dep_prev] |
||||
mov prev,edx |
||||
|
||||
; |
||||
mov edx,dword ptr [ebp+dep_match_start] |
||||
mov bp,scan_start |
||||
mov eax,cur_match |
||||
mov match_start,edx |
||||
|
||||
mov edx,window |
||||
mov edi,edx |
||||
add edi,best_len |
||||
mov esi,prev |
||||
dec edi |
||||
; windowlen = window + best_len -1 |
||||
mov windowlen,edi |
||||
|
||||
jmp beginloop2 |
||||
align 4 |
||||
|
||||
; here, in the loop |
||||
; eax = ax = cur_match |
||||
; ecx = limit |
||||
; bx = scan_end |
||||
; bp = scan_start |
||||
; edi = windowlen (window + best_len -1) |
||||
; esi = prev |
||||
|
||||
|
||||
;// here; chain_length <=16 |
||||
normalbeg0add16: |
||||
add chain_length,16 |
||||
jz exitloop |
||||
normalbeg0: |
||||
cmp word ptr[edi+eax],bx |
||||
je normalbeg2noroll |
||||
rcontlabnoroll: |
||||
; cur_match = prev[cur_match & wmask] |
||||
and eax,7fffh |
||||
mov ax,word ptr[esi+eax*2] |
||||
; if cur_match > limit, go to exitloop |
||||
cmp ecx,eax |
||||
jnb exitloop |
||||
; if --chain_length != 0, go to exitloop |
||||
dec chain_length |
||||
jnz normalbeg0 |
||||
jmp exitloop |
||||
|
||||
normalbeg2noroll: |
||||
; if (scan_start==*(cur_match+window)) goto normalbeg2 |
||||
cmp bp,word ptr[edx+eax] |
||||
jne rcontlabnoroll |
||||
jmp normalbeg2 |
||||
|
||||
contloop3: |
||||
mov edi,windowlen |
||||
|
||||
; cur_match = prev[cur_match & wmask] |
||||
and eax,7fffh |
||||
mov ax,word ptr[esi+eax*2] |
||||
; if cur_match > limit, go to exitloop |
||||
cmp ecx,eax |
||||
jnbexitloopshort1: |
||||
jnb exitloop |
||||
; if --chain_length != 0, go to exitloop |
||||
|
||||
|
||||
; begin the main loop |
||||
beginloop2: |
||||
sub chain_length,16+1 |
||||
; if chain_length <=16, don't use the unrolled loop |
||||
jna normalbeg0add16 |
||||
|
||||
do16: |
||||
cmp word ptr[edi+eax],bx |
||||
je normalbeg2dc0 |
||||
|
||||
maccn MACRO lab |
||||
and eax,7fffh |
||||
mov ax,word ptr[esi+eax*2] |
||||
cmp ecx,eax |
||||
jnb exitloop |
||||
cmp word ptr[edi+eax],bx |
||||
je lab |
||||
ENDM |
||||
|
||||
rcontloop0: |
||||
maccn normalbeg2dc1 |
||||
|
||||
rcontloop1: |
||||
maccn normalbeg2dc2 |
||||
|
||||
rcontloop2: |
||||
maccn normalbeg2dc3 |
||||
|
||||
rcontloop3: |
||||
maccn normalbeg2dc4 |
||||
|
||||
rcontloop4: |
||||
maccn normalbeg2dc5 |
||||
|
||||
rcontloop5: |
||||
maccn normalbeg2dc6 |
||||
|
||||
rcontloop6: |
||||
maccn normalbeg2dc7 |
||||
|
||||
rcontloop7: |
||||
maccn normalbeg2dc8 |
||||
|
||||
rcontloop8: |
||||
maccn normalbeg2dc9 |
||||
|
||||
rcontloop9: |
||||
maccn normalbeg2dc10 |
||||
|
||||
rcontloop10: |
||||
maccn short normalbeg2dc11 |
||||
|
||||
rcontloop11: |
||||
maccn short normalbeg2dc12 |
||||
|
||||
rcontloop12: |
||||
maccn short normalbeg2dc13 |
||||
|
||||
rcontloop13: |
||||
maccn short normalbeg2dc14 |
||||
|
||||
rcontloop14: |
||||
maccn short normalbeg2dc15 |
||||
|
||||
rcontloop15: |
||||
and eax,7fffh |
||||
mov ax,word ptr[esi+eax*2] |
||||
cmp ecx,eax |
||||
jnb exitloop |
||||
|
||||
sub chain_length,16 |
||||
ja do16 |
||||
jmp normalbeg0add16 |
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||||
|
||||
normbeg MACRO rcontlab,valsub |
||||
; if we are here, we know that *(match+best_len-1) == scan_end |
||||
cmp bp,word ptr[edx+eax] |
||||
; if (match != scan_start) goto rcontlab |
||||
jne rcontlab |
||||
; calculate the good chain_length, and we'll compare scan and match string |
||||
add chain_length,16-valsub |
||||
jmp iseq |
||||
ENDM |
||||
|
||||
|
||||
normalbeg2dc11: |
||||
normbeg rcontloop11,11 |
||||
|
||||
normalbeg2dc12: |
||||
normbeg short rcontloop12,12 |
||||
|
||||
normalbeg2dc13: |
||||
normbeg short rcontloop13,13 |
||||
|
||||
normalbeg2dc14: |
||||
normbeg short rcontloop14,14 |
||||
|
||||
normalbeg2dc15: |
||||
normbeg short rcontloop15,15 |
||||
|
||||
normalbeg2dc10: |
||||
normbeg rcontloop10,10 |
||||
|
||||
normalbeg2dc9: |
||||
normbeg rcontloop9,9 |
||||
|
||||
normalbeg2dc8: |
||||
normbeg rcontloop8,8 |
||||
|
||||
normalbeg2dc7: |
||||
normbeg rcontloop7,7 |
||||
|
||||
normalbeg2dc6: |
||||
normbeg rcontloop6,6 |
||||
|
||||
normalbeg2dc5: |
||||
normbeg rcontloop5,5 |
||||
|
||||
normalbeg2dc4: |
||||
normbeg rcontloop4,4 |
||||
|
||||
normalbeg2dc3: |
||||
normbeg rcontloop3,3 |
||||
|
||||
normalbeg2dc2: |
||||
normbeg rcontloop2,2 |
||||
|
||||
normalbeg2dc1: |
||||
normbeg rcontloop1,1 |
||||
|
||||
normalbeg2dc0: |
||||
normbeg rcontloop0,0 |
||||
|
||||
|
||||
; we go in normalbeg2 because *(ushf*)(match+best_len-1) == scan_end |
||||
|
||||
normalbeg2: |
||||
mov edi,window |
||||
|
||||
cmp bp,word ptr[edi+eax] |
||||
jne contloop3 ; if *(ushf*)match != scan_start, continue |
||||
|
||||
iseq: |
||||
; if we are here, we know that *(match+best_len-1) == scan_end |
||||
; and (match == scan_start) |
||||
|
||||
mov edi,edx |
||||
mov esi,scan ; esi = scan |
||||
add edi,eax ; edi = window + cur_match = match |
||||
|
||||
mov edx,[esi+3] ; compare manually dword at match+3 |
||||
xor edx,[edi+3] ; and scan +3 |
||||
|
||||
jz begincompare ; if equal, go to long compare |
||||
|
||||
; we will determine the unmatch byte and calculate len (in esi) |
||||
or dl,dl |
||||
je eq1rr |
||||
mov esi,3 |
||||
jmp trfinval |
||||
eq1rr: |
||||
or dx,dx |
||||
je eq1 |
||||
|
||||
mov esi,4 |
||||
jmp trfinval |
||||
eq1: |
||||
and edx,0ffffffh |
||||
jz eq11 |
||||
mov esi,5 |
||||
jmp trfinval |
||||
eq11: |
||||
mov esi,6 |
||||
jmp trfinval |
||||
|
||||
begincompare: |
||||
; here we now scan and match begin same |
||||
add edi,6 |
||||
add esi,6 |
||||
mov ecx,(MAX_MATCH-(2+4))/4 ; scan for at most MAX_MATCH bytes |
||||
repe cmpsd ; loop until mismatch |
||||
|
||||
je trfin ; go to trfin if not unmatch |
||||
; we determine the unmatch byte |
||||
sub esi,4 |
||||
mov edx,[edi-4] |
||||
xor edx,[esi] |
||||
|
||||
or dl,dl |
||||
jnz trfin |
||||
inc esi |
||||
|
||||
or dx,dx |
||||
jnz trfin |
||||
inc esi |
||||
|
||||
and edx,0ffffffh |
||||
jnz trfin |
||||
inc esi |
||||
|
||||
trfin: |
||||
sub esi,scan ; esi = len |
||||
trfinval: |
||||
; here we have finised compare, and esi contain len of equal string |
||||
cmp esi,best_len ; if len > best_len, go newbestlen |
||||
ja short newbestlen |
||||
; now we restore edx, ecx and esi, for the big loop |
||||
mov esi,prev |
||||
mov ecx,limit |
||||
mov edx,window |
||||
jmp contloop3 |
||||
|
||||
newbestlen: |
||||
mov best_len,esi ; len become best_len |
||||
|
||||
mov match_start,eax ; save new position as match_start |
||||
cmp esi,nice_match ; if best_len >= nice_match, exit |
||||
jae exitloop |
||||
mov ecx,scan |
||||
mov edx,window ; restore edx=window |
||||
add ecx,esi |
||||
add esi,edx |
||||
|
||||
dec esi |
||||
mov windowlen,esi ; windowlen = window + best_len-1 |
||||
mov bx,[ecx-1] ; bx = *(scan+best_len-1) = scan_end |
||||
|
||||
; now we restore ecx and esi, for the big loop : |
||||
mov esi,prev |
||||
mov ecx,limit |
||||
jmp contloop3 |
||||
|
||||
exitloop: |
||||
; exit : s->match_start=match_start |
||||
mov ebx,match_start |
||||
mov ebp,str_s |
||||
mov ecx,best_len |
||||
mov dword ptr [ebp+dep_match_start],ebx |
||||
mov eax,dword ptr [ebp+dep_lookahead] |
||||
cmp ecx,eax |
||||
ja minexlo |
||||
mov eax,ecx |
||||
minexlo: |
||||
; return min(best_len,s->lookahead) |
||||
|
||||
; restore stack and register ebx,esi,edi,ebp |
||||
add esp,NbStackAdd |
||||
|
||||
pop ebx |
||||
pop esi |
||||
pop edi |
||||
pop ebp |
||||
ret |
||||
InfoAuthor: |
||||
; please don't remove this string ! |
||||
; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary! |
||||
db 0dh,0ah,"GVMat32 optimised assembly code written 1996-98 by Gilles Vollant",0dh,0ah |
||||
|
||||
|
||||
|
||||
IFDEF NOUNDERLINE |
||||
longest_match_7fff endp |
||||
ELSE |
||||
_longest_match_7fff endp |
||||
ENDIF |
||||
|
||||
|
||||
IFDEF NOUNDERLINE |
||||
cpudetect32 proc near |
||||
ELSE |
||||
_cpudetect32 proc near |
||||
ENDIF |
||||
|
||||
push ebx |
||||
|
||||
pushfd ; push original EFLAGS |
||||
pop eax ; get original EFLAGS |
||||
mov ecx, eax ; save original EFLAGS |
||||
xor eax, 40000h ; flip AC bit in EFLAGS |
||||
push eax ; save new EFLAGS value on stack |
||||
popfd ; replace current EFLAGS value |
||||
pushfd ; get new EFLAGS |
||||
pop eax ; store new EFLAGS in EAX |
||||
xor eax, ecx ; can’t toggle AC bit, processor=80386 |
||||
jz end_cpu_is_386 ; jump if 80386 processor |
||||
push ecx |
||||
popfd ; restore AC bit in EFLAGS first |
||||
|
||||
pushfd |
||||
pushfd |
||||
pop ecx |
||||
|
||||
mov eax, ecx ; get original EFLAGS |
||||
xor eax, 200000h ; flip ID bit in EFLAGS |
||||
push eax ; save new EFLAGS value on stack |
||||
popfd ; replace current EFLAGS value |
||||
pushfd ; get new EFLAGS |
||||
pop eax ; store new EFLAGS in EAX |
||||
popfd ; restore original EFLAGS |
||||
xor eax, ecx ; can’t toggle ID bit, |
||||
je is_old_486 ; processor=old |
||||
|
||||
mov eax,1 |
||||
db 0fh,0a2h ;CPUID |
||||
|
||||
exitcpudetect: |
||||
pop ebx |
||||
ret |
||||
|
||||
end_cpu_is_386: |
||||
mov eax,0300h |
||||
jmp exitcpudetect |
||||
|
||||
is_old_486: |
||||
mov eax,0400h |
||||
jmp exitcpudetect |
||||
|
||||
IFDEF NOUNDERLINE |
||||
cpudetect32 endp |
||||
ELSE |
||||
_cpudetect32 endp |
||||
ENDIF |
||||
|
||||
|
||||
|
||||
|
||||
MAX_MATCH equ 258 |
||||
MIN_MATCH equ 3 |
||||
MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1) |
||||
MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h) |
||||
|
||||
|
||||
;;; stack frame offsets |
||||
|
||||
chainlenwmask equ esp + 0 ; high word: current chain len |
||||
; low word: s->wmask |
||||
window equ esp + 4 ; local copy of s->window |
||||
windowbestlen equ esp + 8 ; s->window + bestlen |
||||
scanstart equ esp + 16 ; first two bytes of string |
||||
scanend equ esp + 12 ; last two bytes of string |
||||
scanalign equ esp + 20 ; dword-misalignment of string |
||||
nicematch equ esp + 24 ; a good enough match size |
||||
bestlen equ esp + 28 ; size of best match so far |
||||
scan equ esp + 32 ; ptr to string wanting match |
||||
|
||||
LocalVarsSize equ 36 |
||||
; saved ebx byte esp + 36 |
||||
; saved edi byte esp + 40 |
||||
; saved esi byte esp + 44 |
||||
; saved ebp byte esp + 48 |
||||
; return address byte esp + 52 |
||||
deflatestate equ esp + 56 ; the function arguments |
||||
curmatch equ esp + 60 |
||||
|
||||
;;; Offsets for fields in the deflate_state structure. These numbers |
||||
;;; are calculated from the definition of deflate_state, with the |
||||
;;; assumption that the compiler will dword-align the fields. (Thus, |
||||
;;; changing the definition of deflate_state could easily cause this |
||||
;;; program to crash horribly, without so much as a warning at |
||||
;;; compile time. Sigh.) |
||||
|
||||
dsWSize equ 36 |
||||
dsWMask equ 44 |
||||
dsWindow equ 48 |
||||
dsPrev equ 56 |
||||
dsMatchLen equ 88 |
||||
dsPrevMatch equ 92 |
||||
dsStrStart equ 100 |
||||
dsMatchStart equ 104 |
||||
dsLookahead equ 108 |
||||
dsPrevLen equ 112 |
||||
dsMaxChainLen equ 116 |
||||
dsGoodMatch equ 132 |
||||
dsNiceMatch equ 136 |
||||
|
||||
|
||||
;;; match.asm -- Pentium-Pro-optimized version of longest_match() |
||||
;;; Written for zlib 1.1.2 |
||||
;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com> |
||||
;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html |
||||
;;; |
||||
;;; This is free software; you can redistribute it and/or modify it |
||||
;;; under the terms of the GNU General Public License. |
||||
|
||||
;GLOBAL _longest_match, _match_init |
||||
|
||||
|
||||
;SECTION .text |
||||
|
||||
;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch) |
||||
|
||||
;_longest_match: |
||||
IFDEF NOUNDERLINE |
||||
longest_match_686 proc near |
||||
ELSE |
||||
_longest_match_686 proc near |
||||
ENDIF |
||||
|
||||
|
||||
;;; Save registers that the compiler may be using, and adjust esp to |
||||
;;; make room for our stack frame. |
||||
|
||||
push ebp |
||||
push edi |
||||
push esi |
||||
push ebx |
||||
sub esp, LocalVarsSize |
||||
|
||||
;;; Retrieve the function arguments. ecx will hold cur_match |
||||
;;; throughout the entire function. edx will hold the pointer to the |
||||
;;; deflate_state structure during the function's setup (before |
||||
;;; entering the main loop. |
||||
|
||||
mov edx, [deflatestate] |
||||
mov ecx, [curmatch] |
||||
|
||||
;;; uInt wmask = s->w_mask; |
||||
;;; unsigned chain_length = s->max_chain_length; |
||||
;;; if (s->prev_length >= s->good_match) { |
||||
;;; chain_length >>= 2; |
||||
;;; } |
||||
|
||||
mov eax, [edx + dsPrevLen] |
||||
mov ebx, [edx + dsGoodMatch] |
||||
cmp eax, ebx |
||||
mov eax, [edx + dsWMask] |
||||
mov ebx, [edx + dsMaxChainLen] |
||||
jl LastMatchGood |
||||
shr ebx, 2 |
||||
LastMatchGood: |
||||
|
||||
;;; chainlen is decremented once beforehand so that the function can |
||||
;;; use the sign flag instead of the zero flag for the exit test. |
||||
;;; It is then shifted into the high word, to make room for the wmask |
||||
;;; value, which it will always accompany. |
||||
|
||||
dec ebx |
||||
shl ebx, 16 |
||||
or ebx, eax |
||||
mov [chainlenwmask], ebx |
||||
|
||||
;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; |
||||
|
||||
mov eax, [edx + dsNiceMatch] |
||||
mov ebx, [edx + dsLookahead] |
||||
cmp ebx, eax |
||||
jl LookaheadLess |
||||
mov ebx, eax |
||||
LookaheadLess: mov [nicematch], ebx |
||||
|
||||
;;; register Bytef *scan = s->window + s->strstart; |
||||
|
||||
mov esi, [edx + dsWindow] |
||||
mov [window], esi |
||||
mov ebp, [edx + dsStrStart] |
||||
lea edi, [esi + ebp] |
||||
mov [scan], edi |
||||
|
||||
;;; Determine how many bytes the scan ptr is off from being |
||||
;;; dword-aligned. |
||||
|
||||
mov eax, edi |
||||
neg eax |
||||
and eax, 3 |
||||
mov [scanalign], eax |
||||
|
||||
;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? |
||||
;;; s->strstart - (IPos)MAX_DIST(s) : NIL; |
||||
|
||||
mov eax, [edx + dsWSize] |
||||
sub eax, MIN_LOOKAHEAD |
||||
sub ebp, eax |
||||
jg LimitPositive |
||||
xor ebp, ebp |
||||
LimitPositive: |
||||
|
||||
;;; int best_len = s->prev_length; |
||||
|
||||
mov eax, [edx + dsPrevLen] |
||||
mov [bestlen], eax |
||||
|
||||
;;; Store the sum of s->window + best_len in esi locally, and in esi. |
||||
|
||||
add esi, eax |
||||
mov [windowbestlen], esi |
||||
|
||||
;;; register ush scan_start = *(ushf*)scan; |
||||
;;; register ush scan_end = *(ushf*)(scan+best_len-1); |
||||
;;; Posf *prev = s->prev; |
||||
|
||||
movzx ebx, word ptr [edi] |
||||
mov [scanstart], ebx |
||||
movzx ebx, word ptr [edi + eax - 1] |
||||
mov [scanend], ebx |
||||
mov edi, [edx + dsPrev] |
||||
|
||||
;;; Jump into the main loop. |
||||
|
||||
mov edx, [chainlenwmask] |
||||
jmp short LoopEntry |
||||
|
||||
align 4 |
||||
|
||||
;;; do { |
||||
;;; match = s->window + cur_match; |
||||
;;; if (*(ushf*)(match+best_len-1) != scan_end || |
||||
;;; *(ushf*)match != scan_start) continue; |
||||
;;; [...] |
||||
;;; } while ((cur_match = prev[cur_match & wmask]) > limit |
||||
;;; && --chain_length != 0); |
||||
;;; |
||||
;;; Here is the inner loop of the function. The function will spend the |
||||
;;; majority of its time in this loop, and majority of that time will |
||||
;;; be spent in the first ten instructions. |
||||
;;; |
||||
;;; Within this loop: |
||||
;;; ebx = scanend |
||||
;;; ecx = curmatch |
||||
;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) |
||||
;;; esi = windowbestlen - i.e., (window + bestlen) |
||||
;;; edi = prev |
||||
;;; ebp = limit |
||||
|
||||
LookupLoop: |
||||
and ecx, edx |
||||
movzx ecx, word ptr [edi + ecx*2] |
||||
cmp ecx, ebp |
||||
jbe LeaveNow |
||||
sub edx, 00010000h |
||||
js LeaveNow |
||||
LoopEntry: movzx eax, word ptr [esi + ecx - 1] |
||||
cmp eax, ebx |
||||
jnz LookupLoop |
||||
mov eax, [window] |
||||
movzx eax, word ptr [eax + ecx] |
||||
cmp eax, [scanstart] |
||||
jnz LookupLoop |
||||
|
||||
;;; Store the current value of chainlen. |
||||
|
||||
mov [chainlenwmask], edx |
||||
|
||||
;;; Point edi to the string under scrutiny, and esi to the string we |
||||
;;; are hoping to match it up with. In actuality, esi and edi are |
||||
;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is |
||||
;;; initialized to -(MAX_MATCH_8 - scanalign). |
||||
|
||||
mov esi, [window] |
||||
mov edi, [scan] |
||||
add esi, ecx |
||||
mov eax, [scanalign] |
||||
mov edx, 0fffffef8h; -(MAX_MATCH_8) |
||||
lea edi, [edi + eax + 0108h] ;MAX_MATCH_8] |
||||
lea esi, [esi + eax + 0108h] ;MAX_MATCH_8] |
||||
|
||||
;;; Test the strings for equality, 8 bytes at a time. At the end, |
||||
;;; adjust edx so that it is offset to the exact byte that mismatched. |
||||
;;; |
||||
;;; We already know at this point that the first three bytes of the |
||||
;;; strings match each other, and they can be safely passed over before |
||||
;;; starting the compare loop. So what this code does is skip over 0-3 |
||||
;;; bytes, as much as necessary in order to dword-align the edi |
||||
;;; pointer. (esi will still be misaligned three times out of four.) |
||||
;;; |
||||
;;; It should be confessed that this loop usually does not represent |
||||
;;; much of the total running time. Replacing it with a more |
||||
;;; straightforward "rep cmpsb" would not drastically degrade |
||||
;;; performance. |
||||
|
||||
LoopCmps: |
||||
mov eax, [esi + edx] |
||||
xor eax, [edi + edx] |
||||
jnz LeaveLoopCmps |
||||
mov eax, [esi + edx + 4] |
||||
xor eax, [edi + edx + 4] |
||||
jnz LeaveLoopCmps4 |
||||
add edx, 8 |
||||
jnz LoopCmps |
||||
jmp short LenMaximum |
||||
LeaveLoopCmps4: add edx, 4 |
||||
LeaveLoopCmps: test eax, 0000FFFFh |
||||
jnz LenLower |
||||
add edx, 2 |
||||
shr eax, 16 |
||||
LenLower: sub al, 1 |
||||
adc edx, 0 |
||||
|
||||
;;; Calculate the length of the match. If it is longer than MAX_MATCH, |
||||
;;; then automatically accept it as the best possible match and leave. |
||||
|
||||
lea eax, [edi + edx] |
||||
mov edi, [scan] |
||||
sub eax, edi |
||||
cmp eax, MAX_MATCH |
||||
jge LenMaximum |
||||
|
||||
;;; If the length of the match is not longer than the best match we |
||||
;;; have so far, then forget it and return to the lookup loop. |
||||
|
||||
mov edx, [deflatestate] |
||||
mov ebx, [bestlen] |
||||
cmp eax, ebx |
||||
jg LongerMatch |
||||
mov esi, [windowbestlen] |
||||
mov edi, [edx + dsPrev] |
||||
mov ebx, [scanend] |
||||
mov edx, [chainlenwmask] |
||||
jmp LookupLoop |
||||
|
||||
;;; s->match_start = cur_match; |
||||
;;; best_len = len; |
||||
;;; if (len >= nice_match) break; |
||||
;;; scan_end = *(ushf*)(scan+best_len-1); |
||||
|
||||
LongerMatch: mov ebx, [nicematch] |
||||
mov [bestlen], eax |
||||
mov [edx + dsMatchStart], ecx |
||||
cmp eax, ebx |
||||
jge LeaveNow |
||||
mov esi, [window] |
||||
add esi, eax |
||||
mov [windowbestlen], esi |
||||
movzx ebx, word ptr [edi + eax - 1] |
||||
mov edi, [edx + dsPrev] |
||||
mov [scanend], ebx |
||||
mov edx, [chainlenwmask] |
||||
jmp LookupLoop |
||||
|
||||
;;; Accept the current string, with the maximum possible length. |
||||
|
||||
LenMaximum: mov edx, [deflatestate] |
||||
mov dword ptr [bestlen], MAX_MATCH |
||||
mov [edx + dsMatchStart], ecx |
||||
|
||||
;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; |
||||
;;; return s->lookahead; |
||||
|
||||
LeaveNow: |
||||
mov edx, [deflatestate] |
||||
mov ebx, [bestlen] |
||||
mov eax, [edx + dsLookahead] |
||||
cmp ebx, eax |
||||
jg LookaheadRet |
||||
mov eax, ebx |
||||
LookaheadRet: |
||||
|
||||
;;; Restore the stack and return from whence we came. |
||||
|
||||
add esp, LocalVarsSize |
||||
pop ebx |
||||
pop esi |
||||
pop edi |
||||
pop ebp |
||||
|
||||
ret |
||||
; please don't remove this string ! |
||||
; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary! |
||||
db 0dh,0ah,"asm686 with masm, code optimised assembly code from Brian Raiter, written 1998",0dh,0ah |
||||
|
||||
IFDEF NOUNDERLINE |
||||
longest_match_686 endp |
||||
ELSE |
||||
_longest_match_686 endp |
||||
ENDIF |
||||
|
||||
_TEXT ends |
||||
end |
Binary file not shown.
@ -0,0 +1,209 @@ |
||||
/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
|
||||
* Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant. |
||||
* File written by Gilles Vollant, by modifiying the longest_match |
||||
* from Jean-loup Gailly in deflate.c |
||||
* it prepare all parameters and call the assembly longest_match_gvasm |
||||
* longest_match execute standard C code is wmask != 0x7fff |
||||
* (assembly code is faster with a fixed wmask) |
||||
* |
||||
*/ |
||||
|
||||
#include "deflate.h" |
||||
|
||||
#undef FAR |
||||
//#include <windows.h>
|
||||
|
||||
#ifdef ASMV |
||||
#define NIL 0 |
||||
|
||||
#define UNALIGNED_OK |
||||
|
||||
|
||||
/* if your C compiler don't add underline before function name,
|
||||
define ADD_UNDERLINE_ASMFUNC */ |
||||
#ifdef ADD_UNDERLINE_ASMFUNC |
||||
#define longest_match_7fff _longest_match_7fff |
||||
#define longest_match_686 _longest_match_686 |
||||
#define cpudetect32 _cpudetect32 |
||||
#endif |
||||
|
||||
|
||||
|
||||
void match_init() |
||||
{ |
||||
} |
||||
|
||||
unsigned long cpudetect32(); |
||||
|
||||
uInt longest_match_c( |
||||
deflate_state *s, |
||||
IPos cur_match); /* current match */ |
||||
|
||||
|
||||
uInt longest_match_7fff( |
||||
deflate_state *s, |
||||
IPos cur_match); /* current match */ |
||||
|
||||
uInt longest_match_686( |
||||
deflate_state *s, |
||||
IPos cur_match); /* current match */ |
||||
|
||||
uInt longest_match( |
||||
deflate_state *s, |
||||
IPos cur_match) /* current match */ |
||||
{ |
||||
static uInt iIsPPro=2; |
||||
|
||||
if ((s->w_mask == 0x7fff) && (iIsPPro==0)) |
||||
return longest_match_7fff(s,cur_match); |
||||
|
||||
if (iIsPPro==1) |
||||
return longest_match_686(s,cur_match); |
||||
|
||||
if (iIsPPro==2) |
||||
iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0; |
||||
|
||||
return longest_match_c(s,cur_match); |
||||
} |
||||
|
||||
|
||||
|
||||
uInt longest_match_c(s, cur_match) |
||||
deflate_state *s; |
||||
IPos cur_match; /* current match */ |
||||
{ |
||||
unsigned chain_length = s->max_chain_length;/* max hash chain length */ |
||||
register Bytef *scan = s->window + s->strstart; /* current string */ |
||||
register Bytef *match; /* matched string */ |
||||
register int len; /* length of current match */ |
||||
int best_len = s->prev_length; /* best match length so far */ |
||||
int nice_match = s->nice_match; /* stop if match long enough */ |
||||
IPos limit = s->strstart > (IPos)MAX_DIST(s) ? |
||||
s->strstart - (IPos)MAX_DIST(s) : NIL; |
||||
/* Stop when cur_match becomes <= limit. To simplify the code,
|
||||
* we prevent matches with the string of window index 0. |
||||
*/ |
||||
Posf *prev = s->prev; |
||||
uInt wmask = s->w_mask; |
||||
|
||||
#ifdef UNALIGNED_OK |
||||
/* Compare two bytes at a time. Note: this is not always beneficial.
|
||||
* Try with and without -DUNALIGNED_OK to check. |
||||
*/ |
||||
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; |
||||
register ush scan_start = *(ushf*)scan; |
||||
register ush scan_end = *(ushf*)(scan+best_len-1); |
||||
#else |
||||
register Bytef *strend = s->window + s->strstart + MAX_MATCH; |
||||
register Byte scan_end1 = scan[best_len-1]; |
||||
register Byte scan_end = scan[best_len]; |
||||
#endif |
||||
|
||||
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
|
||||
* It is easy to get rid of this optimization if necessary. |
||||
*/ |
||||
Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); |
||||
|
||||
/* Do not waste too much time if we already have a good match: */ |
||||
if (s->prev_length >= s->good_match) { |
||||
chain_length >>= 2; |
||||
} |
||||
/* Do not look for matches beyond the end of the input. This is necessary
|
||||
* to make deflate deterministic. |
||||
*/ |
||||
if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; |
||||
|
||||
Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); |
||||
|
||||
do { |
||||
Assert(cur_match < s->strstart, "no future"); |
||||
match = s->window + cur_match; |
||||
|
||||
/* Skip to next match if the match length cannot increase
|
||||
* or if the match length is less than 2: |
||||
*/ |
||||
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) |
||||
/* This code assumes sizeof(unsigned short) == 2. Do not use
|
||||
* UNALIGNED_OK if your compiler uses a different size. |
||||
*/ |
||||
if (*(ushf*)(match+best_len-1) != scan_end || |
||||
*(ushf*)match != scan_start) continue; |
||||
|
||||
/* It is not necessary to compare scan[2] and match[2] since they are
|
||||
* always equal when the other bytes match, given that the hash keys |
||||
* are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at |
||||
* strstart+3, +5, ... up to strstart+257. We check for insufficient |
||||
* lookahead only every 4th comparison; the 128th check will be made |
||||
* at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is |
||||
* necessary to put more guard bytes at the end of the window, or |
||||
* to check more often for insufficient lookahead. |
||||
*/ |
||||
Assert(scan[2] == match[2], "scan[2]?"); |
||||
scan++, match++; |
||||
do { |
||||
} while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && |
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && |
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && |
||||
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && |
||||
scan < strend); |
||||
/* The funny "do {}" generates better code on most compilers */ |
||||
|
||||
/* Here, scan <= window+strstart+257 */ |
||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); |
||||
if (*scan == *match) scan++; |
||||
|
||||
len = (MAX_MATCH - 1) - (int)(strend-scan); |
||||
scan = strend - (MAX_MATCH-1); |
||||
|
||||
#else /* UNALIGNED_OK */ |
||||
|
||||
if (match[best_len] != scan_end || |
||||
match[best_len-1] != scan_end1 || |
||||
*match != *scan || |
||||
*++match != scan[1]) continue; |
||||
|
||||
/* The check at best_len-1 can be removed because it will be made
|
||||
* again later. (This heuristic is not always a win.) |
||||
* It is not necessary to compare scan[2] and match[2] since they |
||||
* are always equal when the other bytes match, given that |
||||
* the hash keys are equal and that HASH_BITS >= 8. |
||||
*/ |
||||
scan += 2, match++; |
||||
Assert(*scan == *match, "match[2]?"); |
||||
|
||||
/* We check for insufficient lookahead only every 8th comparison;
|
||||
* the 256th check will be made at strstart+258. |
||||
*/ |
||||
do { |
||||
} while (*++scan == *++match && *++scan == *++match && |
||||
*++scan == *++match && *++scan == *++match && |
||||
*++scan == *++match && *++scan == *++match && |
||||
*++scan == *++match && *++scan == *++match && |
||||
scan < strend); |
||||
|
||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); |
||||
|
||||
len = MAX_MATCH - (int)(strend - scan); |
||||
scan = strend - MAX_MATCH; |
||||
|
||||
#endif /* UNALIGNED_OK */ |
||||
|
||||
if (len > best_len) { |
||||
s->match_start = cur_match; |
||||
best_len = len; |
||||
if (len >= nice_match) break; |
||||
#ifdef UNALIGNED_OK |
||||
scan_end = *(ushf*)(scan+best_len-1); |
||||
#else |
||||
scan_end1 = scan[best_len-1]; |
||||
scan_end = scan[best_len]; |
||||
#endif |
||||
} |
||||
} while ((cur_match = prev[cur_match & wmask]) > limit |
||||
&& --chain_length != 0); |
||||
|
||||
if ((uInt)best_len <= s->lookahead) return (uInt)best_len; |
||||
return s->lookahead; |
||||
} |
||||
|
||||
#endif /* ASMV */ |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,124 @@ |
||||
<?xml version="1.0" encoding = "Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.00" |
||||
Name="miniunz" |
||||
ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694382A}" |
||||
Keyword="Win32Proj"> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="Debug" |
||||
IntermediateDirectory="Debug" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" |
||||
MinimalRebuild="TRUE" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="5" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="4"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/miniunz.exe" |
||||
LinkIncremental="2" |
||||
GenerateDebugInformation="TRUE" |
||||
ProgramDatabaseFile="$(OutDir)/miniunz.pdb" |
||||
SubSystem="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="Release" |
||||
IntermediateDirectory="Release" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="2" |
||||
InlineFunctionExpansion="1" |
||||
OmitFramePointers="TRUE" |
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" |
||||
StringPooling="TRUE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="3"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/miniunz.exe" |
||||
LinkIncremental="1" |
||||
GenerateDebugInformation="TRUE" |
||||
SubSystem="1" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
OptimizeForWindows98="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> |
||||
<File |
||||
RelativePath="miniunz.c"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc"> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> |
||||
</Filter> |
||||
<File |
||||
RelativePath="zlib.lib"> |
||||
</File> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,124 @@ |
||||
<?xml version="1.0" encoding = "Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.00" |
||||
Name="minizip" |
||||
ProjectGUID="{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}" |
||||
Keyword="Win32Proj"> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="Debug" |
||||
IntermediateDirectory="Debug" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" |
||||
MinimalRebuild="TRUE" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="5" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="4"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/minizip.exe" |
||||
LinkIncremental="2" |
||||
GenerateDebugInformation="TRUE" |
||||
ProgramDatabaseFile="$(OutDir)/minizip.pdb" |
||||
SubSystem="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="Release" |
||||
IntermediateDirectory="Release" |
||||
ConfigurationType="1" |
||||
CharacterSet="2"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="2" |
||||
InlineFunctionExpansion="1" |
||||
OmitFramePointers="TRUE" |
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" |
||||
StringPooling="TRUE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="TRUE" |
||||
DebugInformationFormat="3"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
OutputFile="$(OutDir)/minizip.exe" |
||||
LinkIncremental="1" |
||||
GenerateDebugInformation="TRUE" |
||||
SubSystem="1" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
OptimizeForWindows98="1" |
||||
TargetMachine="1"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> |
||||
<File |
||||
RelativePath="minizip.c"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc"> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> |
||||
</Filter> |
||||
<File |
||||
RelativePath="zlib.lib"> |
||||
</File> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,2 @@ |
||||
c:\masm611\bin\ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm |
||||
c:\masm611\bin\ml /coff /Zi /c /FlinffastAsm.lst inffastAsm.asm |
@ -0,0 +1,32 @@ |
||||
#include <windows.h> |
||||
|
||||
#define IDR_VERSION1 1 |
||||
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE |
||||
FILEVERSION 1,2,0,0 |
||||
PRODUCTVERSION 1,2,0,0 |
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK |
||||
FILEFLAGS 0 |
||||
FILEOS VOS_DOS_WINDOWS32 |
||||
FILETYPE VFT_DLL |
||||
FILESUBTYPE 0 // not used |
||||
BEGIN |
||||
BLOCK "StringFileInfo" |
||||
BEGIN |
||||
BLOCK "040904E4" |
||||
//language ID = U.S. English, char set = Windows, Multilingual |
||||
|
||||
BEGIN |
||||
VALUE "FileDescription", "zlib data compression library\0" |
||||
VALUE "FileVersion", "1.2.0.0\0" |
||||
VALUE "InternalName", "zlib\0" |
||||
VALUE "OriginalFilename", "zlib.dll\0" |
||||
VALUE "ProductName", "ZLib.DLL\0" |
||||
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" |
||||
VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" |
||||
END |
||||
END |
||||
BLOCK "VarFileInfo" |
||||
BEGIN |
||||
VALUE "Translation", 0x0409, 1252 |
||||
END |
||||
END |
@ -0,0 +1,253 @@ |
||||
<?xml version="1.0" encoding = "Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.00" |
||||
Name="zlibstat" |
||||
SccProjectName="" |
||||
SccLocalPath=""> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory=".\zlibstatDebug" |
||||
IntermediateDirectory=".\zlibstatDebug" |
||||
ConfigurationType="4" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="5" |
||||
PrecompiledHeaderFile=".\zlibstatDebug/zlibstat.pch" |
||||
AssemblerListingLocation=".\zlibstatDebug/" |
||||
ObjectFile=".\zlibstatDebug/" |
||||
ProgramDataBaseFileName=".\zlibstatDebug/" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE" |
||||
DebugInformationFormat="1"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLibrarianTool" |
||||
AdditionalOptions="/NODEFAULTLIB " |
||||
OutputFile=".\zlibstatDebug\zlibstat.lib" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="ReleaseAxp|Win32" |
||||
OutputDirectory=".\zlibsta0" |
||||
IntermediateDirectory=".\zlibsta0" |
||||
ConfigurationType="4" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibsta0/zlibstat.pch" |
||||
AssemblerListingLocation=".\zlibsta0/" |
||||
ObjectFile=".\zlibsta0/" |
||||
ProgramDataBaseFileName=".\zlibsta0/" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLibrarianTool" |
||||
AdditionalOptions="/NODEFAULTLIB " |
||||
OutputFile=".\zlibsta0\zlibstat.lib" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory=".\zlibstat" |
||||
IntermediateDirectory=".\zlibstat" |
||||
ConfigurationType="4" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32,ASMV" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibstat/zlibstat.pch" |
||||
AssemblerListingLocation=".\zlibstat/" |
||||
ObjectFile=".\zlibstat/" |
||||
ProgramDataBaseFileName=".\zlibstat/" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLibrarianTool" |
||||
AdditionalOptions="gvmat32.obj inffastAsm.obj /NODEFAULTLIB " |
||||
OutputFile=".\zlibstat\zlibstat.lib" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="ReleaseWithoutAsm|Win32" |
||||
OutputDirectory="zlibstatWithoutAsm" |
||||
IntermediateDirectory="zlibstatWithoutAsm" |
||||
ConfigurationType="4" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="4" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibstat/zlibstat.pch" |
||||
AssemblerListingLocation=".\zlibstatWithoutAsm/" |
||||
ObjectFile=".\zlibstatWithoutAsm/" |
||||
ProgramDataBaseFileName=".\zlibstatWithoutAsm/" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLibrarianTool" |
||||
AdditionalOptions=" /NODEFAULTLIB " |
||||
OutputFile=".\zlibstatWithoutAsm\zlibstat.lib" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCMIDLTool"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter=""> |
||||
<File |
||||
RelativePath=".\adler32.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\compress.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\crc32.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\deflate.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\gvmat32c.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\gzio.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\infback.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inffast.c"> |
||||
<FileConfiguration |
||||
Name="Release|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool"/> |
||||
</FileConfiguration> |
||||
<FileConfiguration |
||||
Name="ReleaseWithoutAsm|Win32"> |
||||
<Tool |
||||
Name="VCCLCompilerTool"/> |
||||
</FileConfiguration> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inflate.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inftrees.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\ioapi.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\trees.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\uncompr.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\unzip.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zip.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zlib.rc"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zlibvc.def"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zutil.c"> |
||||
</File> |
||||
</Filter> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,88 @@ |
||||
LIBRARY "zlib" |
||||
|
||||
VERSION 1.20 |
||||
|
||||
HEAPSIZE 1048576,8192 |
||||
|
||||
EXPORTS |
||||
adler32 @1 |
||||
compress @2 |
||||
crc32 @3 |
||||
deflate @4 |
||||
deflateCopy @5 |
||||
deflateEnd @6 |
||||
deflateInit2_ @7 |
||||
deflateInit_ @8 |
||||
deflateParams @9 |
||||
deflateReset @10 |
||||
deflateSetDictionary @11 |
||||
gzclose @12 |
||||
gzdopen @13 |
||||
gzerror @14 |
||||
gzflush @15 |
||||
gzopen @16 |
||||
gzread @17 |
||||
gzwrite @18 |
||||
inflate @19 |
||||
inflateEnd @20 |
||||
inflateInit2_ @21 |
||||
inflateInit_ @22 |
||||
inflateReset @23 |
||||
inflateSetDictionary @24 |
||||
inflateSync @25 |
||||
uncompress @26 |
||||
zlibVersion @27 |
||||
gzprintf @28 |
||||
gzputc @29 |
||||
gzgetc @30 |
||||
gzseek @31 |
||||
gzrewind @32 |
||||
gztell @33 |
||||
gzeof @34 |
||||
gzsetparams @35 |
||||
zError @36 |
||||
inflateSyncPoint @37 |
||||
get_crc_table @38 |
||||
compress2 @39 |
||||
gzputs @40 |
||||
gzgets @41 |
||||
inflateCopy @42 |
||||
inflateBackInit_ @43 |
||||
inflateBack @44 |
||||
inflateBackEnd @45 |
||||
compressBound @46 |
||||
|
||||
unzOpen @61 |
||||
unzClose @62 |
||||
unzGetGlobalInfo @63 |
||||
unzGetCurrentFileInfo @64 |
||||
unzGoToFirstFile @65 |
||||
unzGoToNextFile @66 |
||||
unzOpenCurrentFile @67 |
||||
unzReadCurrentFile @68 |
||||
unzOpenCurrentFile3 @69 |
||||
unztell @70 |
||||
unzeof @71 |
||||
unzCloseCurrentFile @72 |
||||
unzGetGlobalComment @73 |
||||
unzStringFileNameCompare @74 |
||||
unzLocateFile @75 |
||||
unzGetLocalExtrafield @76 |
||||
unzOpen2 @77 |
||||
unzOpenCurrentFile2 @78 |
||||
unzOpenCurrentFilePassword @79 |
||||
|
||||
zipOpen @80 |
||||
zipOpenNewFileInZip @81 |
||||
zipWriteInFileInZip @82 |
||||
zipCloseFileInZip @83 |
||||
zipClose @84 |
||||
zipOpenNewFileInZip2 @86 |
||||
zipCloseFileInZipRaw @87 |
||||
zipOpen2 @88 |
||||
zipOpenNewFileInZip3 @89 |
||||
|
||||
unzGetFilePos @100 |
||||
unzGoToFilePos @101 |
||||
|
||||
fill_win32_filefunc @110 |
@ -0,0 +1,66 @@ |
||||
Microsoft Visual Studio Solution File, Format Version 7.00 |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" |
||||
EndProject |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}" |
||||
EndProject |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}" |
||||
EndProject |
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfiguration) = preSolution |
||||
ConfigName.0 = Debug |
||||
ConfigName.1 = Release |
||||
ConfigName.2 = ReleaseAxp |
||||
ConfigName.3 = ReleaseWithoutAsm |
||||
ConfigName.4 = ReleaseWithoutCrtdll |
||||
EndGlobalSection |
||||
GlobalSection(ProjectDependencies) = postSolution |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfiguration) = postSolution |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug.ActiveCfg = Debug|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug.Build.0 = Debug|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release.ActiveCfg = Release|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release.Build.0 = Release|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseAxp.ActiveCfg = ReleaseAxp|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseAxp.Build.0 = ReleaseAxp|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm.ActiveCfg = ReleaseWithoutAsm|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm.Build.0 = ReleaseWithoutAsm|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutCrtdll.ActiveCfg = ReleaseAxp|Win32 |
||||
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutCrtdll.Build.0 = ReleaseAxp|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug.ActiveCfg = Debug|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug.Build.0 = Debug|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release.ActiveCfg = Release|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release.Build.0 = Release|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseAxp.ActiveCfg = ReleaseAxp|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseAxp.Build.0 = ReleaseAxp|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm.ActiveCfg = ReleaseWithoutAsm|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm.Build.0 = ReleaseWithoutAsm|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutCrtdll.ActiveCfg = ReleaseWithoutCrtdll|Win32 |
||||
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutCrtdll.Build.0 = ReleaseWithoutCrtdll|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug.ActiveCfg = Debug|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug.Build.0 = Debug|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release.ActiveCfg = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release.Build.0 = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAxp.ActiveCfg = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAxp.Build.0 = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm.ActiveCfg = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm.Build.0 = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutCrtdll.ActiveCfg = Release|Win32 |
||||
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutCrtdll.Build.0 = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug.ActiveCfg = Debug|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug.Build.0 = Debug|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release.ActiveCfg = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release.Build.0 = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseAxp.ActiveCfg = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseAxp.Build.0 = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm.ActiveCfg = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm.Build.0 = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.ActiveCfg = Release|Win32 |
||||
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.Build.0 = Release|Win32 |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityAddIns) = postSolution |
||||
EndGlobalSection |
||||
EndGlobal |
@ -0,0 +1,434 @@ |
||||
<?xml version="1.0" encoding = "Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="7.00" |
||||
Name="zlibvc" |
||||
SccProjectName="" |
||||
SccLocalPath=""> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32"/> |
||||
</Platforms> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory=".\DebugDll" |
||||
IntermediateDirectory=".\DebugDll" |
||||
ConfigurationType="2" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32,ASMV" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="1" |
||||
PrecompiledHeaderFile=".\DebugDll/zlibvc.pch" |
||||
AssemblerListingLocation=".\DebugDll/" |
||||
ObjectFile=".\DebugDll/" |
||||
ProgramDataBaseFileName=".\DebugDll/" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE" |
||||
DebugInformationFormat="4"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalOptions="/MACHINE:I386" |
||||
AdditionalDependencies="gvmat32.obj " |
||||
OutputFile=".\DebugDll\zlib.dll" |
||||
LinkIncremental="2" |
||||
SuppressStartupBanner="TRUE" |
||||
ModuleDefinitionFile=".\zlibvc.def" |
||||
GenerateDebugInformation="TRUE" |
||||
ProgramDatabaseFile=".\DebugDll/zlib.pdb" |
||||
SubSystem="2" |
||||
ImportLibrary=".\DebugDll/zlib.lib"/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
PreprocessorDefinitions="_DEBUG" |
||||
MkTypLibCompatible="TRUE" |
||||
SuppressStartupBanner="TRUE" |
||||
TargetEnvironment="1" |
||||
TypeLibraryName=".\DebugDll/zlibvc.tlb"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
PreprocessorDefinitions="_DEBUG" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="ReleaseWithoutAsm|Win32" |
||||
OutputDirectory=".\zlibDllWithoutAsm" |
||||
IntermediateDirectory=".\zlibDllWithoutAsm" |
||||
ConfigurationType="2" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="0" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibDllWithoutAsm/zlibvc.pch" |
||||
AssemblerOutput="2" |
||||
AssemblerListingLocation=".\zlibDllWithoutAsm/" |
||||
ObjectFile=".\zlibDllWithoutAsm/" |
||||
ProgramDataBaseFileName=".\zlibDllWithoutAsm/" |
||||
BrowseInformation="1" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalOptions="/MACHINE:I386" |
||||
AdditionalDependencies="crtdll.lib" |
||||
OutputFile=".\zlibDllWithoutAsm\zlib.dll" |
||||
LinkIncremental="1" |
||||
SuppressStartupBanner="TRUE" |
||||
IgnoreAllDefaultLibraries="TRUE" |
||||
ModuleDefinitionFile=".\zlibvc.def" |
||||
ProgramDatabaseFile=".\zlibDllWithoutAsm/zlib.pdb" |
||||
GenerateMapFile="TRUE" |
||||
MapFileName=".\zlibDllWithoutAsm/zlib.map" |
||||
SubSystem="2" |
||||
OptimizeForWindows98="1" |
||||
ImportLibrary=".\zlibDllWithoutAsm/zlib.lib"/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
MkTypLibCompatible="TRUE" |
||||
SuppressStartupBanner="TRUE" |
||||
TargetEnvironment="1" |
||||
TypeLibraryName=".\zlibDllWithoutAsm/zlibvc.tlb"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="ReleaseWithoutCrtdll|Win32" |
||||
OutputDirectory=".\zlibDllWithoutCrtDll" |
||||
IntermediateDirectory=".\zlibDllWithoutCrtDll" |
||||
ConfigurationType="2" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32,ASMV" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="0" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibDllWithoutCrtDll/zlibvc.pch" |
||||
AssemblerOutput="2" |
||||
AssemblerListingLocation=".\zlibDllWithoutCrtDll/" |
||||
ObjectFile=".\zlibDllWithoutCrtDll/" |
||||
ProgramDataBaseFileName=".\zlibDllWithoutCrtDll/" |
||||
BrowseInformation="1" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalOptions="/MACHINE:I386" |
||||
AdditionalDependencies="gvmat32.obj inffastAsm.obj " |
||||
OutputFile=".\zlibDllWithoutCrtDll\zlib.dll" |
||||
LinkIncremental="1" |
||||
SuppressStartupBanner="TRUE" |
||||
IgnoreAllDefaultLibraries="FALSE" |
||||
ModuleDefinitionFile=".\zlibvc.def" |
||||
ProgramDatabaseFile=".\zlibDllWithoutCrtDll/zlib.pdb" |
||||
GenerateMapFile="TRUE" |
||||
MapFileName=".\zlibDllWithoutCrtDll/zlib.map" |
||||
SubSystem="2" |
||||
OptimizeForWindows98="1" |
||||
ImportLibrary=".\zlibDllWithoutCrtDll/zlib.lib"/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
MkTypLibCompatible="TRUE" |
||||
SuppressStartupBanner="TRUE" |
||||
TargetEnvironment="1" |
||||
TypeLibraryName=".\zlibDllWithoutCrtDll/zlibvc.tlb"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="ReleaseAxp|Win32" |
||||
OutputDirectory=".\zlibvc__" |
||||
IntermediateDirectory=".\zlibvc__" |
||||
ConfigurationType="2" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="0" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\zlibvc__/zlibvc.pch" |
||||
AssemblerOutput="2" |
||||
AssemblerListingLocation=".\zlibvc__/" |
||||
ObjectFile=".\zlibvc__/" |
||||
ProgramDataBaseFileName=".\zlibvc__/" |
||||
BrowseInformation="1" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalDependencies="crtdll.lib" |
||||
OutputFile="zlibvc__\zlib.dll" |
||||
LinkIncremental="1" |
||||
SuppressStartupBanner="TRUE" |
||||
IgnoreAllDefaultLibraries="TRUE" |
||||
ModuleDefinitionFile=".\zlibvc.def" |
||||
ProgramDatabaseFile=".\zlibvc__/zlib.pdb" |
||||
GenerateMapFile="TRUE" |
||||
MapFileName=".\zlibvc__/zlib.map" |
||||
SubSystem="2" |
||||
ImportLibrary=".\zlibvc__/zlib.lib"/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
MkTypLibCompatible="TRUE" |
||||
SuppressStartupBanner="TRUE" |
||||
TargetEnvironment="1" |
||||
TypeLibraryName=".\zlibvc__/zlibvc.tlb"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory=".\ReleaseDll" |
||||
IntermediateDirectory=".\ReleaseDll" |
||||
ConfigurationType="2" |
||||
UseOfMFC="0" |
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
InlineFunctionExpansion="1" |
||||
PreprocessorDefinitions="WIN32,ASMV" |
||||
StringPooling="TRUE" |
||||
ExceptionHandling="FALSE" |
||||
RuntimeLibrary="0" |
||||
EnableFunctionLevelLinking="TRUE" |
||||
PrecompiledHeaderFile=".\ReleaseDll/zlibvc.pch" |
||||
AssemblerOutput="2" |
||||
AssemblerListingLocation=".\ReleaseDll/" |
||||
ObjectFile=".\ReleaseDll/" |
||||
ProgramDataBaseFileName=".\ReleaseDll/" |
||||
BrowseInformation="1" |
||||
WarningLevel="3" |
||||
SuppressStartupBanner="TRUE"/> |
||||
<Tool |
||||
Name="VCCustomBuildTool"/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
AdditionalOptions="/MACHINE:I386" |
||||
AdditionalDependencies="gvmat32.obj inffastAsm.obj crtdll.lib" |
||||
OutputFile=".\ReleaseDll\zlib.dll" |
||||
LinkIncremental="1" |
||||
SuppressStartupBanner="TRUE" |
||||
IgnoreAllDefaultLibraries="TRUE" |
||||
ModuleDefinitionFile=".\zlibvc.def" |
||||
ProgramDatabaseFile=".\ReleaseDll/zlib.pdb" |
||||
GenerateMapFile="TRUE" |
||||
MapFileName=".\ReleaseDll/zlib.map" |
||||
SubSystem="2" |
||||
OptimizeForWindows98="1" |
||||
ImportLibrary=".\ReleaseDll/zlib.lib"/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
MkTypLibCompatible="TRUE" |
||||
SuppressStartupBanner="TRUE" |
||||
TargetEnvironment="1" |
||||
TypeLibraryName=".\Release/zlibvc.tlb"/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreBuildEventTool"/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool"/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
PreprocessorDefinitions="NDEBUG" |
||||
Culture="1036"/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool"/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool"/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"> |
||||
<File |
||||
RelativePath=".\adler32.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\compress.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\crc32.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\deflate.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\gvmat32c.c"> |
||||
<FileConfiguration |
||||
Name="ReleaseWithoutAsm|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool"/> |
||||
</FileConfiguration> |
||||
</File> |
||||
<File |
||||
RelativePath=".\gzio.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\infback.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inffast.c"> |
||||
<FileConfiguration |
||||
Name="ReleaseWithoutCrtdll|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool"/> |
||||
</FileConfiguration> |
||||
<FileConfiguration |
||||
Name="Release|Win32" |
||||
ExcludedFromBuild="TRUE"> |
||||
<Tool |
||||
Name="VCCLCompilerTool"/> |
||||
</FileConfiguration> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inflate.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inftrees.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\ioapi.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\iowin32.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\trees.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\uncompr.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\unzip.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zip.c"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zlib.rc"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zlibvc.def"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zutil.c"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;fi;fd"> |
||||
<File |
||||
RelativePath=".\deflate.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\infblock.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\infcodes.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inffast.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\inftrees.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\infutil.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zconf.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zlib.h"> |
||||
</File> |
||||
<File |
||||
RelativePath=".\zutil.h"> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"> |
||||
</Filter> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,109 @@ |
||||
# Makefile for zlib
|
||||
# Borland C++
|
||||
# Updated for zlib-1.2.x by Cosmin Truta, 15-Mar-2003.
|
||||
|
||||
# To use, do "make -fmakefile.bor"
|
||||
# To compile in small model, set below: MODEL=s
|
||||
|
||||
# WARNING: the small model is supported but only for small values of
|
||||
# MAX_WBITS and MAX_MEM_LEVEL. For example:
|
||||
# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
# If you wish to reduce the memory requirements (default 256K for big
|
||||
# objects plus a few K), you can add to the LOC macro below:
|
||||
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
||||
# See zconf.h for details about the memory requirements.
|
||||
|
||||
# ------------ Turbo C++, Borland C++ ------------
|
||||
|
||||
# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
|
||||
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
|
||||
# to the declaration of LOC here:
|
||||
LOC = $(LOCAL_ZLIB)
|
||||
|
||||
# type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
|
||||
CPU_TYP = 0
|
||||
|
||||
# memory model: one of s, m, c, l (small, medium, compact, large)
|
||||
MODEL=l
|
||||
|
||||
# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
|
||||
CC=bcc
|
||||
LD=bcc
|
||||
AR=tlib
|
||||
|
||||
# compiler flags
|
||||
# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
|
||||
CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
|
||||
|
||||
LDFLAGS=-m$(MODEL) -f-
|
||||
|
||||
|
||||
# variables
|
||||
ZLIB_LIB = zlib_$(MODEL).lib
|
||||
|
||||
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj
|
||||
OBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
||||
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj
|
||||
OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
|
||||
|
||||
|
||||
# targets
|
||||
all: $(ZLIB_LIB) example.exe minigzip.exe |
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
adler32.obj: adler32.c zlib.h zconf.h |
||||
|
||||
compress.obj: compress.c zlib.h zconf.h |
||||
|
||||
crc32.obj: crc32.c zlib.h zconf.h crc32.h |
||||
|
||||
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
|
||||
gzio.obj: gzio.c zutil.h zlib.h zconf.h |
||||
|
||||
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
||||
inffast.h inffixed.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 |
||||
|
||||
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
||||
|
||||
uncompr.obj: uncompr.c zlib.h zconf.h |
||||
|
||||
zutil.obj: zutil.c zutil.h zlib.h zconf.h |
||||
|
||||
example.obj: example.c zlib.h zconf.h |
||||
|
||||
minigzip.obj: minigzip.c zlib.h zconf.h |
||||
|
||||
|
||||
# the command line is cut to fit in the MS-DOS 128 byte limit:
|
||||
$(ZLIB_LIB): $(OBJ1) $(OBJ2) |
||||
-del $(ZLIB_LIB)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP1)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP2)
|
||||
|
||||
example.exe: example.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
|
||||
|
||||
minigzip.exe: minigzip.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
|
||||
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
clean: |
||||
-del *.obj
|
||||
-del *.exe
|
||||
-del *.lib
|
||||
-del zlib_$(MODEL).bak
|
||||
-del foo.gz
|
@ -0,0 +1,94 @@ |
||||
# Makefile for zlib
|
||||
# Turbo C 2.01, Turbo C++ 1.01
|
||||
# Updated for zlib-1.2.x by Cosmin Truta, 15-Mar-2003.
|
||||
|
||||
# To use, do "make -fmakefile.tc"
|
||||
# To compile in small model, set below: MODEL=s
|
||||
|
||||
# WARNING: the small model is supported but only for small values of
|
||||
# MAX_WBITS and MAX_MEM_LEVEL. For example:
|
||||
# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
# If you wish to reduce the memory requirements (default 256K for big
|
||||
# objects plus a few K), you can add to CFLAGS below:
|
||||
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
||||
# See zconf.h for details about the memory requirements.
|
||||
|
||||
# ------------ Turbo C 2.01, Turbo C++ 1.01 ------------
|
||||
MODEL=l
|
||||
CC=tcc
|
||||
LD=tcc
|
||||
AR=tlib
|
||||
# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
CFLAGS=-O2 -G -Z -m$(MODEL)
|
||||
LDFLAGS=-m$(MODEL) -f-
|
||||
|
||||
|
||||
# variables
|
||||
ZLIB_LIB = zlib_$(MODEL).lib
|
||||
|
||||
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj
|
||||
OBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
||||
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj
|
||||
OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
|
||||
|
||||
|
||||
# targets
|
||||
all: $(ZLIB_LIB) example.exe minigzip.exe |
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
adler32.obj: adler32.c zlib.h zconf.h |
||||
|
||||
compress.obj: compress.c zlib.h zconf.h |
||||
|
||||
crc32.obj: crc32.c zlib.h zconf.h crc32.h |
||||
|
||||
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
|
||||
gzio.obj: gzio.c zutil.h zlib.h zconf.h |
||||
|
||||
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
||||
inffast.h inffixed.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 |
||||
|
||||
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
||||
|
||||
uncompr.obj: uncompr.c zlib.h zconf.h |
||||
|
||||
zutil.obj: zutil.c zutil.h zlib.h zconf.h |
||||
|
||||
example.obj: example.c zlib.h zconf.h |
||||
|
||||
minigzip.obj: minigzip.c zlib.h zconf.h |
||||
|
||||
|
||||
# the command line is cut to fit in the MS-DOS 128 byte limit:
|
||||
$(ZLIB_LIB): $(OBJ1) $(OBJ2) |
||||
-del $(ZLIB_LIB)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP1)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP2)
|
||||
|
||||
example.exe: example.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
|
||||
|
||||
minigzip.exe: minigzip.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
|
||||
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
clean: |
||||
-del *.obj
|
||||
-del *.exe
|
||||
-del *.lib
|
||||
-del zlib_$(MODEL).bak
|
||||
-del foo.gz
|
@ -1,125 +0,0 @@ |
||||
# Makefile for zlib
|
||||
# Borland C++ ************ UNTESTED ***********
|
||||
|
||||
# To use, do "make -fmakefile.bor"
|
||||
# To compile in small model, set below: MODEL=s
|
||||
|
||||
# WARNING: the small model is supported but only for small values of
|
||||
# MAX_WBITS and MAX_MEM_LEVEL. For example:
|
||||
# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
# If you wish to reduce the memory requirements (default 256K for big
|
||||
# objects plus a few K), you can add to the LOC macro below:
|
||||
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
||||
# See zconf.h for details about the memory requirements.
|
||||
|
||||
# ------------- Turbo C++, Borland C++ -------------
|
||||
|
||||
# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
|
||||
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
|
||||
# to the declaration of LOC here:
|
||||
LOC = $(LOCAL_ZLIB)
|
||||
|
||||
# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
|
||||
CPU_TYP = 0
|
||||
|
||||
# Memory model: one of s, m, c, l (small, medium, compact, large)
|
||||
MODEL=l
|
||||
|
||||
CC=bcc
|
||||
# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
|
||||
LD=$(CC)
|
||||
AR=tlib
|
||||
|
||||
# compiler flags
|
||||
CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
|
||||
# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
|
||||
|
||||
LDFLAGS=-m$(MODEL)
|
||||
|
||||
O=.obj
|
||||
|
||||
# variables
|
||||
OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
|
||||
trees$(O)
|
||||
OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
|
||||
trees$(O)
|
||||
OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
|
||||
infutil$(O) inffast$(O)
|
||||
OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
|
||||
infutil$(O)+inffast$(O)
|
||||
|
||||
ZLIB_H = zlib.h zconf.h
|
||||
ZUTIL_H = zutil.h $(ZLIB_H)
|
||||
|
||||
ZLIB_LIB = zlib_$(MODEL).lib
|
||||
|
||||
all: test |
||||
|
||||
# individual dependencies and action rules:
|
||||
adler32.obj: adler32.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
compress.obj: compress.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
crc32.obj: crc32.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
deflate.obj: deflate.c deflate.h $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
gzio.obj: gzio.c $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inflate.obj: inflate.c $(ZUTIL_H) infblock.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
trees.obj: trees.c deflate.h $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
uncompr.obj: uncompr.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
zutil.obj: zutil.c $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
example.obj: example.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
minigzip.obj: minigzip.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
# we must cut the command line to fit in the MS/DOS 128 byte limit:
|
||||
$(ZLIB_LIB): $(OBJ1) $(OBJ2) |
||||
del $(ZLIB_LIB)
|
||||
$(AR) $(ZLIB_LIB) +$(OBJP1)
|
||||
$(AR) $(ZLIB_LIB) +$(OBJP2)
|
||||
|
||||
example.exe: example.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
|
||||
|
||||
minigzip.exe: minigzip.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
|
||||
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
#clean:
|
||||
# del *.obj
|
||||
# del *.exe
|
@ -1,108 +0,0 @@ |
||||
# Makefile for zlib
|
||||
# TurboC 2.0
|
||||
|
||||
# To use, do "make -fmakefile.tc"
|
||||
# To compile in small model, set below: MODEL=-ms
|
||||
|
||||
# WARNING: the small model is supported but only for small values of
|
||||
# MAX_WBITS and MAX_MEM_LEVEL. For example:
|
||||
# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
# If you wish to reduce the memory requirements (default 256K for big
|
||||
# objects plus a few K), you can add to CFLAGS below:
|
||||
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
||||
# See zconf.h for details about the memory requirements.
|
||||
|
||||
# ------------- Turbo C 2.0 -------------
|
||||
MODEL=l
|
||||
# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
|
||||
CFLAGS=-O2 -G -Z -m$(MODEL)
|
||||
CC=tcc -I\tc\include
|
||||
LD=tcc -L\tc\lib
|
||||
AR=tlib
|
||||
LDFLAGS=-m$(MODEL) -f-
|
||||
O=.obj
|
||||
|
||||
# variables
|
||||
OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
|
||||
trees$(O)
|
||||
OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
|
||||
trees$(O)
|
||||
OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
|
||||
infutil$(O) inffast$(O)
|
||||
OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
|
||||
infutil$(O)+inffast$(O)
|
||||
|
||||
ZLIB_H = zlib.h zconf.h
|
||||
ZUTIL_H = zutil.h $(ZLIB_H)
|
||||
|
||||
ZLIB_LIB = zlib_$(MODEL).lib
|
||||
|
||||
all: test |
||||
|
||||
adler32.obj: adler32.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
compress.obj: compress.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
crc32.obj: crc32.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
deflate.obj: deflate.c deflate.h $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
gzio.obj: gzio.c $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inflate.obj: inflate.c $(ZUTIL_H) infblock.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
trees.obj: trees.c deflate.h $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
uncompr.obj: uncompr.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
zutil.obj: zutil.c $(ZUTIL_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
example.obj: example.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
minigzip.obj: minigzip.c $(ZLIB_H) |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
# we must cut the command line to fit in the MS/DOS 128 byte limit:
|
||||
$(ZLIB_LIB): $(OBJ1) $(OBJ2) |
||||
del $(ZLIB_LIB)
|
||||
$(AR) $(ZLIB_LIB) +$(OBJP1)
|
||||
$(AR) $(ZLIB_LIB) +$(OBJP2)
|
||||
|
||||
example.exe: example.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) -eexample.exe example.obj $(ZLIB_LIB)
|
||||
|
||||
minigzip.exe: minigzip.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) -eminigzip.exe minigzip.obj $(ZLIB_LIB)
|
||||
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
#clean:
|
||||
# del *.obj
|
||||
# del *.exe
|
@ -0,0 +1,76 @@ |
||||
# Makefile for zlib.dll -- Microsoft (Visual) C. |
||||
# Author: Cosmin Truta, 11-Mar-2003. |
||||
# |
||||
# Usage: nmake -f win32/Makefile-dll.msc |
||||
|
||||
CC = cl |
||||
LD = cl |
||||
CFLAGS = -nologo -MD -O2 |
||||
LDFLAGS = -nologo |
||||
|
||||
OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \ |
||||
inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj |
||||
|
||||
# targets |
||||
all: zlib.dll zlib.lib example.exe minigzip.exe |
||||
|
||||
zlib.lib: $(OBJS) |
||||
lib -out:$@ $(OBJS) |
||||
|
||||
zlib.dll: $(OBJS) win32/zlib.def |
||||
link -release -def:win32/zlib.def -dll -out:$@ $(OBJS) |
||||
|
||||
zlib.lib: zlib.dll |
||||
|
||||
example.exe: example.obj zlib.lib |
||||
$(LD) $(LDFLAGS) example.obj zlib.lib |
||||
|
||||
minigzip.exe: minigzip.obj zlib.lib |
||||
$(LD) $(LDFLAGS) minigzip.obj zlib.lib |
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $*.c |
||||
|
||||
adler32.obj: adler32.c zlib.h zconf.h |
||||
|
||||
compress.obj: compress.c zlib.h zconf.h |
||||
|
||||
crc32.obj: crc32.c zlib.h zconf.h crc32.h |
||||
|
||||
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
|
||||
gzio.obj: gzio.c zutil.h zlib.h zconf.h |
||||
|
||||
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
||||
inffast.h inffixed.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 |
||||
|
||||
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
||||
|
||||
uncompr.obj: uncompr.c zlib.h zconf.h |
||||
|
||||
zutil.obj: zutil.c zutil.h zlib.h zconf.h |
||||
|
||||
example.obj: example.c zlib.h zconf.h |
||||
|
||||
minigzip.obj: minigzip.c zlib.h zconf.h |
||||
|
||||
# testing |
||||
test: example.exe minigzip.exe |
||||
example |
||||
echo hello world | minigzip | minigzip -d |
||||
|
||||
# cleanup |
||||
clean: |
||||
del *.obj |
||||
del *.dll |
||||
del *.lib |
||||
del *.exp |
||||
del *.exe |
@ -0,0 +1,91 @@ |
||||
# Makefile for zlib
|
||||
# Borland C++ for Win32
|
||||
# Updated for zlib-1.2.x by Cosmin Truta, 11-Mar-2003.
|
||||
|
||||
# Usage: "make -f win32/makefile.bor"
|
||||
|
||||
# ------------ Borland C++ for Win32 ------------
|
||||
|
||||
# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
|
||||
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
|
||||
# to the declaration of LOC here:
|
||||
LOC = $(LOCAL_ZLIB)
|
||||
|
||||
CC = bcc32
|
||||
LD = bcc32
|
||||
AR = tlib
|
||||
CFLAGS = -O2 -d -k- $(LOC)
|
||||
LDFLAGS = $(LOC)
|
||||
|
||||
|
||||
# variables
|
||||
ZLIB_LIB = zlib.lib
|
||||
|
||||
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj
|
||||
OBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
||||
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj
|
||||
OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
|
||||
|
||||
|
||||
# targets
|
||||
all: $(ZLIB_LIB) example.exe minigzip.exe |
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
adler32.obj: adler32.c zlib.h zconf.h |
||||
|
||||
compress.obj: compress.c zlib.h zconf.h |
||||
|
||||
crc32.obj: crc32.c zlib.h zconf.h crc32.h |
||||
|
||||
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
|
||||
gzio.obj: gzio.c zutil.h zlib.h zconf.h |
||||
|
||||
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
||||
inffast.h inffixed.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 |
||||
|
||||
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
||||
|
||||
uncompr.obj: uncompr.c zlib.h zconf.h |
||||
|
||||
zutil.obj: zutil.c zutil.h zlib.h zconf.h |
||||
|
||||
example.obj: example.c zlib.h zconf.h |
||||
|
||||
minigzip.obj: minigzip.c zlib.h zconf.h |
||||
|
||||
|
||||
# For the sake of the old Borland make,
|
||||
# the command line is cut to fit in the MS-DOS 128 byte limit:
|
||||
$(ZLIB_LIB): $(OBJ1) $(OBJ2) |
||||
-del $(ZLIB_LIB)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP1)
|
||||
$(AR) $(ZLIB_LIB) $(OBJP2)
|
||||
|
||||
example.exe: example.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
|
||||
|
||||
minigzip.exe: minigzip.obj $(ZLIB_LIB) |
||||
$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
|
||||
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
clean: |
||||
-del *.obj
|
||||
-del *.exe
|
||||
-del *.lib
|
||||
-del *.tds
|
||||
-del zlib.bak
|
||||
-del foo.gz
|
@ -0,0 +1,105 @@ |
||||
# Makefile for zlib, derived from Makefile.dj2.
|
||||
# Modified for mingw32 by C. Spieler, 6/16/98.
|
||||
# Updated for zlib-1.2.x by Cosmin Truta, 11-Mar-2003.
|
||||
# Tested under Cygwin and MinGW.
|
||||
|
||||
# Copyright (C) 1995-1998 Jean-loup Gailly.
|
||||
# For conditions of distribution and use, see copyright notice in zlib.h
|
||||
|
||||
# To compile, or to compile and test, type:
|
||||
#
|
||||
# make -fmakefile.gcc; make test -fmakefile.gcc
|
||||
#
|
||||
# To install libz.a, zconf.h and zlib.h in the system directories, type:
|
||||
#
|
||||
# make install -fmakefile.gcc
|
||||
#
|
||||
|
||||
LIB = libz.a
|
||||
SHAREDLIB = libz.so
|
||||
VER = 1.2.0
|
||||
|
||||
CC = gcc
|
||||
#CFLAGS = -DDEBUG -MMD -g
|
||||
CFLAGS = $(LOC) -O3 -Wall
|
||||
|
||||
AS = $(CC)
|
||||
ASFLAGS = $(LOC) -Wall
|
||||
|
||||
LD = $(CC)
|
||||
LDFLAGS = $(LOC) -s
|
||||
|
||||
AR = ar
|
||||
ARFLAGS = rcs
|
||||
|
||||
CP = cp -fp
|
||||
# If GNU install is available, replace $(CP) with install.
|
||||
INSTALL = $(CP)
|
||||
RM = rm -f
|
||||
|
||||
prefix = /usr/local
|
||||
exec_prefix = $(prefix)
|
||||
|
||||
OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \
|
||||
inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
|
||||
|
||||
# to use the asm code: make OBJA=match.o
|
||||
OBJA =
|
||||
|
||||
TEST_OBJS = example.o minigzip.o
|
||||
|
||||
all: $(LIB) example minigzip |
||||
|
||||
test: all |
||||
./example
|
||||
echo hello world | ./minigzip | ./minigzip -d
|
||||
|
||||
.c.o: |
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
libz.a: $(OBJS) |
||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||
|
||||
example: example.o $(LIB) |
||||
$(LD) -o $@ $< $(LIB)
|
||||
|
||||
minigzip: minigzip.o $(LIB) |
||||
$(LD) -o $@ $< $(LIB)
|
||||
|
||||
|
||||
# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
|
||||
|
||||
.PHONY : uninstall clean |
||||
|
||||
install: zlib.h zconf.h $(LIB) |
||||
-@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
|
||||
-@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
|
||||
$(INSTALL) zlib.h $(INCLUDE_PATH)
|
||||
$(INSTALL) zconf.h $(INCLUDE_PATH)
|
||||
$(INSTALL) $(LIB) $(LIBRARY_PATH)
|
||||
|
||||
uninstall: |
||||
$(RM) $(INCLUDE_PATH)/zlib.h
|
||||
$(RM) $(INCLUDE_PATH)/zconf.h
|
||||
$(RM) $(LIBRARY_PATH)/libz.a
|
||||
|
||||
clean: |
||||
$(RM) *.o
|
||||
$(RM) *.exe
|
||||
$(RM) libz.a
|
||||
$(RM) foo.gz
|
||||
|
||||
adler32.o: zlib.h zconf.h |
||||
compress.o: zlib.h zconf.h |
||||
crc32.o: crc32.h zlib.h zconf.h |
||||
deflate.o: deflate.h zutil.h zlib.h zconf.h |
||||
example.o: zlib.h zconf.h |
||||
gzio.o: zutil.h zlib.h zconf.h |
||||
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
||||
inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
||||
minigzip.o: zlib.h zconf.h |
||||
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h |
||||
uncompr.o: zlib.h zconf.h |
||||
zutil.o: zutil.h zlib.h zconf.h |
@ -0,0 +1,69 @@ |
||||
# Makefile for (static) zlib -- Microsoft (Visual) C.
|
||||
# Author: Cosmin Truta, 11-Mar-2003.
|
||||
#
|
||||
# Usage: nmake -f win32/Makefile.msc
|
||||
|
||||
CC = cl
|
||||
LD = cl
|
||||
CFLAGS = -nologo -MD -O2
|
||||
LDFLAGS = -nologo
|
||||
|
||||
OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \
|
||||
inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
||||
|
||||
# targets
|
||||
all: zlib.lib example.exe minigzip.exe |
||||
|
||||
zlib.lib: $(OBJS) |
||||
lib -out:$@ $(OBJS)
|
||||
|
||||
example.exe: example.obj zlib.lib |
||||
$(LD) $(LDFLAGS) example.obj zlib.lib
|
||||
|
||||
minigzip.exe: minigzip.obj zlib.lib |
||||
$(LD) $(LDFLAGS) minigzip.obj zlib.lib
|
||||
|
||||
.c.obj: |
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
adler32.obj: adler32.c zlib.h zconf.h |
||||
|
||||
compress.obj: compress.c zlib.h zconf.h |
||||
|
||||
crc32.obj: crc32.c zlib.h zconf.h crc32.h |
||||
|
||||
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
||||
|
||||
gzio.obj: gzio.c zutil.h zlib.h zconf.h |
||||
|
||||
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
||||
inffast.h inffixed.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 |
||||
|
||||
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
||||
|
||||
uncompr.obj: uncompr.c zlib.h zconf.h |
||||
|
||||
zutil.obj: zutil.c zutil.h zlib.h zconf.h |
||||
|
||||
example.obj: example.c zlib.h zconf.h |
||||
|
||||
minigzip.obj: minigzip.c zlib.h zconf.h |
||||
|
||||
# testing
|
||||
test: example.exe minigzip.exe |
||||
example
|
||||
echo hello world | minigzip | minigzip -d
|
||||
|
||||
# cleanup
|
||||
clean: |
||||
del *.obj
|
||||
del *.lib
|
||||
del *.exe
|
Loading…
Reference in new issue