1ed6a76a9Schristos----------------------------------------------------------------
2ed6a76a9Schristos--  ZLib for Ada thick binding.                               --
3ed6a76a9Schristos--                                                            --
4ed6a76a9Schristos--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
5ed6a76a9Schristos--                                                            --
6ed6a76a9Schristos--  Open source license information is in the zlib.ads file.  --
7ed6a76a9Schristos----------------------------------------------------------------
8ed6a76a9Schristos
9*f72a8c67Schristos--  $Id: zlib-thin.ads,v 1.2 2020/09/15 02:05:31 christos Exp $
10ed6a76a9Schristos
11ed6a76a9Schristoswith Interfaces.C.Strings;
12ed6a76a9Schristos
13ed6a76a9Schristoswith System;
14ed6a76a9Schristos
15ed6a76a9Schristosprivate package ZLib.Thin is
16ed6a76a9Schristos
17ed6a76a9Schristos   --  From zconf.h
18ed6a76a9Schristos
19ed6a76a9Schristos   MAX_MEM_LEVEL : constant := 9;         --  zconf.h:105
20ed6a76a9Schristos                                          --  zconf.h:105
21ed6a76a9Schristos   MAX_WBITS : constant := 15;      --  zconf.h:115
22ed6a76a9Schristos                                    --  32K LZ77 window
23ed6a76a9Schristos                                    --  zconf.h:115
24ed6a76a9Schristos   SEEK_SET : constant := 8#0000#;  --  zconf.h:244
25ed6a76a9Schristos                                    --  Seek from beginning of file.
26ed6a76a9Schristos                                    --  zconf.h:244
27ed6a76a9Schristos   SEEK_CUR : constant := 1;        --  zconf.h:245
28ed6a76a9Schristos                                    --  Seek from current position.
29ed6a76a9Schristos                                    --  zconf.h:245
30ed6a76a9Schristos   SEEK_END : constant := 2;        --  zconf.h:246
31ed6a76a9Schristos                                    --  Set file pointer to EOF plus "offset"
32ed6a76a9Schristos                                    --  zconf.h:246
33ed6a76a9Schristos
34ed6a76a9Schristos   type Byte is new Interfaces.C.unsigned_char; --  8 bits
35ed6a76a9Schristos                                                --  zconf.h:214
36ed6a76a9Schristos   type UInt is new Interfaces.C.unsigned;      --  16 bits or more
37ed6a76a9Schristos                                                --  zconf.h:216
38ed6a76a9Schristos   type Int is new Interfaces.C.int;
39ed6a76a9Schristos
40ed6a76a9Schristos   type ULong is new Interfaces.C.unsigned_long;     --  32 bits or more
41ed6a76a9Schristos                                                     --  zconf.h:217
42ed6a76a9Schristos   subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;
43ed6a76a9Schristos
44ed6a76a9Schristos   type ULong_Access is access ULong;
45ed6a76a9Schristos   type Int_Access is access Int;
46ed6a76a9Schristos
47ed6a76a9Schristos   subtype Voidp is System.Address;            --  zconf.h:232
48ed6a76a9Schristos
49ed6a76a9Schristos   subtype Byte_Access is Voidp;
50ed6a76a9Schristos
51ed6a76a9Schristos   Nul : constant Voidp := System.Null_Address;
52ed6a76a9Schristos   --  end from zconf
53ed6a76a9Schristos
54ed6a76a9Schristos   Z_NO_FLUSH : constant := 8#0000#;   --  zlib.h:125
55ed6a76a9Schristos                                       --  zlib.h:125
56ed6a76a9Schristos   Z_PARTIAL_FLUSH : constant := 1;       --  zlib.h:126
57ed6a76a9Schristos                                          --  will be removed, use
58ed6a76a9Schristos                                          --  Z_SYNC_FLUSH instead
59ed6a76a9Schristos                                          --  zlib.h:126
60ed6a76a9Schristos   Z_SYNC_FLUSH : constant := 2;       --  zlib.h:127
61ed6a76a9Schristos                                       --  zlib.h:127
62ed6a76a9Schristos   Z_FULL_FLUSH : constant := 3;       --  zlib.h:128
63ed6a76a9Schristos                                       --  zlib.h:128
64ed6a76a9Schristos   Z_FINISH : constant := 4;        --  zlib.h:129
65ed6a76a9Schristos                                    --  zlib.h:129
66ed6a76a9Schristos   Z_OK : constant := 8#0000#;   --  zlib.h:132
67ed6a76a9Schristos                                 --  zlib.h:132
68ed6a76a9Schristos   Z_STREAM_END : constant := 1;       --  zlib.h:133
69ed6a76a9Schristos                                       --  zlib.h:133
70ed6a76a9Schristos   Z_NEED_DICT : constant := 2;        --  zlib.h:134
71ed6a76a9Schristos                                       --  zlib.h:134
72ed6a76a9Schristos   Z_ERRNO : constant := -1;        --  zlib.h:135
73ed6a76a9Schristos                                    --  zlib.h:135
74ed6a76a9Schristos   Z_STREAM_ERROR : constant := -2;       --  zlib.h:136
75ed6a76a9Schristos                                          --  zlib.h:136
76ed6a76a9Schristos   Z_DATA_ERROR : constant := -3;      --  zlib.h:137
77ed6a76a9Schristos                                       --  zlib.h:137
78ed6a76a9Schristos   Z_MEM_ERROR : constant := -4;       --  zlib.h:138
79ed6a76a9Schristos                                       --  zlib.h:138
80ed6a76a9Schristos   Z_BUF_ERROR : constant := -5;       --  zlib.h:139
81ed6a76a9Schristos                                       --  zlib.h:139
82ed6a76a9Schristos   Z_VERSION_ERROR : constant := -6;      --  zlib.h:140
83ed6a76a9Schristos                                          --  zlib.h:140
84ed6a76a9Schristos   Z_NO_COMPRESSION : constant := 8#0000#;   --  zlib.h:145
85ed6a76a9Schristos                                             --  zlib.h:145
86ed6a76a9Schristos   Z_BEST_SPEED : constant := 1;       --  zlib.h:146
87ed6a76a9Schristos                                       --  zlib.h:146
88ed6a76a9Schristos   Z_BEST_COMPRESSION : constant := 9;       --  zlib.h:147
89ed6a76a9Schristos                                             --  zlib.h:147
90ed6a76a9Schristos   Z_DEFAULT_COMPRESSION : constant := -1;      --  zlib.h:148
91ed6a76a9Schristos                                                --  zlib.h:148
92ed6a76a9Schristos   Z_FILTERED : constant := 1;      --  zlib.h:151
93ed6a76a9Schristos                                    --  zlib.h:151
94ed6a76a9Schristos   Z_HUFFMAN_ONLY : constant := 2;        --  zlib.h:152
95ed6a76a9Schristos                                          --  zlib.h:152
96ed6a76a9Schristos   Z_DEFAULT_STRATEGY : constant := 8#0000#; --  zlib.h:153
97ed6a76a9Schristos                                             --  zlib.h:153
98ed6a76a9Schristos   Z_BINARY : constant := 8#0000#;  --  zlib.h:156
99ed6a76a9Schristos                                    --  zlib.h:156
100ed6a76a9Schristos   Z_ASCII : constant := 1;      --  zlib.h:157
101ed6a76a9Schristos                                 --  zlib.h:157
102ed6a76a9Schristos   Z_UNKNOWN : constant := 2;       --  zlib.h:158
103ed6a76a9Schristos                                    --  zlib.h:158
104ed6a76a9Schristos   Z_DEFLATED : constant := 8;      --  zlib.h:161
105ed6a76a9Schristos                                    --  zlib.h:161
106ed6a76a9Schristos   Z_NULL : constant := 8#0000#; --  zlib.h:164
107ed6a76a9Schristos                                 --  for initializing zalloc, zfree, opaque
108ed6a76a9Schristos                                 --  zlib.h:164
109ed6a76a9Schristos   type gzFile is new Voidp;                  --  zlib.h:646
110ed6a76a9Schristos
111ed6a76a9Schristos   type Z_Stream is private;
112ed6a76a9Schristos
113ed6a76a9Schristos   type Z_Streamp is access all Z_Stream;     --  zlib.h:89
114ed6a76a9Schristos
115ed6a76a9Schristos   type alloc_func is access function
116ed6a76a9Schristos     (Opaque : Voidp;
117ed6a76a9Schristos      Items  : UInt;
118ed6a76a9Schristos      Size   : UInt)
119ed6a76a9Schristos      return Voidp; --  zlib.h:63
120ed6a76a9Schristos
121ed6a76a9Schristos   type free_func is access procedure (opaque : Voidp; address : Voidp);
122ed6a76a9Schristos
123ed6a76a9Schristos   function zlibVersion return Chars_Ptr;
124ed6a76a9Schristos
125ed6a76a9Schristos   function Deflate (strm : Z_Streamp; flush : Int) return Int;
126ed6a76a9Schristos
127ed6a76a9Schristos   function DeflateEnd (strm : Z_Streamp) return Int;
128ed6a76a9Schristos
129ed6a76a9Schristos   function Inflate (strm : Z_Streamp; flush : Int) return Int;
130ed6a76a9Schristos
131ed6a76a9Schristos   function InflateEnd (strm : Z_Streamp) return Int;
132ed6a76a9Schristos
133ed6a76a9Schristos   function deflateSetDictionary
134ed6a76a9Schristos     (strm       : Z_Streamp;
135ed6a76a9Schristos      dictionary : Byte_Access;
136ed6a76a9Schristos      dictLength : UInt)
137ed6a76a9Schristos      return       Int;
138ed6a76a9Schristos
139ed6a76a9Schristos   function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int;
140ed6a76a9Schristos   --  zlib.h:478
141ed6a76a9Schristos
142ed6a76a9Schristos   function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495
143ed6a76a9Schristos
144ed6a76a9Schristos   function deflateParams
145ed6a76a9Schristos     (strm     : Z_Streamp;
146ed6a76a9Schristos      level    : Int;
147ed6a76a9Schristos      strategy : Int)
148ed6a76a9Schristos      return     Int;       -- zlib.h:506
149ed6a76a9Schristos
150ed6a76a9Schristos   function inflateSetDictionary
151ed6a76a9Schristos     (strm       : Z_Streamp;
152ed6a76a9Schristos      dictionary : Byte_Access;
153ed6a76a9Schristos      dictLength : UInt)
154ed6a76a9Schristos      return       Int; --  zlib.h:548
155ed6a76a9Schristos
156ed6a76a9Schristos   function inflateSync (strm : Z_Streamp) return Int;  --  zlib.h:565
157ed6a76a9Schristos
158ed6a76a9Schristos   function inflateReset (strm : Z_Streamp) return Int; --  zlib.h:580
159ed6a76a9Schristos
160ed6a76a9Schristos   function compress
161ed6a76a9Schristos     (dest      : Byte_Access;
162ed6a76a9Schristos      destLen   : ULong_Access;
163ed6a76a9Schristos      source    : Byte_Access;
164ed6a76a9Schristos      sourceLen : ULong)
165ed6a76a9Schristos      return      Int;           -- zlib.h:601
166ed6a76a9Schristos
167ed6a76a9Schristos   function compress2
168ed6a76a9Schristos     (dest      : Byte_Access;
169ed6a76a9Schristos      destLen   : ULong_Access;
170ed6a76a9Schristos      source    : Byte_Access;
171ed6a76a9Schristos      sourceLen : ULong;
172ed6a76a9Schristos      level     : Int)
173ed6a76a9Schristos      return      Int;          -- zlib.h:615
174ed6a76a9Schristos
175ed6a76a9Schristos   function uncompress
176ed6a76a9Schristos     (dest      : Byte_Access;
177ed6a76a9Schristos      destLen   : ULong_Access;
178ed6a76a9Schristos      source    : Byte_Access;
179ed6a76a9Schristos      sourceLen : ULong)
180ed6a76a9Schristos      return      Int;
181ed6a76a9Schristos
182ed6a76a9Schristos   function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile;
183ed6a76a9Schristos
184ed6a76a9Schristos   function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile;
185ed6a76a9Schristos
186ed6a76a9Schristos   function gzsetparams
187ed6a76a9Schristos     (file     : gzFile;
188ed6a76a9Schristos      level    : Int;
189ed6a76a9Schristos      strategy : Int)
190ed6a76a9Schristos      return     Int;
191ed6a76a9Schristos
192ed6a76a9Schristos   function gzread
193ed6a76a9Schristos     (file : gzFile;
194ed6a76a9Schristos      buf  : Voidp;
195ed6a76a9Schristos      len  : UInt)
196ed6a76a9Schristos      return Int;
197ed6a76a9Schristos
198ed6a76a9Schristos   function gzwrite
199ed6a76a9Schristos     (file : in gzFile;
200ed6a76a9Schristos      buf  : in Voidp;
201ed6a76a9Schristos      len  : in UInt)
202ed6a76a9Schristos      return Int;
203ed6a76a9Schristos
204ed6a76a9Schristos   function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int;
205ed6a76a9Schristos
206ed6a76a9Schristos   function gzputs (file : in gzFile; s : in Chars_Ptr) return Int;
207ed6a76a9Schristos
208ed6a76a9Schristos   function gzgets
209ed6a76a9Schristos     (file : gzFile;
210ed6a76a9Schristos      buf  : Chars_Ptr;
211ed6a76a9Schristos      len  : Int)
212ed6a76a9Schristos      return Chars_Ptr;
213ed6a76a9Schristos
214ed6a76a9Schristos   function gzputc (file : gzFile; char : Int) return Int;
215ed6a76a9Schristos
216ed6a76a9Schristos   function gzgetc (file : gzFile) return Int;
217ed6a76a9Schristos
218ed6a76a9Schristos   function gzflush (file : gzFile; flush : Int) return Int;
219ed6a76a9Schristos
220ed6a76a9Schristos   function gzseek
221ed6a76a9Schristos     (file   : gzFile;
222ed6a76a9Schristos      offset : Int;
223ed6a76a9Schristos      whence : Int)
224ed6a76a9Schristos      return   Int;
225ed6a76a9Schristos
226ed6a76a9Schristos   function gzrewind (file : gzFile) return Int;
227ed6a76a9Schristos
228ed6a76a9Schristos   function gztell (file : gzFile) return Int;
229ed6a76a9Schristos
230ed6a76a9Schristos   function gzeof (file : gzFile) return Int;
231ed6a76a9Schristos
232ed6a76a9Schristos   function gzclose (file : gzFile) return Int;
233ed6a76a9Schristos
234ed6a76a9Schristos   function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr;
235ed6a76a9Schristos
236ed6a76a9Schristos   function adler32
237ed6a76a9Schristos     (adler : ULong;
238ed6a76a9Schristos      buf   : Byte_Access;
239ed6a76a9Schristos      len   : UInt)
240ed6a76a9Schristos      return  ULong;
241ed6a76a9Schristos
242ed6a76a9Schristos   function crc32
243ed6a76a9Schristos     (crc  : ULong;
244ed6a76a9Schristos      buf  : Byte_Access;
245ed6a76a9Schristos      len  : UInt)
246ed6a76a9Schristos      return ULong;
247ed6a76a9Schristos
248ed6a76a9Schristos   function deflateInit
249ed6a76a9Schristos     (strm        : Z_Streamp;
250ed6a76a9Schristos      level       : Int;
251ed6a76a9Schristos      version     : Chars_Ptr;
252ed6a76a9Schristos      stream_size : Int)
253ed6a76a9Schristos      return        Int;
254ed6a76a9Schristos
255ed6a76a9Schristos   function deflateInit2
256ed6a76a9Schristos     (strm        : Z_Streamp;
257ed6a76a9Schristos      level       : Int;
258ed6a76a9Schristos      method      : Int;
259ed6a76a9Schristos      windowBits  : Int;
260ed6a76a9Schristos      memLevel    : Int;
261ed6a76a9Schristos      strategy    : Int;
262ed6a76a9Schristos      version     : Chars_Ptr;
263ed6a76a9Schristos      stream_size : Int)
264ed6a76a9Schristos      return        Int;
265ed6a76a9Schristos
266ed6a76a9Schristos   function Deflate_Init
267ed6a76a9Schristos     (strm       : Z_Streamp;
268ed6a76a9Schristos      level      : Int;
269ed6a76a9Schristos      method     : Int;
270ed6a76a9Schristos      windowBits : Int;
271ed6a76a9Schristos      memLevel   : Int;
272ed6a76a9Schristos      strategy   : Int)
273ed6a76a9Schristos      return       Int;
274ed6a76a9Schristos   pragma Inline (Deflate_Init);
275ed6a76a9Schristos
276ed6a76a9Schristos   function inflateInit
277ed6a76a9Schristos     (strm        : Z_Streamp;
278ed6a76a9Schristos      version     : Chars_Ptr;
279ed6a76a9Schristos      stream_size : Int)
280ed6a76a9Schristos      return        Int;
281ed6a76a9Schristos
282ed6a76a9Schristos   function inflateInit2
283ed6a76a9Schristos     (strm        : in Z_Streamp;
284ed6a76a9Schristos      windowBits  : in Int;
285ed6a76a9Schristos      version     : in Chars_Ptr;
286ed6a76a9Schristos      stream_size : in Int)
287ed6a76a9Schristos      return      Int;
288ed6a76a9Schristos
289ed6a76a9Schristos   function inflateBackInit
290ed6a76a9Schristos     (strm        : in Z_Streamp;
291ed6a76a9Schristos      windowBits  : in Int;
292ed6a76a9Schristos      window      : in Byte_Access;
293ed6a76a9Schristos      version     : in Chars_Ptr;
294ed6a76a9Schristos      stream_size : in Int)
295ed6a76a9Schristos      return      Int;
296ed6a76a9Schristos   --  Size of window have to be 2**windowBits.
297ed6a76a9Schristos
298ed6a76a9Schristos   function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int;
299ed6a76a9Schristos   pragma Inline (Inflate_Init);
300ed6a76a9Schristos
301ed6a76a9Schristos   function zError (err : Int) return Chars_Ptr;
302ed6a76a9Schristos
303ed6a76a9Schristos   function inflateSyncPoint (z : Z_Streamp) return Int;
304ed6a76a9Schristos
305ed6a76a9Schristos   function get_crc_table return ULong_Access;
306ed6a76a9Schristos
307ed6a76a9Schristos   --  Interface to the available fields of the z_stream structure.
308ed6a76a9Schristos   --  The application must update next_in and avail_in when avail_in has
309ed6a76a9Schristos   --  dropped to zero. It must update next_out and avail_out when avail_out
310ed6a76a9Schristos   --  has dropped to zero. The application must initialize zalloc, zfree and
311ed6a76a9Schristos   --  opaque before calling the init function.
312ed6a76a9Schristos
313ed6a76a9Schristos   procedure Set_In
314ed6a76a9Schristos     (Strm   : in out Z_Stream;
315ed6a76a9Schristos      Buffer : in Voidp;
316ed6a76a9Schristos      Size   : in UInt);
317ed6a76a9Schristos   pragma Inline (Set_In);
318ed6a76a9Schristos
319ed6a76a9Schristos   procedure Set_Out
320ed6a76a9Schristos     (Strm   : in out Z_Stream;
321ed6a76a9Schristos      Buffer : in Voidp;
322ed6a76a9Schristos      Size   : in UInt);
323ed6a76a9Schristos   pragma Inline (Set_Out);
324ed6a76a9Schristos
325ed6a76a9Schristos   procedure Set_Mem_Func
326ed6a76a9Schristos     (Strm   : in out Z_Stream;
327ed6a76a9Schristos      Opaque : in Voidp;
328ed6a76a9Schristos      Alloc  : in alloc_func;
329ed6a76a9Schristos      Free   : in free_func);
330ed6a76a9Schristos   pragma Inline (Set_Mem_Func);
331ed6a76a9Schristos
332ed6a76a9Schristos   function Last_Error_Message (Strm : in Z_Stream) return String;
333ed6a76a9Schristos   pragma Inline (Last_Error_Message);
334ed6a76a9Schristos
335ed6a76a9Schristos   function Avail_Out (Strm : in Z_Stream) return UInt;
336ed6a76a9Schristos   pragma Inline (Avail_Out);
337ed6a76a9Schristos
338ed6a76a9Schristos   function Avail_In (Strm : in Z_Stream) return UInt;
339ed6a76a9Schristos   pragma Inline (Avail_In);
340ed6a76a9Schristos
341ed6a76a9Schristos   function Total_In (Strm : in Z_Stream) return ULong;
342ed6a76a9Schristos   pragma Inline (Total_In);
343ed6a76a9Schristos
344ed6a76a9Schristos   function Total_Out (Strm : in Z_Stream) return ULong;
345ed6a76a9Schristos   pragma Inline (Total_Out);
346ed6a76a9Schristos
347ed6a76a9Schristos   function inflateCopy
348ed6a76a9Schristos     (dest   : in Z_Streamp;
349ed6a76a9Schristos      Source : in Z_Streamp)
350ed6a76a9Schristos      return Int;
351ed6a76a9Schristos
352ed6a76a9Schristos   function compressBound (Source_Len : in ULong) return ULong;
353ed6a76a9Schristos
354ed6a76a9Schristos   function deflateBound
355ed6a76a9Schristos     (Strm       : in Z_Streamp;
356ed6a76a9Schristos      Source_Len : in ULong)
357ed6a76a9Schristos      return     ULong;
358ed6a76a9Schristos
359ed6a76a9Schristos   function gzungetc (C : in Int; File : in  gzFile) return Int;
360ed6a76a9Schristos
361ed6a76a9Schristos   function zlibCompileFlags return ULong;
362ed6a76a9Schristos
363ed6a76a9Schristosprivate
364ed6a76a9Schristos
365ed6a76a9Schristos   type Z_Stream is record            -- zlib.h:68
366ed6a76a9Schristos      Next_In   : Voidp      := Nul;  -- next input byte
367ed6a76a9Schristos      Avail_In  : UInt       := 0;    -- number of bytes available at next_in
368ed6a76a9Schristos      Total_In  : ULong      := 0;    -- total nb of input bytes read so far
369ed6a76a9Schristos      Next_Out  : Voidp      := Nul;  -- next output byte should be put there
370ed6a76a9Schristos      Avail_Out : UInt       := 0;    -- remaining free space at next_out
371ed6a76a9Schristos      Total_Out : ULong      := 0;    -- total nb of bytes output so far
372ed6a76a9Schristos      msg       : Chars_Ptr;          -- last error message, NULL if no error
373ed6a76a9Schristos      state     : Voidp;              -- not visible by applications
374ed6a76a9Schristos      zalloc    : alloc_func := null; -- used to allocate the internal state
375ed6a76a9Schristos      zfree     : free_func  := null; -- used to free the internal state
376ed6a76a9Schristos      opaque    : Voidp;              -- private data object passed to
377ed6a76a9Schristos                                      --  zalloc and zfree
378ed6a76a9Schristos      data_type : Int;                -- best guess about the data type:
379ed6a76a9Schristos                                      --  ascii or binary
380ed6a76a9Schristos      adler     : ULong;              -- adler32 value of the uncompressed
381ed6a76a9Schristos                                      --  data
382ed6a76a9Schristos      reserved  : ULong;              -- reserved for future use
383ed6a76a9Schristos   end record;
384ed6a76a9Schristos
385ed6a76a9Schristos   pragma Convention (C, Z_Stream);
386ed6a76a9Schristos
387ed6a76a9Schristos   pragma Import (C, zlibVersion, "zlibVersion");
388ed6a76a9Schristos   pragma Import (C, Deflate, "deflate");
389ed6a76a9Schristos   pragma Import (C, DeflateEnd, "deflateEnd");
390ed6a76a9Schristos   pragma Import (C, Inflate, "inflate");
391ed6a76a9Schristos   pragma Import (C, InflateEnd, "inflateEnd");
392ed6a76a9Schristos   pragma Import (C, deflateSetDictionary, "deflateSetDictionary");
393ed6a76a9Schristos   pragma Import (C, deflateCopy, "deflateCopy");
394ed6a76a9Schristos   pragma Import (C, deflateReset, "deflateReset");
395ed6a76a9Schristos   pragma Import (C, deflateParams, "deflateParams");
396ed6a76a9Schristos   pragma Import (C, inflateSetDictionary, "inflateSetDictionary");
397ed6a76a9Schristos   pragma Import (C, inflateSync, "inflateSync");
398ed6a76a9Schristos   pragma Import (C, inflateReset, "inflateReset");
399ed6a76a9Schristos   pragma Import (C, compress, "compress");
400ed6a76a9Schristos   pragma Import (C, compress2, "compress2");
401ed6a76a9Schristos   pragma Import (C, uncompress, "uncompress");
402ed6a76a9Schristos   pragma Import (C, gzopen, "gzopen");
403ed6a76a9Schristos   pragma Import (C, gzdopen, "gzdopen");
404ed6a76a9Schristos   pragma Import (C, gzsetparams, "gzsetparams");
405ed6a76a9Schristos   pragma Import (C, gzread, "gzread");
406ed6a76a9Schristos   pragma Import (C, gzwrite, "gzwrite");
407ed6a76a9Schristos   pragma Import (C, gzprintf, "gzprintf");
408ed6a76a9Schristos   pragma Import (C, gzputs, "gzputs");
409ed6a76a9Schristos   pragma Import (C, gzgets, "gzgets");
410ed6a76a9Schristos   pragma Import (C, gzputc, "gzputc");
411ed6a76a9Schristos   pragma Import (C, gzgetc, "gzgetc");
412ed6a76a9Schristos   pragma Import (C, gzflush, "gzflush");
413ed6a76a9Schristos   pragma Import (C, gzseek, "gzseek");
414ed6a76a9Schristos   pragma Import (C, gzrewind, "gzrewind");
415ed6a76a9Schristos   pragma Import (C, gztell, "gztell");
416ed6a76a9Schristos   pragma Import (C, gzeof, "gzeof");
417ed6a76a9Schristos   pragma Import (C, gzclose, "gzclose");
418ed6a76a9Schristos   pragma Import (C, gzerror, "gzerror");
419ed6a76a9Schristos   pragma Import (C, adler32, "adler32");
420ed6a76a9Schristos   pragma Import (C, crc32, "crc32");
421ed6a76a9Schristos   pragma Import (C, deflateInit, "deflateInit_");
422ed6a76a9Schristos   pragma Import (C, inflateInit, "inflateInit_");
423ed6a76a9Schristos   pragma Import (C, deflateInit2, "deflateInit2_");
424ed6a76a9Schristos   pragma Import (C, inflateInit2, "inflateInit2_");
425ed6a76a9Schristos   pragma Import (C, zError, "zError");
426ed6a76a9Schristos   pragma Import (C, inflateSyncPoint, "inflateSyncPoint");
427ed6a76a9Schristos   pragma Import (C, get_crc_table, "get_crc_table");
428ed6a76a9Schristos
429ed6a76a9Schristos   --  since zlib 1.2.0:
430ed6a76a9Schristos
431ed6a76a9Schristos   pragma Import (C, inflateCopy, "inflateCopy");
432ed6a76a9Schristos   pragma Import (C, compressBound, "compressBound");
433ed6a76a9Schristos   pragma Import (C, deflateBound, "deflateBound");
434ed6a76a9Schristos   pragma Import (C, gzungetc, "gzungetc");
435ed6a76a9Schristos   pragma Import (C, zlibCompileFlags, "zlibCompileFlags");
436ed6a76a9Schristos
437ed6a76a9Schristos   pragma Import (C, inflateBackInit, "inflateBackInit_");
438ed6a76a9Schristos
4391c468f90Schristos   --  I stopped binding the inflateBack routines, because realize that
440ed6a76a9Schristos   --  it does not support zlib and gzip headers for now, and have no
441ed6a76a9Schristos   --  symmetric deflateBack routines.
442ed6a76a9Schristos   --  ZLib-Ada is symmetric regarding deflate/inflate data transformation
443ed6a76a9Schristos   --  and has a similar generic callback interface for the
444ed6a76a9Schristos   --  deflate/inflate transformation based on the regular Deflate/Inflate
445ed6a76a9Schristos   --  routines.
446ed6a76a9Schristos
447ed6a76a9Schristos   --  pragma Import (C, inflateBack, "inflateBack");
448ed6a76a9Schristos   --  pragma Import (C, inflateBackEnd, "inflateBackEnd");
449ed6a76a9Schristos
450ed6a76a9Schristosend ZLib.Thin;
451