diff options
Diffstat (limited to 'contrib/ada/zlib-thin.ads')
-rw-r--r-- | contrib/ada/zlib-thin.ads | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/contrib/ada/zlib-thin.ads b/contrib/ada/zlib-thin.ads index c227374..d4407eb 100644 --- a/contrib/ada/zlib-thin.ads +++ b/contrib/ada/zlib-thin.ads | |||
@@ -6,10 +6,11 @@ | |||
6 | -- Open source license information is in the zlib.ads file. -- | 6 | -- Open source license information is in the zlib.ads file. -- |
7 | ---------------------------------------------------------------- | 7 | ---------------------------------------------------------------- |
8 | 8 | ||
9 | -- $Id: zlib-thin.ads,v 1.8 2003/08/12 13:16:51 vagul Exp $ | 9 | -- $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $ |
10 | 10 | ||
11 | with Interfaces.C.Strings; | 11 | with Interfaces.C.Strings; |
12 | with System.Address_To_Access_Conversions; | 12 | |
13 | with System; | ||
13 | 14 | ||
14 | private package ZLib.Thin is | 15 | private package ZLib.Thin is |
15 | 16 | ||
@@ -36,18 +37,18 @@ private package ZLib.Thin is | |||
36 | -- zconf.h:216 | 37 | -- zconf.h:216 |
37 | type Int is new Interfaces.C.int; | 38 | type Int is new Interfaces.C.int; |
38 | 39 | ||
39 | type ULong is new Interfaces.C.unsigned; -- 32 bits or more | 40 | type ULong is new Interfaces.C.unsigned_long; -- 32 bits or more |
40 | -- zconf.h:217 | 41 | -- zconf.h:217 |
41 | subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr; | 42 | subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr; |
42 | 43 | ||
43 | type ULong_Access is access ULong; | 44 | type ULong_Access is access ULong; |
44 | type Int_Access is access Int; | 45 | type Int_Access is access Int; |
45 | subtype Voidp is System.Address; -- zconf.h:232 | ||
46 | 46 | ||
47 | package Bytes is new System.Address_To_Access_Conversions (Byte); | 47 | subtype Voidp is System.Address; -- zconf.h:232 |
48 | 48 | ||
49 | subtype Byte_Access is Bytes.Object_Pointer; | 49 | subtype Byte_Access is Voidp; |
50 | 50 | ||
51 | Nul : constant Voidp := System.Null_Address; | ||
51 | -- end from zconf | 52 | -- end from zconf |
52 | 53 | ||
53 | Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125 | 54 | Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125 |
@@ -251,12 +252,6 @@ private package ZLib.Thin is | |||
251 | stream_size : Int) | 252 | stream_size : Int) |
252 | return Int; | 253 | return Int; |
253 | 254 | ||
254 | function Deflate_Init | ||
255 | (strm : in Z_Streamp; | ||
256 | level : in Int := Z_DEFAULT_COMPRESSION) | ||
257 | return Int; | ||
258 | pragma Inline (Deflate_Init); | ||
259 | |||
260 | function deflateInit2 | 255 | function deflateInit2 |
261 | (strm : Z_Streamp; | 256 | (strm : Z_Streamp; |
262 | level : Int; | 257 | level : Int; |
@@ -284,9 +279,6 @@ private package ZLib.Thin is | |||
284 | stream_size : Int) | 279 | stream_size : Int) |
285 | return Int; | 280 | return Int; |
286 | 281 | ||
287 | function Inflate_Init (strm : Z_Streamp) return Int; | ||
288 | pragma Inline (Inflate_Init); | ||
289 | |||
290 | function inflateInit2 | 282 | function inflateInit2 |
291 | (strm : in Z_Streamp; | 283 | (strm : in Z_Streamp; |
292 | windowBits : in Int; | 284 | windowBits : in Int; |
@@ -318,20 +310,6 @@ private package ZLib.Thin is | |||
318 | -- has dropped to zero. The application must initialize zalloc, zfree and | 310 | -- has dropped to zero. The application must initialize zalloc, zfree and |
319 | -- opaque before calling the init function. | 311 | -- opaque before calling the init function. |
320 | 312 | ||
321 | function Need_In (strm : in Z_Stream) return Boolean; | ||
322 | -- return true when we do not need to setup Next_In and Avail_In fields. | ||
323 | pragma Inline (Need_In); | ||
324 | |||
325 | function Need_Out (strm : in Z_Stream) return Boolean; | ||
326 | -- return true when we do not need to setup Next_Out and Avail_Out field. | ||
327 | pragma Inline (Need_Out); | ||
328 | |||
329 | procedure Set_In | ||
330 | (Strm : in out Z_Stream; | ||
331 | Buffer : in Byte_Access; | ||
332 | Size : in UInt); | ||
333 | pragma Inline (Set_In); | ||
334 | |||
335 | procedure Set_In | 313 | procedure Set_In |
336 | (Strm : in out Z_Stream; | 314 | (Strm : in out Z_Stream; |
337 | Buffer : in Voidp; | 315 | Buffer : in Voidp; |
@@ -340,12 +318,6 @@ private package ZLib.Thin is | |||
340 | 318 | ||
341 | procedure Set_Out | 319 | procedure Set_Out |
342 | (Strm : in out Z_Stream; | 320 | (Strm : in out Z_Stream; |
343 | Buffer : in Byte_Access; | ||
344 | Size : in UInt); | ||
345 | pragma Inline (Set_Out); | ||
346 | |||
347 | procedure Set_Out | ||
348 | (Strm : in out Z_Stream; | ||
349 | Buffer : in Voidp; | 321 | Buffer : in Voidp; |
350 | Size : in UInt); | 322 | Size : in UInt); |
351 | pragma Inline (Set_Out); | 323 | pragma Inline (Set_Out); |
@@ -388,19 +360,13 @@ private package ZLib.Thin is | |||
388 | 360 | ||
389 | function zlibCompileFlags return ULong; | 361 | function zlibCompileFlags return ULong; |
390 | 362 | ||
391 | function deflatePrime | ||
392 | (strm : Z_Streamp; | ||
393 | bits : Int; | ||
394 | value : Int) | ||
395 | return Int; | ||
396 | |||
397 | private | 363 | private |
398 | 364 | ||
399 | type Z_Stream is record -- zlib.h:68 | 365 | type Z_Stream is record -- zlib.h:68 |
400 | Next_In : Byte_Access; -- next input byte | 366 | Next_In : Voidp := Nul; -- next input byte |
401 | Avail_In : UInt := 0; -- number of bytes available at next_in | 367 | Avail_In : UInt := 0; -- number of bytes available at next_in |
402 | Total_In : ULong := 0; -- total nb of input bytes read so far | 368 | Total_In : ULong := 0; -- total nb of input bytes read so far |
403 | Next_Out : Byte_Access; -- next output byte should be put there | 369 | Next_Out : Voidp := Nul; -- next output byte should be put there |
404 | Avail_Out : UInt := 0; -- remaining free space at next_out | 370 | Avail_Out : UInt := 0; -- remaining free space at next_out |
405 | Total_Out : ULong := 0; -- total nb of bytes output so far | 371 | Total_Out : ULong := 0; -- total nb of bytes output so far |
406 | msg : Chars_Ptr; -- last error message, NULL if no error | 372 | msg : Chars_Ptr; -- last error message, NULL if no error |
@@ -460,14 +426,13 @@ private | |||
460 | pragma Import (C, inflateSyncPoint, "inflateSyncPoint"); | 426 | pragma Import (C, inflateSyncPoint, "inflateSyncPoint"); |
461 | pragma Import (C, get_crc_table, "get_crc_table"); | 427 | pragma Import (C, get_crc_table, "get_crc_table"); |
462 | 428 | ||
463 | -- added in zlib 1.2.1: | 429 | -- since zlib 1.2.0: |
464 | 430 | ||
465 | pragma Import (C, inflateCopy, "inflateCopy"); | 431 | pragma Import (C, inflateCopy, "inflateCopy"); |
466 | pragma Import (C, compressBound, "compressBound"); | 432 | pragma Import (C, compressBound, "compressBound"); |
467 | pragma Import (C, deflateBound, "deflateBound"); | 433 | pragma Import (C, deflateBound, "deflateBound"); |
468 | pragma Import (C, gzungetc, "gzungetc"); | 434 | pragma Import (C, gzungetc, "gzungetc"); |
469 | pragma Import (C, zlibCompileFlags, "zlibCompileFlags"); | 435 | pragma Import (C, zlibCompileFlags, "zlibCompileFlags"); |
470 | pragma Import (C, deflatePrime, "deflatePrime"); | ||
471 | 436 | ||
472 | pragma Import (C, inflateBackInit, "inflateBackInit_"); | 437 | pragma Import (C, inflateBackInit, "inflateBackInit_"); |
473 | 438 | ||