summaryrefslogtreecommitdiff
path: root/contrib/delphi
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:29 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:29 -0700
commit14763ac7c6c03bca62c39e35c03cf5bfc7728802 (patch)
treef1055d11ef7b282b698ce7c40e1a9c061413cbdf /contrib/delphi
parentc34c1fcbb19852ca35216ad66276f4f86af3fc22 (diff)
downloadzlib-1.1.3.tar.gz
zlib-1.1.3.tar.bz2
zlib-1.1.3.zip
zlib 1.1.3v1.1.3
Diffstat (limited to 'contrib/delphi')
-rw-r--r--contrib/delphi/zlib.mak36
-rw-r--r--contrib/delphi/zlibdef.pas169
2 files changed, 205 insertions, 0 deletions
diff --git a/contrib/delphi/zlib.mak b/contrib/delphi/zlib.mak
new file mode 100644
index 0000000..ba557e2
--- /dev/null
+++ b/contrib/delphi/zlib.mak
@@ -0,0 +1,36 @@
1# Makefile for zlib32bd.lib
2# ------------- Borland C++ 4.5 -------------
3
4# The (32-bit) zlib32bd.lib made with this makefile is intended for use
5# in making the (32-bit) DLL, png32bd.dll. It uses the "stdcall" calling
6# convention.
7
8CFLAGS= -ps -O2 -C -K -N- -k- -d -3 -r- -w-par -w-aus -WDE
9CC=f:\bc45\bin\bcc32
10LIBFLAGS= /C
11LIB=f:\bc45\bin\tlib
12ZLIB=zlib32bd.lib
13
14.autodepend
15.c.obj:
16 $(CC) -c $(CFLAGS) $<
17
18OBJ1=adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj
19OBJ2=infcodes.obj inflate.obj inftrees.obj infutil.obj inffast.obj
20OBJ3=trees.obj uncompr.obj zutil.obj
21pOBJ1=+adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infblock.obj
22pOBJ2=+infcodes.obj+inflate.obj+inftrees.obj+infutil.obj+inffast.obj
23pOBJ3=+trees.obj+uncompr.obj+zutil.obj
24
25all: $(ZLIB)
26
27$(ZLIB): $(OBJ1) $(OBJ2) $(OBJ3)
28 @if exist $@ del $@
29 $(LIB) @&&|
30$@ $(LIBFLAGS) &
31$(pOBJ1) &
32$(pOBJ2) &
33$(pOBJ3)
34|
35
36# End of makefile for zlib32bd.lib
diff --git a/contrib/delphi/zlibdef.pas b/contrib/delphi/zlibdef.pas
new file mode 100644
index 0000000..4f96b7d
--- /dev/null
+++ b/contrib/delphi/zlibdef.pas
@@ -0,0 +1,169 @@
1unit zlibdef;
2
3interface
4
5uses
6 Windows;
7
8const
9 ZLIB_VERSION = '1.1.3';
10
11type
12 voidpf = Pointer;
13 int = Integer;
14 uInt = Cardinal;
15 pBytef = PChar;
16 uLong = Cardinal;
17
18 alloc_func = function(opaque: voidpf; items, size: uInt): voidpf;
19 stdcall;
20 free_func = procedure(opaque, address: voidpf);
21 stdcall;
22
23 internal_state = Pointer;
24
25 z_streamp = ^z_stream;
26 z_stream = packed record
27 next_in: pBytef; // next input byte
28 avail_in: uInt; // number of bytes available at next_in
29 total_in: uLong; // total nb of input bytes read so far
30
31 next_out: pBytef; // next output byte should be put there
32 avail_out: uInt; // remaining free space at next_out
33 total_out: uLong; // total nb of bytes output so far
34
35 msg: PChar; // last error message, NULL if no error
36 state: internal_state; // not visible by applications
37
38 zalloc: alloc_func; // used to allocate the internal state
39 zfree: free_func; // used to free the internal state
40 opaque: voidpf; // private data object passed to zalloc and zfree
41
42 data_type: int; // best guess about the data type: ascii or binary
43 adler: uLong; // adler32 value of the uncompressed data
44 reserved: uLong; // reserved for future use
45 end;
46
47const
48 Z_NO_FLUSH = 0;
49 Z_SYNC_FLUSH = 2;
50 Z_FULL_FLUSH = 3;
51 Z_FINISH = 4;
52
53 Z_OK = 0;
54 Z_STREAM_END = 1;
55
56 Z_NO_COMPRESSION = 0;
57 Z_BEST_SPEED = 1;
58 Z_BEST_COMPRESSION = 9;
59 Z_DEFAULT_COMPRESSION = -1;
60
61 Z_FILTERED = 1;
62 Z_HUFFMAN_ONLY = 2;
63 Z_DEFAULT_STRATEGY = 0;
64
65 Z_BINARY = 0;
66 Z_ASCII = 1;
67 Z_UNKNOWN = 2;
68
69 Z_DEFLATED = 8;
70
71 MAX_MEM_LEVEL = 9;
72
73function adler32(adler: uLong; const buf: pBytef; len: uInt): uLong;
74 stdcall;
75function crc32(crc: uLong; const buf: pBytef; len: uInt): uLong;
76 stdcall;
77function deflate(strm: z_streamp; flush: int): int;
78 stdcall;
79function deflateCopy(dest, source: z_streamp): int;
80 stdcall;
81function deflateEnd(strm: z_streamp): int;
82 stdcall;
83function deflateInit2_(strm: z_streamp; level, method,
84 windowBits, memLevel, strategy: int;
85 const version: PChar; stream_size: int): int;
86 stdcall;
87function deflateInit_(strm: z_streamp; level: int;
88 const version: PChar; stream_size: int): int;
89 stdcall;
90function deflateParams(strm: z_streamp; level, strategy: int): int;
91 stdcall;
92function deflateReset(strm: z_streamp): int;
93 stdcall;
94function deflateSetDictionary(strm: z_streamp;
95 const dictionary: pBytef;
96 dictLength: uInt): int;
97 stdcall;
98function inflate(strm: z_streamp; flush: int): int;
99 stdcall;
100function inflateEnd(strm: z_streamp): int;
101 stdcall;
102function inflateInit2_(strm: z_streamp; windowBits: int;
103 const version: PChar; stream_size: int): int;
104 stdcall;
105function inflateInit_(strm: z_streamp; const version: PChar;
106 stream_size: int): int;
107 stdcall;
108function inflateReset(strm: z_streamp): int;
109 stdcall;
110function inflateSetDictionary(strm: z_streamp;
111 const dictionary: pBytef;
112 dictLength: uInt): int;
113 stdcall;
114function inflateSync(strm: z_streamp): int;
115 stdcall;
116
117function deflateInit(strm: z_streamp; level: int): int;
118function deflateInit2(strm: z_streamp; level, method, windowBits,
119 memLevel, strategy: int): int;
120function inflateInit(strm: z_streamp): int;
121function inflateInit2(strm: z_streamp; windowBits: int): int;
122
123implementation
124
125function deflateInit(strm: z_streamp; level: int): int;
126begin
127 Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
128end;
129
130function deflateInit2(strm: z_streamp; level, method, windowBits,
131 memLevel, strategy: int): int;
132begin
133 Result := deflateInit2_(strm, level, method, windowBits, memLevel,
134 strategy, ZLIB_VERSION, sizeof(z_stream));
135end;
136
137function inflateInit(strm: z_streamp): int;
138begin
139 Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
140end;
141
142function inflateInit2(strm: z_streamp; windowBits: int): int;
143begin
144 Result := inflateInit2_(strm, windowBits, ZLIB_VERSION,
145 sizeof(z_stream));
146end;
147
148const
149 zlibDLL = 'png32bd.dll';
150
151function adler32; external zlibDLL;
152function crc32; external zlibDLL;
153function deflate; external zlibDLL;
154function deflateCopy; external zlibDLL;
155function deflateEnd; external zlibDLL;
156function deflateInit2_; external zlibDLL;
157function deflateInit_; external zlibDLL;
158function deflateParams; external zlibDLL;
159function deflateReset; external zlibDLL;
160function deflateSetDictionary; external zlibDLL;
161function inflate; external zlibDLL;
162function inflateEnd; external zlibDLL;
163function inflateInit2_; external zlibDLL;
164function inflateInit_; external zlibDLL;
165function inflateReset; external zlibDLL;
166function inflateSetDictionary; external zlibDLL;
167function inflateSync; external zlibDLL;
168
169end.