0 | module System.Zlib.Constant
 1 |
 2 | ||| Constants that zlib defines.
 3 | |||
 4 | public export
 5 | data ZlibConstant
 6 |   = Z_OK                -- Indicates that a zlib operation completed successfully.
 7 |   | Z_STREAM_END        -- Indicates that a compression or decompression stream has reached the end of the compressed data stream.
 8 |   | Z_FINISH            -- Indicates that the current chunk of input data is the final block of the stream.
 9 |   | Z_NEED_DICT         -- Indicates that a preset dictionary is required to continue decompression.
10 |   | Z_ERRNO             -- Indicates that zlib encountered an error in the underlying input/output operation.
11 |   | Z_STREAM_ERROR      -- Indicates that the zlib stream state is inconsistent or that an invalid parameter was supplied to a zlib operation.
12 |   | Z_DATA_ERROR        -- Indicates that the compressed data is corrupted or otherwise invalid for the selected decompression operation.
13 |   | Z_MEM_ERROR         -- Indicates that zlib was unable to allocate the memory required to complete the requested operation.
14 |   | Z_BUF_ERROR         -- Indicates that the supplied output buffer was too small to complete the requested operation.
15 |   | Z_VERSION_ERROR     -- Indicates that the zlib version supplied to an initialization function is incompatible with the linked zlib implementation.
16 |   | Z_DEFLATED          -- The DEFLATE compression method used by zlib.
17 |   | Z_DEFAULT_STRATEGY  -- The default compression strategy.
18 |   | Z_DEFAULT_MEM_LEVEL -- The default memory level used by `deflateInit2`.
19 |
20 | export
21 | zlibconstantToInt :  ZlibConstant
22 |                   -> Int
23 | zlibconstantToInt Z_OK                = 0
24 | zlibconstantToInt Z_STREAM_END        = 1
25 | zlibconstantToInt Z_FINISH            = 4
26 | zlibconstantToInt Z_NEED_DICT         = 2
27 | zlibconstantToInt Z_ERRNO             = -1
28 | zlibconstantToInt Z_STREAM_ERROR      = -2
29 | zlibconstantToInt Z_DATA_ERROR        = -3
30 | zlibconstantToInt Z_MEM_ERROR         = -4
31 | zlibconstantToInt Z_BUF_ERROR         = -5
32 | zlibconstantToInt Z_VERSION_ERROR     = -6
33 | zlibconstantToInt Z_DEFLATED          = 8
34 | zlibconstantToInt Z_DEFAULT_STRATEGY  = 0
35 | zlibconstantToInt Z_DEFAULT_MEM_LEVEL = 8
36 |