comparison zlib/contrib/pascal/zlibpas.pas @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents ae3a4bfb450b
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
8 unit zlibpas; 8 unit zlibpas;
9 9
10 interface 10 interface
11 11
12 const 12 const
13 ZLIB_VERSION = '1.2.3'; 13 ZLIB_VERSION = '1.2.11';
14 ZLIB_VERNUM = $12a0;
14 15
15 type 16 type
16 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; 17 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
17 cdecl; 18 cdecl;
18 free_func = procedure(opaque, address: Pointer); 19 free_func = procedure(opaque, address: Pointer);
41 opaque: Pointer; (* private data object passed to zalloc and zfree *) 42 opaque: Pointer; (* private data object passed to zalloc and zfree *)
42 43
43 data_type: Integer; (* best guess about the data type: ascii or binary *) 44 data_type: Integer; (* best guess about the data type: ascii or binary *)
44 adler: LongInt; (* adler32 value of the uncompressed data *) 45 adler: LongInt; (* adler32 value of the uncompressed data *)
45 reserved: LongInt; (* reserved for future use *) 46 reserved: LongInt; (* reserved for future use *)
47 end;
48
49 gz_headerp = ^gz_header;
50 gz_header = packed record
51 text: Integer; (* true if compressed data believed to be text *)
52 time: LongInt; (* modification time *)
53 xflags: Integer; (* extra flags (not used when writing a gzip file) *)
54 os: Integer; (* operating system *)
55 extra: PChar; (* pointer to extra field or Z_NULL if none *)
56 extra_len: Integer; (* extra field length (valid if extra != Z_NULL) *)
57 extra_max: Integer; (* space at extra (only when reading header) *)
58 name: PChar; (* pointer to zero-terminated file name or Z_NULL *)
59 name_max: Integer; (* space at name (only when reading header) *)
60 comment: PChar; (* pointer to zero-terminated comment or Z_NULL *)
61 comm_max: Integer; (* space at comment (only when reading header) *)
62 hcrc: Integer; (* true if there was or will be a header crc *)
63 done: Integer; (* true when done reading gzip header *)
46 end; 64 end;
47 65
48 (* constants *) 66 (* constants *)
49 const 67 const
50 Z_NO_FLUSH = 0; 68 Z_NO_FLUSH = 0;
51 Z_PARTIAL_FLUSH = 1; 69 Z_PARTIAL_FLUSH = 1;
52 Z_SYNC_FLUSH = 2; 70 Z_SYNC_FLUSH = 2;
53 Z_FULL_FLUSH = 3; 71 Z_FULL_FLUSH = 3;
54 Z_FINISH = 4; 72 Z_FINISH = 4;
73 Z_BLOCK = 5;
74 Z_TREES = 6;
55 75
56 Z_OK = 0; 76 Z_OK = 0;
57 Z_STREAM_END = 1; 77 Z_STREAM_END = 1;
58 Z_NEED_DICT = 2; 78 Z_NEED_DICT = 2;
59 Z_ERRNO = -1; 79 Z_ERRNO = -1;
69 Z_DEFAULT_COMPRESSION = -1; 89 Z_DEFAULT_COMPRESSION = -1;
70 90
71 Z_FILTERED = 1; 91 Z_FILTERED = 1;
72 Z_HUFFMAN_ONLY = 2; 92 Z_HUFFMAN_ONLY = 2;
73 Z_RLE = 3; 93 Z_RLE = 3;
94 Z_FIXED = 4;
74 Z_DEFAULT_STRATEGY = 0; 95 Z_DEFAULT_STRATEGY = 0;
75 96
76 Z_BINARY = 0; 97 Z_BINARY = 0;
98 Z_TEXT = 1;
77 Z_ASCII = 1; 99 Z_ASCII = 1;
78 Z_UNKNOWN = 2; 100 Z_UNKNOWN = 2;
79 101
80 Z_DEFLATED = 8; 102 Z_DEFLATED = 8;
81 103
94 function deflateSetDictionary(var strm: z_stream; const dictionary: PChar; 116 function deflateSetDictionary(var strm: z_stream; const dictionary: PChar;
95 dictLength: Integer): Integer; 117 dictLength: Integer): Integer;
96 function deflateCopy(var dest, source: z_stream): Integer; 118 function deflateCopy(var dest, source: z_stream): Integer;
97 function deflateReset(var strm: z_stream): Integer; 119 function deflateReset(var strm: z_stream): Integer;
98 function deflateParams(var strm: z_stream; level, strategy: Integer): Integer; 120 function deflateParams(var strm: z_stream; level, strategy: Integer): Integer;
121 function deflateTune(var strm: z_stream; good_length, max_lazy, nice_length, max_chain: Integer): Integer;
99 function deflateBound(var strm: z_stream; sourceLen: LongInt): LongInt; 122 function deflateBound(var strm: z_stream; sourceLen: LongInt): LongInt;
123 function deflatePending(var strm: z_stream; var pending: Integer; var bits: Integer): Integer;
100 function deflatePrime(var strm: z_stream; bits, value: Integer): Integer; 124 function deflatePrime(var strm: z_stream; bits, value: Integer): Integer;
125 function deflateSetHeader(var strm: z_stream; head: gz_header): Integer;
101 function inflateInit2(var strm: z_stream; windowBits: Integer): Integer; 126 function inflateInit2(var strm: z_stream; windowBits: Integer): Integer;
102 function inflateSetDictionary(var strm: z_stream; const dictionary: PChar; 127 function inflateSetDictionary(var strm: z_stream; const dictionary: PChar;
103 dictLength: Integer): Integer; 128 dictLength: Integer): Integer;
104 function inflateSync(var strm: z_stream): Integer; 129 function inflateSync(var strm: z_stream): Integer;
105 function inflateCopy(var dest, source: z_stream): Integer; 130 function inflateCopy(var dest, source: z_stream): Integer;
106 function inflateReset(var strm: z_stream): Integer; 131 function inflateReset(var strm: z_stream): Integer;
132 function inflateReset2(var strm: z_stream; windowBits: Integer): Integer;
133 function inflatePrime(var strm: z_stream; bits, value: Integer): Integer;
134 function inflateMark(var strm: z_stream): LongInt;
135 function inflateGetHeader(var strm: z_stream; var head: gz_header): Integer;
107 function inflateBackInit(var strm: z_stream; 136 function inflateBackInit(var strm: z_stream;
108 windowBits: Integer; window: PChar): Integer; 137 windowBits: Integer; window: PChar): Integer;
109 function inflateBack(var strm: z_stream; in_fn: in_func; in_desc: Pointer; 138 function inflateBack(var strm: z_stream; in_fn: in_func; in_desc: Pointer;
110 out_fn: out_func; out_desc: Pointer): Integer; 139 out_fn: out_func; out_desc: Pointer): Integer;
111 function inflateBackEnd(var strm: z_stream): Integer; 140 function inflateBackEnd(var strm: z_stream): Integer;
121 function uncompress(dest: PChar; var destLen: LongInt; 150 function uncompress(dest: PChar; var destLen: LongInt;
122 const source: PChar; sourceLen: LongInt): Integer; 151 const source: PChar; sourceLen: LongInt): Integer;
123 152
124 (* checksum functions *) 153 (* checksum functions *)
125 function adler32(adler: LongInt; const buf: PChar; len: Integer): LongInt; 154 function adler32(adler: LongInt; const buf: PChar; len: Integer): LongInt;
155 function adler32_combine(adler1, adler2, len2: LongInt): LongInt;
126 function crc32(crc: LongInt; const buf: PChar; len: Integer): LongInt; 156 function crc32(crc: LongInt; const buf: PChar; len: Integer): LongInt;
157 function crc32_combine(crc1, crc2, len2: LongInt): LongInt;
127 158
128 (* various hacks, don't look :) *) 159 (* various hacks, don't look :) *)
129 function deflateInit_(var strm: z_stream; level: Integer; 160 function deflateInit_(var strm: z_stream; level: Integer;
130 const version: PChar; stream_size: Integer): Integer; 161 const version: PChar; stream_size: Integer): Integer;
131 function inflateInit_(var strm: z_stream; const version: PChar; 162 function inflateInit_(var strm: z_stream; const version: PChar;
153 {$L trees.obj} 184 {$L trees.obj}
154 {$L uncompr.obj} 185 {$L uncompr.obj}
155 {$L zutil.obj} 186 {$L zutil.obj}
156 187
157 function adler32; external; 188 function adler32; external;
189 function adler32_combine; external;
158 function compress; external; 190 function compress; external;
159 function compress2; external; 191 function compress2; external;
160 function compressBound; external; 192 function compressBound; external;
161 function crc32; external; 193 function crc32; external;
194 function crc32_combine; external;
162 function deflate; external; 195 function deflate; external;
163 function deflateBound; external; 196 function deflateBound; external;
164 function deflateCopy; external; 197 function deflateCopy; external;
165 function deflateEnd; external; 198 function deflateEnd; external;
166 function deflateInit_; external; 199 function deflateInit_; external;
167 function deflateInit2_; external; 200 function deflateInit2_; external;
168 function deflateParams; external; 201 function deflateParams; external;
202 function deflatePending; external;
169 function deflatePrime; external; 203 function deflatePrime; external;
170 function deflateReset; external; 204 function deflateReset; external;
171 function deflateSetDictionary; external; 205 function deflateSetDictionary; external;
206 function deflateSetHeader; external;
207 function deflateTune; external;
172 function inflate; external; 208 function inflate; external;
173 function inflateBack; external; 209 function inflateBack; external;
174 function inflateBackEnd; external; 210 function inflateBackEnd; external;
175 function inflateBackInit_; external; 211 function inflateBackInit_; external;
176 function inflateCopy; external; 212 function inflateCopy; external;
177 function inflateEnd; external; 213 function inflateEnd; external;
214 function inflateGetHeader; external;
178 function inflateInit_; external; 215 function inflateInit_; external;
179 function inflateInit2_; external; 216 function inflateInit2_; external;
217 function inflateMark; external;
218 function inflatePrime; external;
180 function inflateReset; external; 219 function inflateReset; external;
220 function inflateReset2; external;
181 function inflateSetDictionary; external; 221 function inflateSetDictionary; external;
182 function inflateSync; external; 222 function inflateSync; external;
183 function uncompress; external; 223 function uncompress; external;
184 function zlibCompileFlags; external; 224 function zlibCompileFlags; external;
185 function zlibVersion; external; 225 function zlibVersion; external;