1275793eaSopenharmony_ci----------------------------------------------------------------
2275793eaSopenharmony_ci--  ZLib for Ada thick binding.                               --
3275793eaSopenharmony_ci--                                                            --
4275793eaSopenharmony_ci--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
5275793eaSopenharmony_ci--                                                            --
6275793eaSopenharmony_ci--  Open source license information is in the zlib.ads file.  --
7275793eaSopenharmony_ci----------------------------------------------------------------
8275793eaSopenharmony_ci
9275793eaSopenharmony_ci--  $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $
10275793eaSopenharmony_ci
11275793eaSopenharmony_ciwith Interfaces.C.Strings;
12275793eaSopenharmony_ci
13275793eaSopenharmony_ciwith System;
14275793eaSopenharmony_ci
15275793eaSopenharmony_ciprivate package ZLib.Thin is
16275793eaSopenharmony_ci
17275793eaSopenharmony_ci   --  From zconf.h
18275793eaSopenharmony_ci
19275793eaSopenharmony_ci   MAX_MEM_LEVEL : constant := 9;         --  zconf.h:105
20275793eaSopenharmony_ci                                          --  zconf.h:105
21275793eaSopenharmony_ci   MAX_WBITS : constant := 15;      --  zconf.h:115
22275793eaSopenharmony_ci                                    --  32K LZ77 window
23275793eaSopenharmony_ci                                    --  zconf.h:115
24275793eaSopenharmony_ci   SEEK_SET : constant := 8#0000#;  --  zconf.h:244
25275793eaSopenharmony_ci                                    --  Seek from beginning of file.
26275793eaSopenharmony_ci                                    --  zconf.h:244
27275793eaSopenharmony_ci   SEEK_CUR : constant := 1;        --  zconf.h:245
28275793eaSopenharmony_ci                                    --  Seek from current position.
29275793eaSopenharmony_ci                                    --  zconf.h:245
30275793eaSopenharmony_ci   SEEK_END : constant := 2;        --  zconf.h:246
31275793eaSopenharmony_ci                                    --  Set file pointer to EOF plus "offset"
32275793eaSopenharmony_ci                                    --  zconf.h:246
33275793eaSopenharmony_ci
34275793eaSopenharmony_ci   type Byte is new Interfaces.C.unsigned_char; --  8 bits
35275793eaSopenharmony_ci                                                --  zconf.h:214
36275793eaSopenharmony_ci   type UInt is new Interfaces.C.unsigned;      --  16 bits or more
37275793eaSopenharmony_ci                                                --  zconf.h:216
38275793eaSopenharmony_ci   type Int is new Interfaces.C.int;
39275793eaSopenharmony_ci
40275793eaSopenharmony_ci   type ULong is new Interfaces.C.unsigned_long;     --  32 bits or more
41275793eaSopenharmony_ci                                                     --  zconf.h:217
42275793eaSopenharmony_ci   subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;
43275793eaSopenharmony_ci
44275793eaSopenharmony_ci   type ULong_Access is access ULong;
45275793eaSopenharmony_ci   type Int_Access is access Int;
46275793eaSopenharmony_ci
47275793eaSopenharmony_ci   subtype Voidp is System.Address;            --  zconf.h:232
48275793eaSopenharmony_ci
49275793eaSopenharmony_ci   subtype Byte_Access is Voidp;
50275793eaSopenharmony_ci
51275793eaSopenharmony_ci   Nul : constant Voidp := System.Null_Address;
52275793eaSopenharmony_ci   --  end from zconf
53275793eaSopenharmony_ci
54275793eaSopenharmony_ci   Z_NO_FLUSH : constant := 8#0000#;   --  zlib.h:125
55275793eaSopenharmony_ci                                       --  zlib.h:125
56275793eaSopenharmony_ci   Z_PARTIAL_FLUSH : constant := 1;       --  zlib.h:126
57275793eaSopenharmony_ci                                          --  will be removed, use
58275793eaSopenharmony_ci                                          --  Z_SYNC_FLUSH instead
59275793eaSopenharmony_ci                                          --  zlib.h:126
60275793eaSopenharmony_ci   Z_SYNC_FLUSH : constant := 2;       --  zlib.h:127
61275793eaSopenharmony_ci                                       --  zlib.h:127
62275793eaSopenharmony_ci   Z_FULL_FLUSH : constant := 3;       --  zlib.h:128
63275793eaSopenharmony_ci                                       --  zlib.h:128
64275793eaSopenharmony_ci   Z_FINISH : constant := 4;        --  zlib.h:129
65275793eaSopenharmony_ci                                    --  zlib.h:129
66275793eaSopenharmony_ci   Z_OK : constant := 8#0000#;   --  zlib.h:132
67275793eaSopenharmony_ci                                 --  zlib.h:132
68275793eaSopenharmony_ci   Z_STREAM_END : constant := 1;       --  zlib.h:133
69275793eaSopenharmony_ci                                       --  zlib.h:133
70275793eaSopenharmony_ci   Z_NEED_DICT : constant := 2;        --  zlib.h:134
71275793eaSopenharmony_ci                                       --  zlib.h:134
72275793eaSopenharmony_ci   Z_ERRNO : constant := -1;        --  zlib.h:135
73275793eaSopenharmony_ci                                    --  zlib.h:135
74275793eaSopenharmony_ci   Z_STREAM_ERROR : constant := -2;       --  zlib.h:136
75275793eaSopenharmony_ci                                          --  zlib.h:136
76275793eaSopenharmony_ci   Z_DATA_ERROR : constant := -3;      --  zlib.h:137
77275793eaSopenharmony_ci                                       --  zlib.h:137
78275793eaSopenharmony_ci   Z_MEM_ERROR : constant := -4;       --  zlib.h:138
79275793eaSopenharmony_ci                                       --  zlib.h:138
80275793eaSopenharmony_ci   Z_BUF_ERROR : constant := -5;       --  zlib.h:139
81275793eaSopenharmony_ci                                       --  zlib.h:139
82275793eaSopenharmony_ci   Z_VERSION_ERROR : constant := -6;      --  zlib.h:140
83275793eaSopenharmony_ci                                          --  zlib.h:140
84275793eaSopenharmony_ci   Z_NO_COMPRESSION : constant := 8#0000#;   --  zlib.h:145
85275793eaSopenharmony_ci                                             --  zlib.h:145
86275793eaSopenharmony_ci   Z_BEST_SPEED : constant := 1;       --  zlib.h:146
87275793eaSopenharmony_ci                                       --  zlib.h:146
88275793eaSopenharmony_ci   Z_BEST_COMPRESSION : constant := 9;       --  zlib.h:147
89275793eaSopenharmony_ci                                             --  zlib.h:147
90275793eaSopenharmony_ci   Z_DEFAULT_COMPRESSION : constant := -1;      --  zlib.h:148
91275793eaSopenharmony_ci                                                --  zlib.h:148
92275793eaSopenharmony_ci   Z_FILTERED : constant := 1;      --  zlib.h:151
93275793eaSopenharmony_ci                                    --  zlib.h:151
94275793eaSopenharmony_ci   Z_HUFFMAN_ONLY : constant := 2;        --  zlib.h:152
95275793eaSopenharmony_ci                                          --  zlib.h:152
96275793eaSopenharmony_ci   Z_DEFAULT_STRATEGY : constant := 8#0000#; --  zlib.h:153
97275793eaSopenharmony_ci                                             --  zlib.h:153
98275793eaSopenharmony_ci   Z_BINARY : constant := 8#0000#;  --  zlib.h:156
99275793eaSopenharmony_ci                                    --  zlib.h:156
100275793eaSopenharmony_ci   Z_ASCII : constant := 1;      --  zlib.h:157
101275793eaSopenharmony_ci                                 --  zlib.h:157
102275793eaSopenharmony_ci   Z_UNKNOWN : constant := 2;       --  zlib.h:158
103275793eaSopenharmony_ci                                    --  zlib.h:158
104275793eaSopenharmony_ci   Z_DEFLATED : constant := 8;      --  zlib.h:161
105275793eaSopenharmony_ci                                    --  zlib.h:161
106275793eaSopenharmony_ci   Z_NULL : constant := 8#0000#; --  zlib.h:164
107275793eaSopenharmony_ci                                 --  for initializing zalloc, zfree, opaque
108275793eaSopenharmony_ci                                 --  zlib.h:164
109275793eaSopenharmony_ci   type gzFile is new Voidp;                  --  zlib.h:646
110275793eaSopenharmony_ci
111275793eaSopenharmony_ci   type Z_Stream is private;
112275793eaSopenharmony_ci
113275793eaSopenharmony_ci   type Z_Streamp is access all Z_Stream;     --  zlib.h:89
114275793eaSopenharmony_ci
115275793eaSopenharmony_ci   type alloc_func is access function
116275793eaSopenharmony_ci     (Opaque : Voidp;
117275793eaSopenharmony_ci      Items  : UInt;
118275793eaSopenharmony_ci      Size   : UInt)
119275793eaSopenharmony_ci      return Voidp; --  zlib.h:63
120275793eaSopenharmony_ci
121275793eaSopenharmony_ci   type free_func is access procedure (opaque : Voidp; address : Voidp);
122275793eaSopenharmony_ci
123275793eaSopenharmony_ci   function zlibVersion return Chars_Ptr;
124275793eaSopenharmony_ci
125275793eaSopenharmony_ci   function Deflate (strm : Z_Streamp; flush : Int) return Int;
126275793eaSopenharmony_ci
127275793eaSopenharmony_ci   function DeflateEnd (strm : Z_Streamp) return Int;
128275793eaSopenharmony_ci
129275793eaSopenharmony_ci   function Inflate (strm : Z_Streamp; flush : Int) return Int;
130275793eaSopenharmony_ci
131275793eaSopenharmony_ci   function InflateEnd (strm : Z_Streamp) return Int;
132275793eaSopenharmony_ci
133275793eaSopenharmony_ci   function deflateSetDictionary
134275793eaSopenharmony_ci     (strm       : Z_Streamp;
135275793eaSopenharmony_ci      dictionary : Byte_Access;
136275793eaSopenharmony_ci      dictLength : UInt)
137275793eaSopenharmony_ci      return       Int;
138275793eaSopenharmony_ci
139275793eaSopenharmony_ci   function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int;
140275793eaSopenharmony_ci   --  zlib.h:478
141275793eaSopenharmony_ci
142275793eaSopenharmony_ci   function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495
143275793eaSopenharmony_ci
144275793eaSopenharmony_ci   function deflateParams
145275793eaSopenharmony_ci     (strm     : Z_Streamp;
146275793eaSopenharmony_ci      level    : Int;
147275793eaSopenharmony_ci      strategy : Int)
148275793eaSopenharmony_ci      return     Int;       -- zlib.h:506
149275793eaSopenharmony_ci
150275793eaSopenharmony_ci   function inflateSetDictionary
151275793eaSopenharmony_ci     (strm       : Z_Streamp;
152275793eaSopenharmony_ci      dictionary : Byte_Access;
153275793eaSopenharmony_ci      dictLength : UInt)
154275793eaSopenharmony_ci      return       Int; --  zlib.h:548
155275793eaSopenharmony_ci
156275793eaSopenharmony_ci   function inflateSync (strm : Z_Streamp) return Int;  --  zlib.h:565
157275793eaSopenharmony_ci
158275793eaSopenharmony_ci   function inflateReset (strm : Z_Streamp) return Int; --  zlib.h:580
159275793eaSopenharmony_ci
160275793eaSopenharmony_ci   function compress
161275793eaSopenharmony_ci     (dest      : Byte_Access;
162275793eaSopenharmony_ci      destLen   : ULong_Access;
163275793eaSopenharmony_ci      source    : Byte_Access;
164275793eaSopenharmony_ci      sourceLen : ULong)
165275793eaSopenharmony_ci      return      Int;           -- zlib.h:601
166275793eaSopenharmony_ci
167275793eaSopenharmony_ci   function compress2
168275793eaSopenharmony_ci     (dest      : Byte_Access;
169275793eaSopenharmony_ci      destLen   : ULong_Access;
170275793eaSopenharmony_ci      source    : Byte_Access;
171275793eaSopenharmony_ci      sourceLen : ULong;
172275793eaSopenharmony_ci      level     : Int)
173275793eaSopenharmony_ci      return      Int;          -- zlib.h:615
174275793eaSopenharmony_ci
175275793eaSopenharmony_ci   function uncompress
176275793eaSopenharmony_ci     (dest      : Byte_Access;
177275793eaSopenharmony_ci      destLen   : ULong_Access;
178275793eaSopenharmony_ci      source    : Byte_Access;
179275793eaSopenharmony_ci      sourceLen : ULong)
180275793eaSopenharmony_ci      return      Int;
181275793eaSopenharmony_ci
182275793eaSopenharmony_ci   function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile;
183275793eaSopenharmony_ci
184275793eaSopenharmony_ci   function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile;
185275793eaSopenharmony_ci
186275793eaSopenharmony_ci   function gzsetparams
187275793eaSopenharmony_ci     (file     : gzFile;
188275793eaSopenharmony_ci      level    : Int;
189275793eaSopenharmony_ci      strategy : Int)
190275793eaSopenharmony_ci      return     Int;
191275793eaSopenharmony_ci
192275793eaSopenharmony_ci   function gzread
193275793eaSopenharmony_ci     (file : gzFile;
194275793eaSopenharmony_ci      buf  : Voidp;
195275793eaSopenharmony_ci      len  : UInt)
196275793eaSopenharmony_ci      return Int;
197275793eaSopenharmony_ci
198275793eaSopenharmony_ci   function gzwrite
199275793eaSopenharmony_ci     (file : in gzFile;
200275793eaSopenharmony_ci      buf  : in Voidp;
201275793eaSopenharmony_ci      len  : in UInt)
202275793eaSopenharmony_ci      return Int;
203275793eaSopenharmony_ci
204275793eaSopenharmony_ci   function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int;
205275793eaSopenharmony_ci
206275793eaSopenharmony_ci   function gzputs (file : in gzFile; s : in Chars_Ptr) return Int;
207275793eaSopenharmony_ci
208275793eaSopenharmony_ci   function gzgets
209275793eaSopenharmony_ci     (file : gzFile;
210275793eaSopenharmony_ci      buf  : Chars_Ptr;
211275793eaSopenharmony_ci      len  : Int)
212275793eaSopenharmony_ci      return Chars_Ptr;
213275793eaSopenharmony_ci
214275793eaSopenharmony_ci   function gzputc (file : gzFile; char : Int) return Int;
215275793eaSopenharmony_ci
216275793eaSopenharmony_ci   function gzgetc (file : gzFile) return Int;
217275793eaSopenharmony_ci
218275793eaSopenharmony_ci   function gzflush (file : gzFile; flush : Int) return Int;
219275793eaSopenharmony_ci
220275793eaSopenharmony_ci   function gzseek
221275793eaSopenharmony_ci     (file   : gzFile;
222275793eaSopenharmony_ci      offset : Int;
223275793eaSopenharmony_ci      whence : Int)
224275793eaSopenharmony_ci      return   Int;
225275793eaSopenharmony_ci
226275793eaSopenharmony_ci   function gzrewind (file : gzFile) return Int;
227275793eaSopenharmony_ci
228275793eaSopenharmony_ci   function gztell (file : gzFile) return Int;
229275793eaSopenharmony_ci
230275793eaSopenharmony_ci   function gzeof (file : gzFile) return Int;
231275793eaSopenharmony_ci
232275793eaSopenharmony_ci   function gzclose (file : gzFile) return Int;
233275793eaSopenharmony_ci
234275793eaSopenharmony_ci   function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr;
235275793eaSopenharmony_ci
236275793eaSopenharmony_ci   function adler32
237275793eaSopenharmony_ci     (adler : ULong;
238275793eaSopenharmony_ci      buf   : Byte_Access;
239275793eaSopenharmony_ci      len   : UInt)
240275793eaSopenharmony_ci      return  ULong;
241275793eaSopenharmony_ci
242275793eaSopenharmony_ci   function crc32
243275793eaSopenharmony_ci     (crc  : ULong;
244275793eaSopenharmony_ci      buf  : Byte_Access;
245275793eaSopenharmony_ci      len  : UInt)
246275793eaSopenharmony_ci      return ULong;
247275793eaSopenharmony_ci
248275793eaSopenharmony_ci   function deflateInit
249275793eaSopenharmony_ci     (strm        : Z_Streamp;
250275793eaSopenharmony_ci      level       : Int;
251275793eaSopenharmony_ci      version     : Chars_Ptr;
252275793eaSopenharmony_ci      stream_size : Int)
253275793eaSopenharmony_ci      return        Int;
254275793eaSopenharmony_ci
255275793eaSopenharmony_ci   function deflateInit2
256275793eaSopenharmony_ci     (strm        : Z_Streamp;
257275793eaSopenharmony_ci      level       : Int;
258275793eaSopenharmony_ci      method      : Int;
259275793eaSopenharmony_ci      windowBits  : Int;
260275793eaSopenharmony_ci      memLevel    : Int;
261275793eaSopenharmony_ci      strategy    : Int;
262275793eaSopenharmony_ci      version     : Chars_Ptr;
263275793eaSopenharmony_ci      stream_size : Int)
264275793eaSopenharmony_ci      return        Int;
265275793eaSopenharmony_ci
266275793eaSopenharmony_ci   function Deflate_Init
267275793eaSopenharmony_ci     (strm       : Z_Streamp;
268275793eaSopenharmony_ci      level      : Int;
269275793eaSopenharmony_ci      method     : Int;
270275793eaSopenharmony_ci      windowBits : Int;
271275793eaSopenharmony_ci      memLevel   : Int;
272275793eaSopenharmony_ci      strategy   : Int)
273275793eaSopenharmony_ci      return       Int;
274275793eaSopenharmony_ci   pragma Inline (Deflate_Init);
275275793eaSopenharmony_ci
276275793eaSopenharmony_ci   function inflateInit
277275793eaSopenharmony_ci     (strm        : Z_Streamp;
278275793eaSopenharmony_ci      version     : Chars_Ptr;
279275793eaSopenharmony_ci      stream_size : Int)
280275793eaSopenharmony_ci      return        Int;
281275793eaSopenharmony_ci
282275793eaSopenharmony_ci   function inflateInit2
283275793eaSopenharmony_ci     (strm        : in Z_Streamp;
284275793eaSopenharmony_ci      windowBits  : in Int;
285275793eaSopenharmony_ci      version     : in Chars_Ptr;
286275793eaSopenharmony_ci      stream_size : in Int)
287275793eaSopenharmony_ci      return      Int;
288275793eaSopenharmony_ci
289275793eaSopenharmony_ci   function inflateBackInit
290275793eaSopenharmony_ci     (strm        : in Z_Streamp;
291275793eaSopenharmony_ci      windowBits  : in Int;
292275793eaSopenharmony_ci      window      : in Byte_Access;
293275793eaSopenharmony_ci      version     : in Chars_Ptr;
294275793eaSopenharmony_ci      stream_size : in Int)
295275793eaSopenharmony_ci      return      Int;
296275793eaSopenharmony_ci   --  Size of window have to be 2**windowBits.
297275793eaSopenharmony_ci
298275793eaSopenharmony_ci   function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int;
299275793eaSopenharmony_ci   pragma Inline (Inflate_Init);
300275793eaSopenharmony_ci
301275793eaSopenharmony_ci   function zError (err : Int) return Chars_Ptr;
302275793eaSopenharmony_ci
303275793eaSopenharmony_ci   function inflateSyncPoint (z : Z_Streamp) return Int;
304275793eaSopenharmony_ci
305275793eaSopenharmony_ci   function get_crc_table return ULong_Access;
306275793eaSopenharmony_ci
307275793eaSopenharmony_ci   --  Interface to the available fields of the z_stream structure.
308275793eaSopenharmony_ci   --  The application must update next_in and avail_in when avail_in has
309275793eaSopenharmony_ci   --  dropped to zero. It must update next_out and avail_out when avail_out
310275793eaSopenharmony_ci   --  has dropped to zero. The application must initialize zalloc, zfree and
311275793eaSopenharmony_ci   --  opaque before calling the init function.
312275793eaSopenharmony_ci
313275793eaSopenharmony_ci   procedure Set_In
314275793eaSopenharmony_ci     (Strm   : in out Z_Stream;
315275793eaSopenharmony_ci      Buffer : in Voidp;
316275793eaSopenharmony_ci      Size   : in UInt);
317275793eaSopenharmony_ci   pragma Inline (Set_In);
318275793eaSopenharmony_ci
319275793eaSopenharmony_ci   procedure Set_Out
320275793eaSopenharmony_ci     (Strm   : in out Z_Stream;
321275793eaSopenharmony_ci      Buffer : in Voidp;
322275793eaSopenharmony_ci      Size   : in UInt);
323275793eaSopenharmony_ci   pragma Inline (Set_Out);
324275793eaSopenharmony_ci
325275793eaSopenharmony_ci   procedure Set_Mem_Func
326275793eaSopenharmony_ci     (Strm   : in out Z_Stream;
327275793eaSopenharmony_ci      Opaque : in Voidp;
328275793eaSopenharmony_ci      Alloc  : in alloc_func;
329275793eaSopenharmony_ci      Free   : in free_func);
330275793eaSopenharmony_ci   pragma Inline (Set_Mem_Func);
331275793eaSopenharmony_ci
332275793eaSopenharmony_ci   function Last_Error_Message (Strm : in Z_Stream) return String;
333275793eaSopenharmony_ci   pragma Inline (Last_Error_Message);
334275793eaSopenharmony_ci
335275793eaSopenharmony_ci   function Avail_Out (Strm : in Z_Stream) return UInt;
336275793eaSopenharmony_ci   pragma Inline (Avail_Out);
337275793eaSopenharmony_ci
338275793eaSopenharmony_ci   function Avail_In (Strm : in Z_Stream) return UInt;
339275793eaSopenharmony_ci   pragma Inline (Avail_In);
340275793eaSopenharmony_ci
341275793eaSopenharmony_ci   function Total_In (Strm : in Z_Stream) return ULong;
342275793eaSopenharmony_ci   pragma Inline (Total_In);
343275793eaSopenharmony_ci
344275793eaSopenharmony_ci   function Total_Out (Strm : in Z_Stream) return ULong;
345275793eaSopenharmony_ci   pragma Inline (Total_Out);
346275793eaSopenharmony_ci
347275793eaSopenharmony_ci   function inflateCopy
348275793eaSopenharmony_ci     (dest   : in Z_Streamp;
349275793eaSopenharmony_ci      Source : in Z_Streamp)
350275793eaSopenharmony_ci      return Int;
351275793eaSopenharmony_ci
352275793eaSopenharmony_ci   function compressBound (Source_Len : in ULong) return ULong;
353275793eaSopenharmony_ci
354275793eaSopenharmony_ci   function deflateBound
355275793eaSopenharmony_ci     (Strm       : in Z_Streamp;
356275793eaSopenharmony_ci      Source_Len : in ULong)
357275793eaSopenharmony_ci      return     ULong;
358275793eaSopenharmony_ci
359275793eaSopenharmony_ci   function gzungetc (C : in Int; File : in  gzFile) return Int;
360275793eaSopenharmony_ci
361275793eaSopenharmony_ci   function zlibCompileFlags return ULong;
362275793eaSopenharmony_ci
363275793eaSopenharmony_ciprivate
364275793eaSopenharmony_ci
365275793eaSopenharmony_ci   type Z_Stream is record            -- zlib.h:68
366275793eaSopenharmony_ci      Next_In   : Voidp      := Nul;  -- next input byte
367275793eaSopenharmony_ci      Avail_In  : UInt       := 0;    -- number of bytes available at next_in
368275793eaSopenharmony_ci      Total_In  : ULong      := 0;    -- total nb of input bytes read so far
369275793eaSopenharmony_ci      Next_Out  : Voidp      := Nul;  -- next output byte should be put there
370275793eaSopenharmony_ci      Avail_Out : UInt       := 0;    -- remaining free space at next_out
371275793eaSopenharmony_ci      Total_Out : ULong      := 0;    -- total nb of bytes output so far
372275793eaSopenharmony_ci      msg       : Chars_Ptr;          -- last error message, NULL if no error
373275793eaSopenharmony_ci      state     : Voidp;              -- not visible by applications
374275793eaSopenharmony_ci      zalloc    : alloc_func := null; -- used to allocate the internal state
375275793eaSopenharmony_ci      zfree     : free_func  := null; -- used to free the internal state
376275793eaSopenharmony_ci      opaque    : Voidp;              -- private data object passed to
377275793eaSopenharmony_ci                                      --  zalloc and zfree
378275793eaSopenharmony_ci      data_type : Int;                -- best guess about the data type:
379275793eaSopenharmony_ci                                      --  ascii or binary
380275793eaSopenharmony_ci      adler     : ULong;              -- adler32 value of the uncompressed
381275793eaSopenharmony_ci                                      --  data
382275793eaSopenharmony_ci      reserved  : ULong;              -- reserved for future use
383275793eaSopenharmony_ci   end record;
384275793eaSopenharmony_ci
385275793eaSopenharmony_ci   pragma Convention (C, Z_Stream);
386275793eaSopenharmony_ci
387275793eaSopenharmony_ci   pragma Import (C, zlibVersion, "zlibVersion");
388275793eaSopenharmony_ci   pragma Import (C, Deflate, "deflate");
389275793eaSopenharmony_ci   pragma Import (C, DeflateEnd, "deflateEnd");
390275793eaSopenharmony_ci   pragma Import (C, Inflate, "inflate");
391275793eaSopenharmony_ci   pragma Import (C, InflateEnd, "inflateEnd");
392275793eaSopenharmony_ci   pragma Import (C, deflateSetDictionary, "deflateSetDictionary");
393275793eaSopenharmony_ci   pragma Import (C, deflateCopy, "deflateCopy");
394275793eaSopenharmony_ci   pragma Import (C, deflateReset, "deflateReset");
395275793eaSopenharmony_ci   pragma Import (C, deflateParams, "deflateParams");
396275793eaSopenharmony_ci   pragma Import (C, inflateSetDictionary, "inflateSetDictionary");
397275793eaSopenharmony_ci   pragma Import (C, inflateSync, "inflateSync");
398275793eaSopenharmony_ci   pragma Import (C, inflateReset, "inflateReset");
399275793eaSopenharmony_ci   pragma Import (C, compress, "compress");
400275793eaSopenharmony_ci   pragma Import (C, compress2, "compress2");
401275793eaSopenharmony_ci   pragma Import (C, uncompress, "uncompress");
402275793eaSopenharmony_ci   pragma Import (C, gzopen, "gzopen");
403275793eaSopenharmony_ci   pragma Import (C, gzdopen, "gzdopen");
404275793eaSopenharmony_ci   pragma Import (C, gzsetparams, "gzsetparams");
405275793eaSopenharmony_ci   pragma Import (C, gzread, "gzread");
406275793eaSopenharmony_ci   pragma Import (C, gzwrite, "gzwrite");
407275793eaSopenharmony_ci   pragma Import (C, gzprintf, "gzprintf");
408275793eaSopenharmony_ci   pragma Import (C, gzputs, "gzputs");
409275793eaSopenharmony_ci   pragma Import (C, gzgets, "gzgets");
410275793eaSopenharmony_ci   pragma Import (C, gzputc, "gzputc");
411275793eaSopenharmony_ci   pragma Import (C, gzgetc, "gzgetc");
412275793eaSopenharmony_ci   pragma Import (C, gzflush, "gzflush");
413275793eaSopenharmony_ci   pragma Import (C, gzseek, "gzseek");
414275793eaSopenharmony_ci   pragma Import (C, gzrewind, "gzrewind");
415275793eaSopenharmony_ci   pragma Import (C, gztell, "gztell");
416275793eaSopenharmony_ci   pragma Import (C, gzeof, "gzeof");
417275793eaSopenharmony_ci   pragma Import (C, gzclose, "gzclose");
418275793eaSopenharmony_ci   pragma Import (C, gzerror, "gzerror");
419275793eaSopenharmony_ci   pragma Import (C, adler32, "adler32");
420275793eaSopenharmony_ci   pragma Import (C, crc32, "crc32");
421275793eaSopenharmony_ci   pragma Import (C, deflateInit, "deflateInit_");
422275793eaSopenharmony_ci   pragma Import (C, inflateInit, "inflateInit_");
423275793eaSopenharmony_ci   pragma Import (C, deflateInit2, "deflateInit2_");
424275793eaSopenharmony_ci   pragma Import (C, inflateInit2, "inflateInit2_");
425275793eaSopenharmony_ci   pragma Import (C, zError, "zError");
426275793eaSopenharmony_ci   pragma Import (C, inflateSyncPoint, "inflateSyncPoint");
427275793eaSopenharmony_ci   pragma Import (C, get_crc_table, "get_crc_table");
428275793eaSopenharmony_ci
429275793eaSopenharmony_ci   --  since zlib 1.2.0:
430275793eaSopenharmony_ci
431275793eaSopenharmony_ci   pragma Import (C, inflateCopy, "inflateCopy");
432275793eaSopenharmony_ci   pragma Import (C, compressBound, "compressBound");
433275793eaSopenharmony_ci   pragma Import (C, deflateBound, "deflateBound");
434275793eaSopenharmony_ci   pragma Import (C, gzungetc, "gzungetc");
435275793eaSopenharmony_ci   pragma Import (C, zlibCompileFlags, "zlibCompileFlags");
436275793eaSopenharmony_ci
437275793eaSopenharmony_ci   pragma Import (C, inflateBackInit, "inflateBackInit_");
438275793eaSopenharmony_ci
439275793eaSopenharmony_ci   --  I stopped binding the inflateBack routines, because realize that
440275793eaSopenharmony_ci   --  it does not support zlib and gzip headers for now, and have no
441275793eaSopenharmony_ci   --  symmetric deflateBack routines.
442275793eaSopenharmony_ci   --  ZLib-Ada is symmetric regarding deflate/inflate data transformation
443275793eaSopenharmony_ci   --  and has a similar generic callback interface for the
444275793eaSopenharmony_ci   --  deflate/inflate transformation based on the regular Deflate/Inflate
445275793eaSopenharmony_ci   --  routines.
446275793eaSopenharmony_ci
447275793eaSopenharmony_ci   --  pragma Import (C, inflateBack, "inflateBack");
448275793eaSopenharmony_ci   --  pragma Import (C, inflateBackEnd, "inflateBackEnd");
449275793eaSopenharmony_ci
450275793eaSopenharmony_ciend ZLib.Thin;
451