source: trunk/third/zlib/contrib/delphi/zlibdef.pas @ 15211

Revision 15211, 5.3 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15210, which included commits to RCS files with non-trunk default branches.
Line 
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.
Note: See TracBrowser for help on using the repository browser.