Skip to content

Commit 2645466

Browse files
Adding the new zlib tree for Windows
1 parent 2222dd9 commit 2645466

101 files changed

Lines changed: 22527 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BitKeeper/etc/logging_ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ [email protected]
4949
5050
5151
52+

zlib/ChangeLog

Lines changed: 481 additions & 0 deletions
Large diffs are not rendered by default.

zlib/Make_vms.com

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
$! make libz under VMS
2+
$! written by Martin P.J. Zinser <[email protected]>
3+
$!
4+
$! Look for the compiler used
5+
$!
6+
$ ccopt = ""
7+
$ if f$getsyi("HW_MODEL").ge.1024
8+
$ then
9+
$ ccopt = "/prefix=all"+ccopt
10+
$ comp = "__decc__=1"
11+
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
12+
$ else
13+
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
14+
$ then
15+
$ comp = "__vaxc__=1"
16+
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
17+
$ else
18+
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
19+
$ ccopt = "/decc/prefix=all"+ccopt
20+
$ comp = "__decc__=1"
21+
$ endif
22+
$ endif
23+
$!
24+
$! Build the thing plain or with mms
25+
$!
26+
$ write sys$output "Compiling Zlib sources ..."
27+
$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
28+
$ then
29+
$ dele example.obj;*,minigzip.obj;*
30+
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
31+
adler32.c zlib.h zconf.h
32+
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
33+
compress.c zlib.h zconf.h
34+
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
35+
crc32.c zlib.h zconf.h
36+
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
37+
deflate.c deflate.h zutil.h zlib.h zconf.h
38+
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
39+
gzio.c zutil.h zlib.h zconf.h
40+
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
41+
infblock.c zutil.h zlib.h zconf.h infblock.h
42+
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
43+
infcodes.c zutil.h zlib.h zconf.h inftrees.h
44+
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
45+
inffast.c zutil.h zlib.h zconf.h inffast.h
46+
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
47+
inflate.c zutil.h zlib.h zconf.h infblock.h
48+
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
49+
inftrees.c zutil.h zlib.h zconf.h inftrees.h
50+
$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" -
51+
infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
52+
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
53+
trees.c deflate.h zutil.h zlib.h zconf.h
54+
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
55+
uncompr.c zlib.h zconf.h
56+
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
57+
zutil.c zutil.h zlib.h zconf.h
58+
$ write sys$output "Building Zlib ..."
59+
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
60+
$ write sys$output "Building example..."
61+
$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
62+
example.c zlib.h zconf.h
63+
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
64+
$ write sys$output "Building minigzip..."
65+
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
66+
minigzip.c zlib.h zconf.h
67+
$ call make minigzip.exe -
68+
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
69+
minigzip.obj libz.olb
70+
$ else
71+
$ mms/macro=('comp')
72+
$ endif
73+
$ write sys$output "Zlib build completed"
74+
$ exit
75+
$!
76+
$!
77+
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
78+
$ V = 'F$Verify(0)
79+
$! P1 = What we are trying to make
80+
$! P2 = Command to make it
81+
$! P3 - P8 What it depends on
82+
$
83+
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
84+
$ Time = F$CvTime(F$File(P1,"RDT"))
85+
$arg=3
86+
$Loop:
87+
$ Argument = P'arg
88+
$ If Argument .Eqs. "" Then Goto Exit
89+
$ El=0
90+
$Loop2:
91+
$ File = F$Element(El," ",Argument)
92+
$ If File .Eqs. " " Then Goto Endl
93+
$ AFile = ""
94+
$Loop3:
95+
$ OFile = AFile
96+
$ AFile = F$Search(File)
97+
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
98+
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
99+
$ Goto Loop3
100+
$NextEL:
101+
$ El = El + 1
102+
$ Goto Loop2
103+
$EndL:
104+
$ arg=arg+1
105+
$ If arg .Le. 8 Then Goto Loop
106+
$ Goto Exit
107+
$
108+
$Makeit:
109+
$ VV=F$VERIFY(0)
110+
$ write sys$output P2
111+
$ 'P2
112+
$ VV='F$Verify(VV)
113+
$Exit:
114+
$ If V Then Set Verify
115+
$ENDSUBROUTINE

zlib/Makefile.riscos

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Project: zlib_1_03
2+
# Patched for zlib 1.1.2 [email protected] 19980430
3+
# test works out-of-the-box, installs `somewhere' on demand
4+
5+
# Toolflags:
6+
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
7+
C++flags = -c -depend !Depend -IC: -throwback
8+
Linkflags = -aif -c++ -o $@
9+
ObjAsmflags = -throwback -NoCache -depend !Depend
10+
CMHGflags =
11+
LibFileflags = -c -l -o $@
12+
Squeezeflags = -o $@
13+
14+
# change the line below to where _you_ want the library installed.
15+
libdest = lib:zlib
16+
17+
# Final targets:
18+
@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
19+
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
20+
@.o.uncompr @.o.zutil
21+
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
22+
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
23+
@.o.trees @.o.uncompr @.o.zutil
24+
test: @.minigzip @.example @.lib
25+
@copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
26+
@echo running tests: hang on.
27+
@/@.minigzip -f -9 libc
28+
@/@.minigzip -d libc-gz
29+
@/@.minigzip -f -1 libc
30+
@/@.minigzip -d libc-gz
31+
@/@.minigzip -h -9 libc
32+
@/@.minigzip -d libc-gz
33+
@/@.minigzip -h -1 libc
34+
@/@.minigzip -d libc-gz
35+
@/@.minigzip -9 libc
36+
@/@.minigzip -d libc-gz
37+
@/@.minigzip -1 libc
38+
@/@.minigzip -d libc-gz
39+
@diff @.lib @.libc
40+
@echo that should have reported '@.lib and @.libc identical' if you have diff.
41+
@/@.example @.fred @.fred
42+
@echo that will have given lots of hello!'s.
43+
44+
@.minigzip: @.o.minigzip @.lib C:o.Stubs
45+
Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
46+
@.example: @.o.example @.lib C:o.Stubs
47+
Link $(Linkflags) @.o.example @.lib C:o.Stubs
48+
49+
install: @.lib
50+
cdir $(libdest)
51+
cdir $(libdest).h
52+
@copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
53+
@copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
54+
@copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
55+
@echo okay, installed zlib in $(libdest)
56+
57+
clean:; remove @.minigzip
58+
remove @.example
59+
remove @.libc
60+
-wipe @.o.* F~r~cV
61+
remove @.fred
62+
63+
# User-editable dependencies:
64+
.c.o:
65+
cc $(ccflags) -o $@ $<
66+
67+
# Static dependencies:
68+
69+
# Dynamic dependencies:
70+
o.example: c.example
71+
o.example: h.zlib
72+
o.example: h.zconf
73+
o.minigzip: c.minigzip
74+
o.minigzip: h.zlib
75+
o.minigzip: h.zconf
76+
o.adler32: c.adler32
77+
o.adler32: h.zlib
78+
o.adler32: h.zconf
79+
o.compress: c.compress
80+
o.compress: h.zlib
81+
o.compress: h.zconf
82+
o.crc32: c.crc32
83+
o.crc32: h.zlib
84+
o.crc32: h.zconf
85+
o.deflate: c.deflate
86+
o.deflate: h.deflate
87+
o.deflate: h.zutil
88+
o.deflate: h.zlib
89+
o.deflate: h.zconf
90+
o.gzio: c.gzio
91+
o.gzio: h.zutil
92+
o.gzio: h.zlib
93+
o.gzio: h.zconf
94+
o.infblock: c.infblock
95+
o.infblock: h.zutil
96+
o.infblock: h.zlib
97+
o.infblock: h.zconf
98+
o.infblock: h.infblock
99+
o.infblock: h.inftrees
100+
o.infblock: h.infcodes
101+
o.infblock: h.infutil
102+
o.infcodes: c.infcodes
103+
o.infcodes: h.zutil
104+
o.infcodes: h.zlib
105+
o.infcodes: h.zconf
106+
o.infcodes: h.inftrees
107+
o.infcodes: h.infblock
108+
o.infcodes: h.infcodes
109+
o.infcodes: h.infutil
110+
o.infcodes: h.inffast
111+
o.inffast: c.inffast
112+
o.inffast: h.zutil
113+
o.inffast: h.zlib
114+
o.inffast: h.zconf
115+
o.inffast: h.inftrees
116+
o.inffast: h.infblock
117+
o.inffast: h.infcodes
118+
o.inffast: h.infutil
119+
o.inffast: h.inffast
120+
o.inflate: c.inflate
121+
o.inflate: h.zutil
122+
o.inflate: h.zlib
123+
o.inflate: h.zconf
124+
o.inflate: h.infblock
125+
o.inftrees: c.inftrees
126+
o.inftrees: h.zutil
127+
o.inftrees: h.zlib
128+
o.inftrees: h.zconf
129+
o.inftrees: h.inftrees
130+
o.inftrees: h.inffixed
131+
o.infutil: c.infutil
132+
o.infutil: h.zutil
133+
o.infutil: h.zlib
134+
o.infutil: h.zconf
135+
o.infutil: h.infblock
136+
o.infutil: h.inftrees
137+
o.infutil: h.infcodes
138+
o.infutil: h.infutil
139+
o.trees: c.trees
140+
o.trees: h.deflate
141+
o.trees: h.zutil
142+
o.trees: h.zlib
143+
o.trees: h.zconf
144+
o.trees: h.trees
145+
o.uncompr: c.uncompr
146+
o.uncompr: h.zlib
147+
o.uncompr: h.zconf
148+
o.zutil: c.zutil
149+
o.zutil: h.zutil
150+
o.zutil: h.zlib
151+
o.zutil: h.zconf

zlib/adler32.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* adler32.c -- compute the Adler-32 checksum of a data stream
2+
* Copyright (C) 1995-2002 Mark Adler
3+
* For conditions of distribution and use, see copyright notice in zlib.h
4+
*/
5+
6+
/* @(#) $Id$ */
7+
8+
#include "zlib.h"
9+
10+
#define BASE 65521L /* largest prime smaller than 65536 */
11+
#define NMAX 5552
12+
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
13+
14+
#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
15+
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
16+
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
17+
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
18+
#define DO16(buf) DO8(buf,0); DO8(buf,8);
19+
20+
/* ========================================================================= */
21+
uLong ZEXPORT adler32(adler, buf, len)
22+
uLong adler;
23+
const Bytef *buf;
24+
uInt len;
25+
{
26+
unsigned long s1 = adler & 0xffff;
27+
unsigned long s2 = (adler >> 16) & 0xffff;
28+
int k;
29+
30+
if (buf == Z_NULL) return 1L;
31+
32+
while (len > 0) {
33+
k = len < NMAX ? len : NMAX;
34+
len -= k;
35+
while (k >= 16) {
36+
DO16(buf);
37+
buf += 16;
38+
k -= 16;
39+
}
40+
if (k != 0) do {
41+
s1 += *buf++;
42+
s2 += s1;
43+
} while (--k);
44+
s1 %= BASE;
45+
s2 %= BASE;
46+
}
47+
return (s2 << 16) | s1;
48+
}

0 commit comments

Comments
 (0)